[Piglit] [PATCH] arb_uniform_buffer_object: Exercise coherent fragment shader UBO.
Jose Fonseca
jfonseca at vmware.com
Thu Feb 5 06:37:22 PST 2015
At least for software renderers (like llvmpipe and softpipe), the vertex
and fragment shader stage are very different.
Achieve this by moving the color uniform to the fragment shader stage.
---
tests/spec/arb_uniform_buffer_object/bufferstorage.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tests/spec/arb_uniform_buffer_object/bufferstorage.c b/tests/spec/arb_uniform_buffer_object/bufferstorage.c
index 334fd4e..52e20e0 100644
--- a/tests/spec/arb_uniform_buffer_object/bufferstorage.c
+++ b/tests/spec/arb_uniform_buffer_object/bufferstorage.c
@@ -43,7 +43,6 @@ static const char vert_shader_text[] =
"\n"
"layout(std140) uniform;\n"
"uniform ub_pos_size { vec2 pos; float size; };\n"
- "uniform ub_color { vec4 color; float color_scale; };\n"
"uniform ub_rot {float rotation; };\n"
"\n"
"void main()\n"
@@ -54,15 +53,17 @@ static const char vert_shader_text[] =
" m[1][0] = -m[0][1]; \n"
" gl_Position.xy = m * gl_Vertex.xy * vec2(size) + pos;\n"
" gl_Position.zw = vec2(0, 1);\n"
- " gl_FrontColor = color * color_scale;\n"
"}\n";
static const char frag_shader_text[] =
"#extension GL_ARB_uniform_buffer_object : require\n"
"\n"
+ "layout(std140) uniform;\n"
+ "uniform ub_color { vec4 color; float color_scale; };\n"
+ "\n"
"void main()\n"
"{\n"
- " gl_FragColor = gl_Color;\n"
+ " gl_FragColor = color * color_scale;\n"
"}\n";
#define NUM_SQUARES 4
--
2.1.0
More information about the Piglit
mailing list