Commit 70b715c9 by Yunchao He Committed by Commit Bot

ES31: Add test for DispatchCompute with rendering program

BUG=angleproject:1955 Change-Id: Ib3ee1ead76c83c8dceafba30a1c7526dd0891f8c Reviewed-on: https://chromium-review.googlesource.com/756654 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent 3ef06a9f
...@@ -135,7 +135,7 @@ TEST_P(ComputeShaderTest, AttachMultipleShaders) ...@@ -135,7 +135,7 @@ TEST_P(ComputeShaderTest, AttachMultipleShaders)
GLint linkStatus; GLint linkStatus;
glGetProgramiv(program, GL_LINK_STATUS, &linkStatus); glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
EXPECT_EQ(0, linkStatus); EXPECT_EQ(GL_FALSE, linkStatus);
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
...@@ -192,6 +192,48 @@ TEST_P(ComputeShaderTest, AttachmentCount) ...@@ -192,6 +192,48 @@ TEST_P(ComputeShaderTest, AttachmentCount)
EXPECT_GL_NO_ERROR(); EXPECT_GL_NO_ERROR();
} }
// Attach a vertex and fragment shader and link, but dispatch compute.
TEST_P(ComputeShaderTest, DispatchComputeWithRenderingProgram)
{
const std::string vsSource =
"#version 310 es\n"
"void main()\n"
"{\n"
"}\n";
const std::string fsSource =
"#version 310 es\n"
"void main()\n"
"{\n"
"}\n";
GLuint program = glCreateProgram();
GLuint vs = CompileShader(GL_VERTEX_SHADER, vsSource);
GLuint fs = CompileShader(GL_FRAGMENT_SHADER, fsSource);
EXPECT_NE(0u, vs);
EXPECT_NE(0u, fs);
glAttachShader(program, vs);
glDeleteShader(vs);
glAttachShader(program, fs);
glDeleteShader(fs);
glLinkProgram(program);
GLint linkStatus;
glGetProgramiv(program, GL_LINK_STATUS, &linkStatus);
EXPECT_EQ(GL_TRUE, linkStatus);
EXPECT_GL_NO_ERROR();
glUseProgram(program);
glDispatchCompute(8, 4, 2);
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
}
// Access all compute shader special variables. // Access all compute shader special variables.
TEST_P(ComputeShaderTest, AccessAllSpecialVariables) TEST_P(ComputeShaderTest, AccessAllSpecialVariables)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment