From 679c03480ce035500487a186024db3e402889097 Mon Sep 17 00:00:00 2001 From: James Fitzpatrick Date: Thu, 14 May 2020 16:51:14 +0100 Subject: [PATCH] Add missing writes to PointSize in subgroups tests When shaderTessellationAndGeometryPointSize is enabled the PointSize builtin is undefined unless it is written to in the last vertex processing phase so propagate the write through all vertex stages. Affects: dEQP-VK.subgroups.* Components: Vulkan VK-GL-CTS issue: 2404 Change-Id: Id8ffe8401c0a69d1e13847d168bafcec7e3c7a52 (cherry picked from commit 75f9abc189d4bef82d9496f55284c382b3b7a43f) --- .../subgroups/vktSubgroupsArithmeticTests.cpp | 2 +- .../subgroups/vktSubgroupsBallotBroadcastTests.cpp | 2 +- .../subgroups/vktSubgroupsBallotMasksTests.cpp | 5 +++ .../subgroups/vktSubgroupsBallotOtherTests.cpp | 5 +++ .../vulkan/subgroups/vktSubgroupsBallotTests.cpp | 3 ++ .../subgroups/vktSubgroupsBuiltinMaskVarTests.cpp | 3 ++ .../subgroups/vktSubgroupsBuiltinVarTests.cpp | 49 ++++++++++++++++++++++ .../subgroups/vktSubgroupsClusteredTests.cpp | 2 +- .../subgroups/vktSubgroupsPartitionedTests.cpp | 2 + .../vulkan/subgroups/vktSubgroupsQuadTests.cpp | 2 +- .../vulkan/subgroups/vktSubgroupsShapeTests.cpp | 5 +++ .../vulkan/subgroups/vktSubgroupsShuffleTests.cpp | 5 +++ .../vulkan/subgroups/vktSubgroupsTestsUtils.cpp | 6 +++ .../vulkan/subgroups/vktSubgroupsTestsUtils.hpp | 1 + .../vulkan/subgroups/vktSubgroupsVoteTests.cpp | 5 +++ 15 files changed, 93 insertions(+), 4 deletions(-) diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp index 207474d..97cb335 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp @@ -602,7 +602,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) std::string extHeader = getExtHeader(caseDef); - subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, extHeader, testSrc, ""); + subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, *caseDef.geometryPointSizeSupported, extHeader, testSrc, ""); } void supportedCheck (Context& context, CaseDefinition caseDef) diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp index 96c92c2..07ae70d 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp @@ -239,7 +239,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) std::string testSrc = getTestSrc(caseDef); std::string helperStr = getHelperFunctionARB(caseDef); - subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, extHeader, testSrc, helperStr); + subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, *caseDef.geometryPointSizeSupported, extHeader, testSrc, helperStr); } void supportedCheck (Context& context, CaseDefinition caseDef) diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp index 9894e76..cf0ef40 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp @@ -215,6 +215,7 @@ void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinitio << bdyStr << " out_color[gl_InvocationID ] = float(tempResult);\n" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") << "}\n"; programCollection.glslSources.add("tesc") @@ -234,6 +235,7 @@ void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinitio << bdyStr << " out_color = float(tempResult);\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); @@ -318,6 +320,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; const string tese = @@ -336,6 +339,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = tempResult;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; const string geometry = @@ -354,6 +358,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + bdyStr + " result[gl_PrimitiveIDIn] = tempResult;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp index 9aaf27d..930b1ce 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp @@ -308,6 +308,7 @@ void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinitio << bdyStr << " out_color[gl_InvocationID ] = float(tempResult);\n" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") << "}\n"; programCollection.glslSources.add("tesc") @@ -326,6 +327,7 @@ void initFrameBufferPrograms(SourceCollections& programCollection, CaseDefinitio << bdyStr << " out_color = float(tempResult);\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); @@ -407,6 +409,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; const string tese = @@ -424,6 +427,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = tempResult;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; const string geometry = @@ -441,6 +445,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + bdyStr + " result[gl_PrimitiveIDIn] = tempResult;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp index 9f6c0e1..7b11007 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp @@ -818,6 +818,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "" ) + "}\n"; const string tese = @@ -839,6 +840,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = tempResult;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "" ) + "}\n"; const string geometry = @@ -860,6 +862,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + testSrc + " result[gl_PrimitiveIDIn] = tempResult;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "" ) + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp index 8fe6bf6..209904b 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp @@ -1277,6 +1277,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tesc") << glu::TessellationControlSource(tesc) << vk::ShaderBuildOptions(programCollection.usedVulkanVersion, vk::SPIRV_VERSION_1_3, 0u); @@ -1298,6 +1299,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = tempResult;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tese") @@ -1320,6 +1322,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + bdy + " result[gl_PrimitiveIDIn] = tempResult;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp index c8e6921..db34b6e 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp @@ -1125,8 +1125,14 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + #if GEOMETRY_POINT_SIZE_SUPPORTED + " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" + #endif "}\n"; */ + + const string pointSizeCapability = (*caseDef.geometryPointSizeSupported ? "OpCapability TessellationPointSize\n" : ""); + const string tesc = "; SPIR-V\n" "; Version: 1.3\n" @@ -1135,6 +1141,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "; Schema: 0\n" "OpCapability Tessellation\n" "OpCapability GroupNonUniform\n" + + pointSizeCapability + "%1 = OpExtInstImport \"GLSL.std.450\"\n" "OpMemoryModel Logical GLSL450\n" "OpEntryPoint TessellationControl %4 \"main\" %15 %18 %20 %26 %36 %48 %54\n" @@ -1205,6 +1212,10 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "%54 = OpVariable %53 Input\n" "%56 = OpTypePointer Input %42\n" "%59 = OpTypePointer Output %42\n" + + (*caseDef.geometryPointSizeSupported ? + "%61 = OpTypePointer Input %32\n" + "%62 = OpTypePointer Output %32\n" + "%63 = OpConstant %12 1\n" : "") + "%4 = OpFunction %2 None %3\n" "%5 = OpLabel\n" "%16 = OpLoad %12 %15\n" @@ -1230,6 +1241,11 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "%58 = OpLoad %42 %57\n" "%60 = OpAccessChain %59 %48 %49 %13\n" "OpStore %60 %58\n" + + (*caseDef.geometryPointSizeSupported ? + "%64 = OpAccessChain %61 %54 %49 %63\n" + "%65 = OpLoad %32 %64\n" + "%66 = OpAccessChain %62 %48 %49 %63\n" + "OpStore %66 %65\n" : "") + "OpReturn\n" "OpFunctionEnd\n"; programCollection.spirvAsmSources.add("tesc") << tesc << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3); @@ -1250,8 +1266,14 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0);\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + #if GEOMETRY_POINT_SIZE_SUPPORTED + " gl_PointSize = gl_in[0].gl_PointSize;\n" + #endif "}\n"; */ + + const string pointSizeCapability = (*caseDef.geometryPointSizeSupported ? "OpCapability TessellationPointSize\n" : ""); + const string tese = "; SPIR - V\n" "; Version: 1.3\n" @@ -1260,6 +1282,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "; Schema: 0\n" "OpCapability Tessellation\n" "OpCapability GroupNonUniform\n" + + pointSizeCapability + "%1 = OpExtInstImport \"GLSL.std.450\"\n" "OpMemoryModel Logical GLSL450\n" "OpEntryPoint TessellationEvaluation %4 \"main\" %15 %23 %33 %35 %48 %53\n" @@ -1329,6 +1352,10 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "%54 = OpTypePointer Input %43\n" "%61 = OpConstant %20 2\n" "%65 = OpTypePointer Output %43\n" + + (*caseDef.geometryPointSizeSupported ? + "%67 = OpTypePointer Input %20\n" + "%68 = OpTypePointer Output %20\n" + "%69 = OpConstant %12 1\n" : "") + "%4 = OpFunction %2 None %3\n" "%5 = OpLabel\n" "%41 = OpVariable %40 Function\n" @@ -1357,6 +1384,11 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "%64 = OpFAdd %43 %56 %63\n" "%66 = OpAccessChain %65 %48 %13\n" "OpStore %66 %64\n" + + (*caseDef.geometryPointSizeSupported ? + "%70 = OpAccessChain %67 %53 %13 %69\n" + "%71 = OpLoad %20 %70\n" + "%72 = OpAccessChain %68 %48 %69\n" + "OpStore %72 %71\n" : "") + "OpReturn\n" "OpFunctionEnd\n"; programCollection.spirvAsmSources.add("tese") << tese << SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3); @@ -1378,10 +1410,16 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "{\n" " result[gl_PrimitiveIDIn] = uvec4(gl_SubgroupSize, gl_SubgroupInvocationID, 0, 0);\n" " gl_Position = gl_in[0].gl_Position;\n" + #if GEOMETRY_POINT_SIZE_SUPPORTED + " gl_PointSize = gl_in[0].gl_PointSize;\n" + #endif " EmitVertex();\n" " EndPrimitive();\n" "}\n"; */ + + const string pointSizeCapability = (*caseDef.geometryPointSizeSupported ? "OpCapability GeometryPointSize\n" : ""); + const string geometry = "; SPIR-V\n" "; Version: 1.3\n" @@ -1390,6 +1428,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "; Schema: 0\n" "OpCapability Geometry\n" "OpCapability GroupNonUniform\n" + + pointSizeCapability + "%1 = OpExtInstImport \"GLSL.std.450\"\n" "OpMemoryModel Logical GLSL450\n" "OpEntryPoint Geometry %4 \"main\" %15 %18 %20 %32 %36\n" @@ -1449,6 +1488,10 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "%36 = OpVariable %35 Input\n" "%37 = OpTypePointer Input %27\n" "%40 = OpTypePointer Output %27\n" + + (*caseDef.geometryPointSizeSupported ? + "%42 = OpTypePointer Input %26\n" + "%43 = OpTypePointer Output %26\n" + "%44 = OpConstant %12 1\n" : "") + "%4 = OpFunction %2 None %3\n" "%5 = OpLabel\n" "%16 = OpLoad %12 %15\n" @@ -1461,10 +1504,16 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) "%39 = OpLoad %27 %38\n" "%41 = OpAccessChain %40 %32 %13\n" "OpStore %41 %39\n" + + (*caseDef.geometryPointSizeSupported ? + "%45 = OpAccessChain %42 %36 %13 %44\n" + "%46 = OpLoad %26 %45\n" + "%47 = OpAccessChain %43 %32 %44\n" + "OpStore %47 %46\n" : "") + "OpEmitVertex\n" "OpEndPrimitive\n" "OpReturn\n" "OpFunctionEnd\n"; + addGeometryShadersFromTemplate(geometry, SpirVAsmBuildOptions(programCollection.usedVulkanVersion, SPIRV_VERSION_1_3), programCollection.spirvAsmSources); } diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp index efd30d1..005fe97 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp @@ -436,7 +436,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) std::string extHeader = getExtHeader(caseDef); std::string testSrc = getBodySource(caseDef); - subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, extHeader, testSrc, ""); + subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, *caseDef.geometryPointSizeSupported, extHeader, testSrc, ""); } void supportedCheck (Context& context, CaseDefinition caseDef) diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsPartitionedTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsPartitionedTests.cpp index b76c091..26ae1a3 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsPartitionedTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsPartitionedTests.cpp @@ -644,6 +644,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << bdy.str() << " out_color[gl_InvocationID] = float(tempResult);" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") << "}\n"; @@ -673,6 +674,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << bdy.str() << " out_color = float(tempResult);\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp index 080a783..e9e1db0 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp @@ -198,7 +198,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) std::string extHeader = getExtHeader(caseDef.format); std::string testSrc = getTestSrc(caseDef); - subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, extHeader, testSrc, ""); + subgroups::initStdPrograms(programCollection, buildOptions, caseDef.shaderStage, caseDef.format, *caseDef.geometryPointSizeSupported, extHeader, testSrc, ""); } void supportedCheck (Context& context, CaseDefinition caseDef) diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp index 537aa8c..66e4569 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp @@ -203,6 +203,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << bdy.str() << " out_color[gl_InvocationID] = float(tempResult);\n" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; programCollection.glslSources.add("tesc") @@ -222,6 +223,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << bdy.str() << " out_color = float(tempResult);\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); @@ -366,6 +368,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tesc") @@ -388,6 +391,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = 1;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tese") @@ -410,6 +414,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + bdy.str() + " result[gl_PrimitiveIDIn] = tempResult;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp index 052744d..eef837f 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp @@ -236,6 +236,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << testSource << " out_color[gl_InvocationID] = temp_res;\n" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") << "}\n"; programCollection.glslSources.add("tesc") @@ -266,6 +267,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << testSource << " out_color = temp_res;\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); @@ -363,6 +365,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tesc") @@ -385,6 +388,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = temp_res;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tese") @@ -407,6 +411,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + testSource + " result[gl_PrimitiveIDIn] = temp_res;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp index 96d8fe5..cff6d12 100644 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp @@ -1052,6 +1052,7 @@ void vkt::subgroups::initStdFrameBufferPrograms( SourceCollections& programCo << testSrc << " out_color[gl_InvocationID] = float(tempRes);\n" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (gsPointSize ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") << "}\n"; programCollection.glslSources.add("tesc") @@ -1077,6 +1078,7 @@ void vkt::subgroups::initStdFrameBufferPrograms( SourceCollections& programCo << testSrc << " out_color = float(tempRes);\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (gsPointSize ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); @@ -1092,6 +1094,7 @@ void vkt::subgroups::initStdPrograms( vk::SourceCollections& programCollection const vk::ShaderBuildOptions& buildOptions, vk::VkShaderStageFlags shaderStage, vk::VkFormat format, + bool gsPointSize, std::string extHeader, std::string testSrc, std::string helperStr) @@ -1178,6 +1181,7 @@ void vkt::subgroups::initStdPrograms( vk::SourceCollections& programCollection " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (gsPointSize ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; const string tese = @@ -1201,6 +1205,7 @@ void vkt::subgroups::initStdPrograms( vk::SourceCollections& programCollection " result[gl_PrimitiveID * 2 + uint(gl_TessCoord.x + 0.5)] = tempRes;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (gsPointSize ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; const string geometry = @@ -1224,6 +1229,7 @@ void vkt::subgroups::initStdPrograms( vk::SourceCollections& programCollection + testSrc + " result[gl_PrimitiveIDIn] = tempRes;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (gsPointSize ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp index 80e48e1..45dc7ae 100644 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.hpp @@ -117,6 +117,7 @@ void initStdPrograms( vk::SourceCollections& programCollection, const vk::ShaderBuildOptions& buildOptions, vk::VkShaderStageFlags shaderStage, vk::VkFormat format, + bool gsPointSize, std::string extHeader, std::string testSrc, std::string helperStr); diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp index d4308b3..feaa42f 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp @@ -268,6 +268,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << source << " out_color[gl_InvocationID] = float(result);" << " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + << (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") << "}\n"; programCollection.glslSources.add("tesc") @@ -295,6 +296,7 @@ void initFrameBufferPrograms (SourceCollections& programCollection, CaseDefiniti << source << " out_color = float(result);\n" << " gl_Position = mix(gl_in[0].gl_Position, gl_in[1].gl_Position, gl_TessCoord.x);\n" + << (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") << "}\n"; subgroups::setTesCtrlShaderFrameBuffer(programCollection); @@ -488,6 +490,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " gl_TessLevelOuter[1] = 1.0f;\n" " }\n" " gl_out[gl_InvocationID].gl_Position = gl_in[gl_InvocationID].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_out[gl_InvocationID].gl_PointSize = gl_in[gl_InvocationID].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tesc") @@ -517,6 +520,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) " res[offset] = result;\n" " float pixelSize = 2.0f/1024.0f;\n" " gl_Position = gl_in[0].gl_Position + gl_TessCoord.x * pixelSize / 2.0f;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + "}\n"; programCollection.glslSources.add("tese") @@ -546,6 +550,7 @@ void initPrograms(SourceCollections& programCollection, CaseDefinition caseDef) + source + " res[offset] = result;\n" " gl_Position = gl_in[0].gl_Position;\n" + + (*caseDef.geometryPointSizeSupported ? " gl_PointSize = gl_in[0].gl_PointSize;\n" : "") + " EmitVertex();\n" " EndPrimitive();\n" "}\n"; -- 2.7.4