Skip to content

Commit 2f332e7

Browse files
souravpNVpboyleQCOM
authored andcommitted
Use correct modulo for query pool patch tests
Replace hardcoded 4 with per-primitive control point count to ensure correct patch grouping for triangles, isolines, and quads. Affects: dEQP-VK.query_pool.statistics_query*input_assembly_primitives.*patch_list* dEQP-VK.query_pool.statistics_query.tes_control_patches.*control_patches* Components: Vulkan VK-GL-CTS issue: 6104 Change-Id: I309eb38ba6f763d91e732fb11c448acc33d8e3c6
1 parent ebaa445 commit 2f332e7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

external/vulkancts/modules/vulkan/query_pool/vktQueryPoolStatisticsTests.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4171,6 +4171,12 @@ class QueryPoolGraphicStatisticsTest : public TestCase
41714171
// Position and color data from vertex buffer will be ignored.
41724172
// Vertex shader provides position and color for the quad.
41734173
std::ostringstream source;
4174+
4175+
// Use modulo based on primitive mode to ensure control points repeat per patch consistently.
4176+
// For isolines we intentionally use % 4 (not % 2) to keep patches distinct for query stability;
4177+
// TCS still declares layout(vertices = 2) and consumes only gl_in[0..1], so image output is unchanged.
4178+
const uint32_t vsModulo = m_parametersGraphic.primMode == TESS_PRIM_TRIANGLES ? 3u : 4u;
4179+
41744180
source << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
41754181
<< "vec4 positions[4] = vec4[](\n"
41764182
<< " vec4(-1.0f, -1.0f, 0.0f, 1.0f),\n"
@@ -4182,7 +4188,7 @@ class QueryPoolGraphicStatisticsTest : public TestCase
41824188
<< "layout(location = 0) out vec4 out_color;\n"
41834189
<< "\n"
41844190
<< "void main() {\n"
4185-
<< " gl_Position = positions[gl_VertexIndex % 4];\n"
4191+
<< " gl_Position = positions[gl_VertexIndex % " << vsModulo << "];\n"
41864192
<< " gl_PointSize = 1.0f;\n"
41874193
<< " out_color = vec4(0.0f, 0.0f, 1.0f, 1.0f); // blue\n"
41884194
<< "}\n";

0 commit comments

Comments
 (0)