tests: Add additional shaders for testing
diff --git a/tests/render_tests.cpp b/tests/render_tests.cpp
index a420c92..3427815 100644
--- a/tests/render_tests.cpp
+++ b/tests/render_tests.cpp
@@ -762,6 +762,24 @@
" vertices[2] = vec2( 0.0, 1.0);\n"
" gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
"}\n";
+ static const char *vertShader2 =
+ "#version 330\n"
+ "out vec4 color;\n"
+ "out vec4 scale;\n"
+ "void main() {\n"
+ " vec2 vertices[3];"
+ " vertices[0] = vec2(-0.5, -0.5);\n"
+ " vertices[1] = vec2( 0.5, -0.5);\n"
+ " vertices[2] = vec2( 0.5, 0.5);\n"
+ " vec4 colors[3];\n"
+ " colors[0] = vec4(1.0, 0.0, 0.0, 1.0);\n"
+ " colors[1] = vec4(0.0, 1.0, 0.0, 1.0);\n"
+ " colors[2] = vec4(0.0, 0.0, 1.0, 1.0);\n"
+ " color = colors[int(mod(gl_VertexID, 3))];\n"
+ " scale = vec4(1.0, 1.0, 1.0, 1.0);\n"
+ " gl_Position = vec4(vertices[int(mod(gl_VertexID, 3))], 0.0, 1.0);\n"
+ "}\n";
+
static const char *vertShader2 =
"#version 130\n"
@@ -819,9 +837,17 @@
" vec4 texColor = textureLod(surface, samplePos, 0.0);\n"
" gl_FragColor = color * scale * foo + texColor;\n"
"}\n";
+ static const char *fragShader2 =
+ "#version 430\n"
+ "in vec4 color;\n"
+ "in vec4 scale;\n"
+ "layout(location = 0) uniform vec4 foo;\n"
+ "void main() {\n"
+ " gl_FragColor = color * scale + foo;\n"
+ "}\n";
ASSERT_NO_FATAL_FAILURE(CreateShader(XGL_SHADER_STAGE_FRAGMENT,
- fragShaderText, ps));
+ fragShader2, ps));
ps_stage.sType = XGL_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
ps_stage.pNext = &vs_stage;