Forums - GLSL code generation bug

2 posts / 0 new
Last post
GLSL code generation bug
virgile
Join Date: 29 Jan 13
Posts: 1
Posted: Mon, 2013-06-17 23:18

Found a code generation bug in GLSL compiler:

uniform mat4 BlendMatrixArray[48];

// Doesn't work on Adreno (other OpenGL ES devices OK):
// putting a mat4() around  BlendMatrixArray[blendIndices.x] doesn't help either
blendPos += vec4((vec4(streams.Position.xyz, 1.0) * BlendMatrixArray[blendIndices.x]).xyz, 1.0) * 1.0;

// Creating intermediate variable works everywhere:
mat4 m = BlendMatrixArray[blendIndices.x];
blendPos += vec4((vec4(streams.Position.xyz, 1.0) * m).xyz, 1.0) * 1.0;

Also, the non-working version shows 11 ALU instruction in profiler, whereas working version shows 13 ALU instruction, clearly showing something went wrong in the code generator (maybe too aggressive optimizations?)

Hope it helps. Thanks!

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2013-07-31 10:53

Thanks for reporting this.  Could you let us know which device, OS, and build you are running the compiler on?

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.