Forums - GLSL Code not working?

2 posts / 0 new
Last post
GLSL Code not working?
Raid
Join Date: 23 Jan 13
Posts: 4
Posted: Tue, 2013-01-29 18:52
Good day to everyone. I just wanted to report a possible bug with the Adreno GLSL Compiler for Samsung Galaxy S3. There seems to be trouble with Uniform Structures. Works on Desktop GLSL, and on Android Emulator.

struct SceneStruct {
mat4 modelViewProjectionMatrix;
};

uniform SceneStruct scene;


Then with GLES your usual glUniformMatrix4F call with the name 'scene.modelViewProjectionMatrix', it doesn't work in Adreno. But it does on the Android Emulator and Linux Desktop version (tested on Samsung Galaxy S3).

But as soon as you do:

uniform mat4 scene_modelViewProjectionMatrix;

And: glUniformMatrix4F with 'scene_modelViewProjectionMatrix', it works..

I looked in the GLES GLSL specs and it does state that it can handle uniform structures.. Is this a bug?
  • Up0
  • Down0
Raid
Join Date: 23 Jan 13
Posts: 4
Posted: Tue, 2013-01-29 22:30
Hmmm.. Did a bit more testing.. Apparently uniform structures work.. sorta. Matrix fields will not work inside uniform structures.. As a work around, I placed them outside the Struct for now. I thought it was alignment issues or the such, but even one mat4 inside a structure will not work. Any thoughts?
  • 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.