GLU_EXPECT_NO_ERROR(gl.getError(), "glTexStorage2D() call failed.");
}
- gl.bindImageTexture(0, /* unit */
- m_cs_to_id, 0, /* level */
- GL_FALSE, /* layered */
- 0, /* layer */
- GL_WRITE_ONLY, GL_R32I);
- GLU_EXPECT_NO_ERROR(gl.getError(), "glBindImageTexture() call failed.");
+ if (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 3)) ||
+ m_context.getContextInfo().isExtensionSupported("GL_ARB_compute_shader")) {
+ gl.bindImageTexture(0, /* unit */
+ m_cs_to_id, 0, /* level */
+ GL_FALSE, /* layered */
+ 0, /* layer */
+ GL_WRITE_ONLY, GL_R32I);
+ GLU_EXPECT_NO_ERROR(gl.getError(), "glBindImageTexture() call failed.");
+ }
gl.bindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo_draw_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBindFramebuffer() call failed.");
static const glw::GLchar* core_functionality = "#version 450\n";
- static const glw::GLchar* extention_functionality = "#version 440\n"
+ static const glw::GLchar* extention_functionality = "#version 150\n"
"\n"
"#extension GL_ARB_cull_distance : require\n"
+ "TEMPLATE_EXTENSIONS\n"
"\n"
"#ifndef GL_ARB_cull_distance\n"
" #error GL_ARB_cull_distance is undefined\n"
TCU_FAIL("Unknown primitive mode");
}
+ CullDistance::Utilities::replaceAll(
+ shader_source,
+ std::string("TEMPLATE_EXTENSIONS"),
+ std::string("#extension GL_ARB_tessellation_shader: require"));
break;
}
TCU_FAIL("Unknown primitive mode");
}
+ CullDistance::Utilities::replaceAll(
+ shader_source,
+ std::string("TEMPLATE_EXTENSIONS"),
+ std::string("#extension GL_ARB_tessellation_shader: require"));
break;
}
TCU_FAIL("Unknown shader type");
}
+ /* Clear out in case no specific exts were needed */
+ CullDistance::Utilities::replaceAll(
+ shader_source,
+ std::string("TEMPLATE_EXTENSIONS"),
+ std::string(""));
+
/* Adjust clipdistances declaration */
if (redeclare_clipdistances && clipdistances_array_size > 0)
{
bool is_arb_tf_2 = m_context.getContextInfo().isExtensionSupported("GL_ARB_transform_feedback2");
bool is_arb_tf_3 = m_context.getContextInfo().isExtensionSupported("GL_ARB_transform_feedback3");
bool is_arb_tf_instanced = m_context.getContextInfo().isExtensionSupported("GL_ARB_transform_feedback_instanced");
+ bool is_tessellation = m_context.getContextInfo().isExtensionSupported("GL_ARB_tessellation_shader");
if (is_ext_tf_1)
{
gl, m_context.getTestContext().getLog(), m_geometry_shader, NULL, NULL, s_vertex_shader_without_output,
s_fragment_shader, &m_varying_name, 1, GL_INTERLEAVED_ATTRIBS);
- m_program_id_with_tessellation_shaders = gl3cts::TransformFeedback::Utilities::buildProgram(
- gl, m_context.getTestContext().getLog(), NULL, m_tessellation_control_shader,
- m_tessellation_evaluation_shader, s_vertex_shader_without_output, s_fragment_shader, &m_varying_name, 1,
- GL_INTERLEAVED_ATTRIBS);
-
is_ok = is_ok && m_program_id_with_input_output && m_program_id_with_output && m_program_id_without_output &&
- m_program_id_with_geometry_shader && m_program_id_with_tessellation_shaders;
+ m_program_id_with_geometry_shader;
+
+ if (is_at_least_gl_40 || is_tessellation) {
+ m_program_id_with_tessellation_shaders = gl3cts::TransformFeedback::Utilities::buildProgram(
+ gl, m_context.getTestContext().getLog(), NULL, m_tessellation_control_shader,
+ m_tessellation_evaluation_shader, s_vertex_shader_without_output, s_fragment_shader, &m_varying_name, 1,
+ GL_INTERLEAVED_ATTRIBS);
+ is_ok = is_ok && m_program_id_with_tessellation_shaders;
+ }
}
catch (...)
{
/* Functions handler */
const glw::Functions& gl = m_context.getRenderContext().getFunctions();
+ bool is_at_least_gl_40 = (glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 0)));
+ bool is_tessellation = m_context.getContextInfo().isExtensionSupported("GL_ARB_tessellation_shader");
+
+ bool has_patches = is_at_least_gl_40 || is_tessellation;
+
/* INVALID_ENUM is generated by DrawTransformFeedbackInstanced and
DrawTransformFeedbackStreamInstanced if <mode> is invalid */
GL_PATCHES };
std::set<glw::GLenum> supported_mode(_supported_mode,
- _supported_mode + sizeof(_supported_mode) / sizeof(_supported_mode[0]));
+ _supported_mode + sizeof(_supported_mode) / sizeof(_supported_mode[0]) - (has_patches ? 0 : 1));
int mode = 0;
return false;
}
+ /* All of the below tests concern themselves with GL_PATCHES and
+ * tessellation shaders */
+ if (!has_patches)
+ {
+ return true;
+ }
+
/* INVALID_OPERATION is generated by DrawTransformFeedbackInstanced and
DrawTransformFeedbackStreamInstanced if <mode> does not match tessellation */
{
gl.bindBuffer(GL_QUERY_BUFFER, qo_bo_id);
}
- else
+ else if (qo_bo_id != 0)
{
gl.bindBuffer(GL_QUERY_BUFFER, 0 /* buffer */);
}
unsigned int indirect_draw_bo_first_argument, unsigned int indirect_draw_bo_basevertex_argument)
{
const glw::Functions& gl = m_context.getRenderContext().getFunctions();
+ glu::ContextType contextType = m_context.getRenderContext().getType();
/* If we already have initialized a VBO, delete it before we continue */
if (m_vbo_id != 0)
GLU_EXPECT_NO_ERROR(gl.getError(), "glGenBuffers() call failed.");
gl.bindBuffer(GL_ARRAY_BUFFER, m_vbo_id);
- gl.bindBuffer(GL_DRAW_INDIRECT_BUFFER, m_vbo_id);
+ if (glu::contextSupports(contextType, glu::ApiType::core(4, 0)) ||
+ m_context.getContextInfo().isExtensionSupported("GL_ARB_draw_indirect"))
+ {
+ gl.bindBuffer(GL_DRAW_INDIRECT_BUFFER, m_vbo_id);
+ }
gl.bindBuffer(GL_ELEMENT_ARRAY_BUFFER, m_vbo_id);
GLU_EXPECT_NO_ERROR(gl.getError(), "glBindBuffer() call(s) failed.");
{
glw::GLenum current_query_target = PipelineStatisticsQueryUtilities::query_targets[n_query_target];
+ /* Make sure the query is supported */
+ if (!PipelineStatisticsQueryUtilities::isQuerySupported(current_query_target, m_context.getContextInfo(), m_context.getRenderContext()))
+ {
+ continue;
+ }
+
if (shouldExecuteForQueryTarget(current_query_target))
{
/* Initialize the query object */
const glw::GLuint64 expected_value = 0;
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, 1, &expected_value, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, 1, &expected_value, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, DE_NULL, DE_NULL,
false, /* is_primitive_restart_enabled */
m_testCtx, PipelineStatisticsQueryUtilities::VERIFICATION_TYPE_EXACT_MATCH);
bool has_passed = true;
has_passed = PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, 1, &expected_value, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, 1, &expected_value, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, DE_NULL, DE_NULL, false, /* is_primitive_restart_enabled */
m_testCtx, PipelineStatisticsQueryUtilities::VERIFICATION_TYPE_EXACT_MATCH);
}
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, n_expected_values, expected_values, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, n_expected_values, expected_values, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, &m_current_draw_call_type, &m_current_primitive_type,
m_is_primitive_restart_enabled, m_testCtx, verification_type);
/* Compare it against query result values */
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, 1, &expected_value, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, 1, &expected_value, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, &m_current_draw_call_type, &m_current_primitive_type,
false, /* is_primitive_restart_enabled */
m_testCtx, PipelineStatisticsQueryUtilities::VERIFICATION_TYPE_EQUAL_OR_GREATER);
/* Compare it against query result values */
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, 1, &expected_value, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, 1, &expected_value, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, &m_current_draw_call_type, &m_current_primitive_type,
false, /* is_primitive_restart_enabled */
m_testCtx, PipelineStatisticsQueryUtilities::VERIFICATION_TYPE_EQUAL_OR_GREATER);
*
* For GL_GEOMETRY_SHADER_INVOCATIONS, we only need a single iteration.
**/
+ const bool streams_supported = glu::contextSupports(m_context.getRenderContext().getType(), glu::ApiType::core(4, 0));
const unsigned int n_internal_iterations =
- (current_query_target == GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB) ? 2 : 1;
+ (current_query_target == GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB && streams_supported) ? 2 : 1;
for (unsigned int n_internal_iteration = 0; n_internal_iteration < n_internal_iterations;
++n_internal_iteration)
/* Compare it against query result values */
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
run_result, n_expected_values, expected_values,
- m_qo_id != 0, /* should_check_qo_bo_values */
+ m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, &m_current_draw_call_type, &m_current_primitive_type,
false, /* is_primitive_restart_enabled */
m_testCtx, verification_type);
/* Compare it against query result values */
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, 1, &expected_value, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, 1, &expected_value, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, &m_current_draw_call_type, &m_current_primitive_type,
false, /* is_primitive_restart_enabled */
m_testCtx, PipelineStatisticsQueryUtilities::VERIFICATION_TYPE_EQUAL_OR_GREATER);
/* Compare it against query result values */
result &= PipelineStatisticsQueryUtilities::verifyResultValues(
- run_result, 1, &expected_value, m_qo_id != 0, /* should_check_qo_bo_values */
+ run_result, 1, &expected_value, m_bo_qo_id != 0, /* should_check_qo_bo_values */
current_query_target, DE_NULL, DE_NULL, false, /* is_primitive_restart_enabled */
m_testCtx, PipelineStatisticsQueryUtilities::VERIFICATION_TYPE_EQUAL_OR_GREATER);
} /* if (run results were obtained successfully) */
{
const glw::Functions& gl = m_context.getRenderContext().getFunctions();
+ /* 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"))
+ {
+ throw tcu::NotSupportedError("OpenGL 4.3+ / compute shaders required to run this test.");
+ }
+
buildProgram(PipelineStatisticsQueryUtilities::dummy_cs_code, DE_NULL, /* fs_body */
DE_NULL, /* gs_body */
DE_NULL, /* tc_body */