Skip to content

Commit

Permalink
glsl: texture*Proj() needs vec3 params for cubes and 3d textures.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Apr 25, 2016
1 parent be17814 commit a5e7941
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions mojoshader.c
Expand Up @@ -3408,8 +3408,17 @@ static void glsl_texld(Context *ctx, const int texldd)

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?
Expand Down

0 comments on commit a5e7941

Please sign in to comment.