Fix pipeline statistics test
authorDave Airlie <airlied@redhat.com>
Fri, 10 Apr 2020 01:24:12 +0000 (11:24 +1000)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 6 Aug 2020 08:26:26 +0000 (04:26 -0400)
The test calls glDrawRangeElements (mode=10, start=0, end=1, count=4, type=5125, indices=0x40)

But the index data is 0, 2, 1, 3

But a LINE adjacent primitive would use indices 2, 1 to make the line, now if the end == 1,
I don't think the behaviour for the first vertex is defined. If it gets clamped to 1,
you end up with a line 1,1 which our culling throws away as an empty line,
and we never run a fragment shader.

Now I think this is a bug in the test, in PipelineStatisticsQueryTestFunctionalBase::initVBO
m_vbo_n_indices = sizeof(raw_index_data_size) / sizeof(unsigned int);

VK-GL-CTS Issue: 2501
Components: OpenGL

Affects: KHR-GL45.pipeline_statistics_query_tests_ARB.functional_fragment_shader_invocations

Change-Id: Ie4ce573521ec7e1f169b9ec8ce6e76f41a0ce6f7

external/openglcts/modules/gl/gl4cPipelineStatisticsQueryTests.cpp

index d7d0ea2..172e0af 100644 (file)
@@ -2089,7 +2089,7 @@ void PipelineStatisticsQueryTestFunctionalBase::initVBO(
        const unsigned int indirect_arrays_draw_call_arguments_size   = sizeof(unsigned int) * 4; /* as per spec */
        const unsigned int indirect_elements_draw_call_arguments_size = sizeof(unsigned int) * 5; /* as per spec */
 
-       m_vbo_n_indices                                           = sizeof(raw_index_data_size) / sizeof(unsigned int);
+       m_vbo_n_indices                                           = raw_index_data_size / sizeof(unsigned int);
        m_vbo_vertex_data_offset                          = 0;
        m_vbo_index_data_offset                           = raw_vertex_data_size;
        m_vbo_indirect_arrays_argument_offset = m_vbo_index_data_offset + raw_index_data_size;