Add simple Vulkan smoke test that doesn't use OpName
authorPyry Haulos <phaulos@google.com>
Tue, 24 May 2016 20:27:56 +0000 (13:27 -0700)
committerPyry Haulos <phaulos@google.com>
Tue, 31 May 2016 22:57:42 +0000 (15:57 -0700)
Covers following places where glslang generates OpName by default:

 * Vertex and fragment shader user-defined inputs
 * Vertex and fragment shader user-defined outputs
 * Built-in vertex shader outputs
 * Struct type name
 * Struct member name
 * Local variable

Bug: 29054693
Bug: 28887585
Change-Id: I07c2f3cfc1306811100e9380bf6c68d53b8d1a14

android/cts/master/com.drawelements.deqp.vk.xml
android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/api/vktApiSmokeTests.cpp

index 1a4209514f492204e277dc04db7c925f8366a7bf..79dde8d661f4c52b6cbbeefb345665678ef9e470 100644 (file)
@@ -47,6 +47,9 @@
                                <Test name="asm_triangle">
                                        <TestInstance/>
                                </Test>
+                               <Test name="asm_triangle_no_opname">
+                                       <TestInstance/>
+                               </Test>
                                <Test name="unused_resolve_attachment">
                                        <TestInstance/>
                                </Test>
index df1b257855cd0826226c3a82270378154f3d9854..0c43aded0959ae7a6c67565d1e5f7dfccae044ac 100644 (file)
@@ -6,6 +6,7 @@ dEQP-VK.api.smoke.create_sampler
 dEQP-VK.api.smoke.create_shader
 dEQP-VK.api.smoke.triangle
 dEQP-VK.api.smoke.asm_triangle
+dEQP-VK.api.smoke.asm_triangle_no_opname
 dEQP-VK.api.smoke.unused_resolve_attachment
 dEQP-VK.api.info.instance.physical_devices
 dEQP-VK.api.info.instance.layers
index e4a482623f2f9d463b0d205e29f958e8c39bfdb4..250095c1701bde5cf5f2b5ac4b2c9ba35264b4a1 100644 (file)
@@ -193,6 +193,77 @@ void createTriangleProgs (SourceCollections& dst)
                "void main (void) { o_color = vec4(1.0, 0.0, 1.0, 1.0); }\n");
 }
 
+void createProgsNoOpName (SourceCollections& dst)
+{
+       dst.spirvAsmSources.add("vert") <<
+               "OpCapability Shader\n"
+               "%1 = OpExtInstImport \"GLSL.std.450\"\n"
+               "OpMemoryModel Logical GLSL450\n"
+               "OpEntryPoint Vertex %4 \"main\" %20 %22 %26\n"
+               "OpSource ESSL 310\n"
+               "OpMemberDecorate %18 0 BuiltIn Position\n"
+               "OpMemberDecorate %18 1 BuiltIn PointSize\n"
+               "OpDecorate %18 Block\n"
+               "OpDecorate %22 Location 0\n"
+               "OpDecorate %26 Location 2\n"
+               "%2 = OpTypeVoid\n"
+               "%3 = OpTypeFunction %2\n"
+               "%6 = OpTypeFloat 32\n"
+               "%7 = OpTypeVector %6 4\n"
+               "%8 = OpTypeStruct %7\n"
+               "%9 = OpTypePointer Function %8\n"
+               "%11 = OpTypeInt 32 1\n"
+               "%12 = OpConstant %11 0\n"
+               "%13 = OpConstant %6 1\n"
+               "%14 = OpConstant %6 0\n"
+               "%15 = OpConstantComposite %7 %13 %14 %13 %13\n"
+               "%16 = OpTypePointer Function %7\n"
+               "%18 = OpTypeStruct %7 %6\n"
+               "%19 = OpTypePointer Output %18\n"
+               "%20 = OpVariable %19 Output\n"
+               "%21 = OpTypePointer Input %7\n"
+               "%22 = OpVariable %21 Input\n"
+               "%24 = OpTypePointer Output %7\n"
+               "%26 = OpVariable %24 Output\n"
+               "%4 = OpFunction %2 None %3\n"
+               "%5 = OpLabel\n"
+               "%10 = OpVariable %9 Function\n"
+               "%17 = OpAccessChain %16 %10 %12\n"
+               "OpStore %17 %15\n"
+               "%23 = OpLoad %7 %22\n"
+               "%25 = OpAccessChain %24 %20 %12\n"
+               "OpStore %25 %23\n"
+               "%27 = OpAccessChain %16 %10 %12\n"
+               "%28 = OpLoad %7 %27\n"
+               "OpStore %26 %28\n"
+               "OpReturn\n"
+               "OpFunctionEnd\n";
+       dst.spirvAsmSources.add("frag") <<
+               "OpCapability Shader\n"
+               "%1 = OpExtInstImport \"GLSL.std.450\"\n"
+               "OpMemoryModel Logical GLSL450\n"
+               "OpEntryPoint Fragment %4 \"main\" %9 %11\n"
+               "OpExecutionMode %4 OriginUpperLeft\n"
+               "OpSource ESSL 310\n"
+               "OpDecorate %9 RelaxedPrecision\n"
+               "OpDecorate %9 Location 0\n"
+               "OpDecorate %11 Location 2\n"
+               "%2 = OpTypeVoid\n"
+               "%3 = OpTypeFunction %2\n"
+               "%6 = OpTypeFloat 32\n"
+               "%7 = OpTypeVector %6 4\n"
+               "%8 = OpTypePointer Output %7\n"
+               "%9 = OpVariable %8 Output\n"
+               "%10 = OpTypePointer Input %7\n"
+               "%11 = OpVariable %10 Input\n"
+               "%4 = OpFunction %2 None %3\n"
+               "%5 = OpLabel\n"
+               "%12 = OpLoad %7 %11\n"
+               "OpStore %9 %12\n"
+               "OpReturn\n"
+               "OpFunctionEnd\n";
+}
+
 class RefVertexShader : public rr::VertexShader
 {
 public:
@@ -1495,6 +1566,7 @@ tcu::TestCaseGroup* createSmokeTests (tcu::TestContext& testCtx)
        addFunctionCaseWithPrograms     (smokeTests.get(), "create_shader",                             "", createShaderProgs,          createShaderModuleTest);
        addFunctionCaseWithPrograms     (smokeTests.get(), "triangle",                                  "", createTriangleProgs,        renderTriangleTest);
        addFunctionCaseWithPrograms     (smokeTests.get(), "asm_triangle",                              "", createTriangleAsmProgs,     renderTriangleTest);
+       addFunctionCaseWithPrograms     (smokeTests.get(), "asm_triangle_no_opname",    "", createProgsNoOpName,        renderTriangleTest);
        addFunctionCaseWithPrograms     (smokeTests.get(), "unused_resolve_attachment", "", createTriangleProgs,        renderTriangleUnusedResolveAttachmentTest);
 
        return smokeTests.release();