render_test: Turn all tests back on, easier to debug with just one

This commit is contained in:
Cody Northrop 2014-10-09 21:26:47 -06:00 committed by Courtney Goeltzenleuchter
parent 8946015f2b
commit 8a6864cb9e

View File

@ -811,133 +811,133 @@ void XglRenderTest::DrawTriangleWithVertexFetch(const char *vertShaderText, cons
}
//TEST_F(XglRenderTest, TestDrawTriangle1)
//{
// static const char *vertShaderText =
// "#version 130\n"
// "vec2 vertices[3];\n"
// "void main() {\n"
// " vertices[0] = vec2(-1.0, -1.0);\n"
// " vertices[1] = vec2( 1.0, -1.0);\n"
// " vertices[2] = vec2( 0.0, 1.0);\n"
// " gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
// "}\n";
TEST_F(XglRenderTest, TestDrawTriangle1)
{
static const char *vertShaderText =
"#version 130\n"
"vec2 vertices[3];\n"
"void main() {\n"
" vertices[0] = vec2(-1.0, -1.0);\n"
" vertices[1] = vec2( 1.0, -1.0);\n"
" vertices[2] = vec2( 0.0, 1.0);\n"
" gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
"}\n";
// static const char *fragShaderText =
// "#version 130\n"
// "uniform vec4 foo;\n"
// "void main() {\n"
// " gl_FragColor = foo;\n"
// "}\n";
// DrawTriangleTest(vertShaderText, fragShaderText);
//}
static const char *fragShaderText =
"#version 130\n"
"uniform vec4 foo;\n"
"void main() {\n"
" gl_FragColor = foo;\n"
"}\n";
DrawTriangleTest(vertShaderText, fragShaderText);
}
//TEST_F(XglRenderTest, TestDrawTriangle2)
//{
TEST_F(XglRenderTest, TestDrawTriangle2)
{
// static const char *vertShaderText =
// "#version 130\n"
// "out vec4 color;\n"
// "out vec4 scale;\n"
// "vec2 vertices[3];\n"
// "void main() {\n"
// "vec2 vertices[3];\n"
// " 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[gl_VertexID % 3];\n"
// " scale = vec4(1.0, 1.0, 1.0, 1.0);\n"
// " gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
// "}\n";
static const char *vertShaderText =
"#version 130\n"
"out vec4 color;\n"
"out vec4 scale;\n"
"vec2 vertices[3];\n"
"void main() {\n"
"vec2 vertices[3];\n"
" 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[gl_VertexID % 3];\n"
" scale = vec4(1.0, 1.0, 1.0, 1.0);\n"
" gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
"}\n";
// static const char *fragShaderText =
// "#version 130\n"
// "in vec4 color;\n"
// "in vec4 scale;\n"
// "uniform vec4 foo;\n"
// "void main() {\n"
// " gl_FragColor = color * scale + foo;\n"
// "}\n";
static const char *fragShaderText =
"#version 130\n"
"in vec4 color;\n"
"in vec4 scale;\n"
"uniform vec4 foo;\n"
"void main() {\n"
" gl_FragColor = color * scale + foo;\n"
"}\n";
// DrawTriangleTest(vertShaderText, fragShaderText);
//}
DrawTriangleTest(vertShaderText, fragShaderText);
}
//TEST_F(XglRenderTest, TestDrawTriangle3)
//{
// static const char *vertShaderText =
// "#version 130\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"
// " gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
// "}\n";
TEST_F(XglRenderTest, TestDrawTriangle3)
{
static const char *vertShaderText =
"#version 130\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"
" gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
"}\n";
// static const char *fragShaderText =
// "#version 130\n"
// "void main() {\n"
// " gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n"
// "}\n";
static const char *fragShaderText =
"#version 130\n"
"void main() {\n"
" gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n"
"}\n";
// DrawTriangleTest(vertShaderText, fragShaderText);
//}
DrawTriangleTest(vertShaderText, fragShaderText);
}
//TEST_F(XglRenderTest, TestDrawRotatedTriangle) {
// DrawRotatedTriangleTest();
//}
TEST_F(XglRenderTest, TestDrawRotatedTriangle) {
DrawRotatedTriangleTest();
}
//TEST_F(XglRenderTest, TestDrawTriangleTwoFSUniforms)
//{
// static const char *vertShaderText =
// "#version 130\n"
// "out vec4 color;\n"
// "out vec4 scale;\n"
// "out vec2 samplePos;\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[gl_VertexID % 3];\n"
// " vec2 positions[3];"
// " positions[0] = vec2( 0.0, 0.0);\n"
// " positions[1] = vec2( 1.0, 0.0);\n"
// " positions[2] = vec2( 1.0, 1.0);\n"
// " scale = vec4(0.0, 0.0, 0.0, 0.0);\n"
// " gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
// "}\n";
TEST_F(XglRenderTest, TestDrawTriangleTwoFSUniforms)
{
static const char *vertShaderText =
"#version 130\n"
"out vec4 color;\n"
"out vec4 scale;\n"
"out vec2 samplePos;\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[gl_VertexID % 3];\n"
" vec2 positions[3];"
" positions[0] = vec2( 0.0, 0.0);\n"
" positions[1] = vec2( 1.0, 0.0);\n"
" positions[2] = vec2( 1.0, 1.0);\n"
" scale = vec4(0.0, 0.0, 0.0, 0.0);\n"
" gl_Position = vec4(vertices[gl_VertexID % 3], 0.0, 1.0);\n"
"}\n";
// static const char *fragShaderText =
// "#version 430\n"
// "in vec4 color;\n"
// "in vec4 scale;\n"
// "uniform vec4 foo;\n"
// "uniform vec4 bar;\n"
// "void main() {\n"
// // by default, with no location or blocks
// // the compiler will read them from buffer
// // in reverse order of first use in shader
// // The buffer contains red, followed by blue,
// // so foo should be blue, bar should be red
// " gl_FragColor = color * scale * foo * bar + foo;\n"
// "}\n";
static const char *fragShaderText =
"#version 430\n"
"in vec4 color;\n"
"in vec4 scale;\n"
"uniform vec4 foo;\n"
"uniform vec4 bar;\n"
"void main() {\n"
// by default, with no location or blocks
// the compiler will read them from buffer
// in reverse order of first use in shader
// The buffer contains red, followed by blue,
// so foo should be blue, bar should be red
" gl_FragColor = color * scale * foo * bar + foo;\n"
"}\n";
// DrawTriangleTwoUniformsFS(vertShaderText, fragShaderText);
//}
DrawTriangleTwoUniformsFS(vertShaderText, fragShaderText);
}
TEST_F(XglRenderTest, TestDrawTriangleWithVertexFetch)
{