D3D11: Add support to compile and link compute shaders
This is a reland of 2cd9d7e032fb412b539a907c58342060340387a1.
BUG=angleproject:1442
TEST=angle_end2end_tests
Change-Id: I5be0032b97617c31cdd4c66a823e8eb3b518867a
Reviewed-on: https://chromium-review.googlesource.com/430199
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/tests/gl_tests/ComputeShaderTest.cpp b/src/tests/gl_tests/ComputeShaderTest.cpp
index 375741d..4a206a4 100644
--- a/src/tests/gl_tests/ComputeShaderTest.cpp
+++ b/src/tests/gl_tests/ComputeShaderTest.cpp
@@ -190,6 +190,41 @@
EXPECT_GL_NO_ERROR();
}
+// Access all compute shader special variables.
+TEST_P(ComputeShaderTest, AccessAllSpecialVariables)
+{
+ const std::string csSource =
+ "#version 310 es\n"
+ "layout(local_size_x=4, local_size_y=3, local_size_z=2) in;\n"
+ "void main()\n"
+ "{\n"
+ " uvec3 temp1 = gl_NumWorkGroups;\n"
+ " uvec3 temp2 = gl_WorkGroupSize;\n"
+ " uvec3 temp3 = gl_WorkGroupID;\n"
+ " uvec3 temp4 = gl_LocalInvocationID;\n"
+ " uvec3 temp5 = gl_GlobalInvocationID;\n"
+ " uint temp6 = gl_LocalInvocationIndex;\n"
+ "}\n";
+
+ ANGLE_GL_COMPUTE_PROGRAM(program, csSource);
+}
+
+// Access part compute shader special variables.
+TEST_P(ComputeShaderTest, AccessPartSpecialVariables)
+{
+ const std::string csSource =
+ "#version 310 es\n"
+ "layout(local_size_x=4, local_size_y=3, local_size_z=2) in;\n"
+ "void main()\n"
+ "{\n"
+ " uvec3 temp1 = gl_WorkGroupSize;\n"
+ " uvec3 temp2 = gl_WorkGroupID;\n"
+ " uint temp3 = gl_LocalInvocationIndex;\n"
+ "}\n";
+
+ ANGLE_GL_COMPUTE_PROGRAM(program, csSource);
+}
+
// Check that it is not possible to create a compute shader when the context does not support ES
// 3.10
TEST_P(ComputeShaderTestES3, NotSupported)
@@ -199,7 +234,7 @@
EXPECT_GL_ERROR(GL_INVALID_ENUM);
}
-ANGLE_INSTANTIATE_TEST(ComputeShaderTest, ES31_OPENGL(), ES31_OPENGLES());
+ANGLE_INSTANTIATE_TEST(ComputeShaderTest, ES31_OPENGL(), ES31_OPENGLES(), ES31_D3D11());
ANGLE_INSTANTIATE_TEST(ComputeShaderTestES3, ES3_OPENGL(), ES3_OPENGLES());
} // namespace