https://bugs.freedesktop.org/show_bug.cgi?id=44217
Bug #: 44217 Summary: vertex attribute 0 inconsistencies. Classification: Unclassified Product: Mesa Version: git Platform: x86-64 (AMD64) OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Mesa core AssignedTo: mesa-dev@lists.freedesktop.org ReportedBy: b...@taniwha.org I was having a lot of trouble using glVertexAttrib4f to set the vertex color in my shader, and I traced it down to it being due to the shader linker assigning attribute 0 to my vcolor attribute. There seem to be several problems related with vertex attribute 0: The api test in get_current_attrib() is gles2 only, not gl3 as well (this may be a misunderstanding on my part). There are no api tests in VertexAttrib4fARB and friends (at least check for for GLES2, please) Most importantly: the shader linker is assigning attribute 0. Interestingly, attribute 0 works perfectly well if an array is used on it. I noticed the problem because when my vcolor attribute was assigned 0, it was never set and thus everything was rendered black. vertex shader --8<-- uniform mat4 mvp_mat; attribute vec4 vertex; attribute vec4 vcolor; varying vec4 color; varying vec2 st; void main (void) { gl_Position = mvp_mat * vec4 (vertex.xy, 0.0, 1.0); st = vertex.zw; color = vcolor; } --8<-- fragment shader --8<-- uniform sampler2D texture; uniform sampler2D palette; varying vec4 color; varying vec2 st; void main (void) { float pix; pix = texture2D (texture, st).r; if (pix == 1.0) discard; gl_FragColor = texture2D (palette, vec2 (pix, 0.5)) * color; } --8<-- full source can be had from git://git.quakeforge.net/gitroot/quake/quakeforge glsl branch. However, this has the workaround for the problem (vertex and vcolor declaration order swapped in the vertex shader) -- Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug. _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev