Summary: | [GLSL] Cannot get location of a uniform struct member | ||
---|---|---|---|
Product: | Mesa | Reporter: | Митко Мошев <Mo6eeeB> |
Component: | Mesa core | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | medium | ||
Version: | 7.6 | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | |||
Bug Blocks: | 29044 |
Description
Митко Мошев
2010-01-25 09:53:48 UTC
Update: After some more testing, I found out that varying parameters are not passed correctly between the vertex and fragment shaders. Using the following vertex shader: uniform mat4 MV; uniform mat4 MVP; uniform mat3 N; varying vec3 blue; varying vec3 green; void main() { gl_PointSize = 1; gl_Position = MVP * gl_Vertex; blue = vec3(0, 0, 1, 1); green = vec3(0, 1, 0, 1); } and fragment shader: varying vec3 blue; varying vec3 green; void main() { gl_FragColor = vec4(green, 1); } I see everything rendered blue, NOT green. If I do gl_FragColor = vec4(blue, 1); I see nothing, i.e. a black screen. Additionally, using the software renderer, everything works. I think your struct issues should be fixed with the glsl2 merge to Mesa master. Also, I stuffed your two shaders at the bottom into a shader_runner test, and it came out fine (after fixing the vec3 constructor to actually have 3 arguments). So this should be fixed now. If you've got issues with structure usage still, could you make a piglit shader_runner test for it? |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.