mojoshader.c
changeset 1155 006e06a6c326
parent 1154 1d6c2aadd16a
child 1156 6e760a19f456
--- a/mojoshader.c	Mon Apr 25 02:51:45 2016 -0400
+++ b/mojoshader.c	Mon Apr 25 02:54:04 2016 -0400
@@ -3408,8 +3408,17 @@
 
         if (texldd)
         {
-            make_GLSL_srcarg_string_vec2(ctx, 2, src2, sizeof (src2));
-            make_GLSL_srcarg_string_vec2(ctx, 3, src3, sizeof (src3));
+            if (sreg->index == TEXTURE_TYPE_2D)
+            {
+                make_GLSL_srcarg_string_vec2(ctx, 2, src2, sizeof (src2));
+                make_GLSL_srcarg_string_vec2(ctx, 3, src3, sizeof (src3));
+            } // if
+            else
+            {
+                assert((sreg->index == TEXTURE_TYPE_CUBE) || (sreg->index == TEXTURE_TYPE_VOLUME));
+                make_GLSL_srcarg_string_vec3(ctx, 2, src2, sizeof (src2));
+                make_GLSL_srcarg_string_vec3(ctx, 3, src3, sizeof (src3));
+            } // else
         } // if
 
         // !!! FIXME: can TEXLDD set instruction_controls?