"{\n"
" atomicCounterIncrement(test_counter);\n"
"}\n";
+const char* PipelineStatisticsQueryUtilities::dummy_cs_code_arb =
+ "#version 330\n"
+ "#extension GL_ARB_compute_shader : require\n"
+ "#extension GL_ARB_shader_atomic_counters : require\n"
+ "\n"
+ "layout(local_size_x=1, local_size_y = 1, local_size_z = 1) in;\n"
+ "\n"
+ "layout(binding = 0) uniform atomic_uint test_counter;\n"
+ "\n"
+ "void main()\n"
+ "{\n"
+ " atomicCounterIncrement(test_counter);\n"
+ "}\n";
const char* PipelineStatisticsQueryUtilities::dummy_fs_code = "#version 130\n"
"\n"
"out vec4 result;\n"
void PipelineStatisticsQueryTestFunctional8::initObjects()
{
const glw::Functions& gl = m_context.getRenderContext().getFunctions();
+ const char* cs_code = NULL;
/* This test should not execute if we don't have compute shaders */
- if (!glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 3)) &&
- !m_context.getContextInfo().isExtensionSupported("GL_ARB_compute_shader"))
+ if (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 3)))
+ {
+ cs_code = PipelineStatisticsQueryUtilities::dummy_cs_code;
+ }
+ else if (m_context.getContextInfo().isExtensionSupported("GL_ARB_compute_shader") &&
+ m_context.getContextInfo().isExtensionSupported("GL_ARB_shader_atomic_counters"))
+ {
+ cs_code = PipelineStatisticsQueryUtilities::dummy_cs_code_arb;
+ }
+ else
{
- throw tcu::NotSupportedError("OpenGL 4.3+ / compute shaders required to run this test.");
+ throw tcu::NotSupportedError("OpenGL 4.3+ / compute shaders and atomic counters required to run this test.");
}
- buildProgram(PipelineStatisticsQueryUtilities::dummy_cs_code, DE_NULL, /* fs_body */
+ buildProgram(cs_code,
+ DE_NULL, /* fs_body */
DE_NULL, /* gs_body */
DE_NULL, /* tc_body */
DE_NULL, /* te_body */
* GL_COMPUTE_SHADER_INVOCATIONS_ARB query works correctly.
*/
static const char* dummy_cs_code;
+ static const char* dummy_cs_code_arb;
/* Code of a fragment shader used by a number of functional tests */
static const char* dummy_fs_code;
/* Code of a tessellation control shader used by a functional test that verifies