Lines Matching defs:const

59 		const glw::Functions& gl = m_context.getRenderContext().getFunctions();
75 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
86 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
101 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
126 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
143 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
163 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
175 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
190 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
201 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
207 const glw::GLenum Utils::program::ARB_COMPUTE_SHADER = 0x91B9;
246 void Utils::program::build(const glw::GLchar* compute_shader_code, const glw::GLchar* fragment_shader_code,
247 const glw::GLchar* geometry_shader_code, const glw::GLchar* tesselation_control_shader_code,
248 const glw::GLchar* tesselation_evaluation_shader_code, const glw::GLchar* vertex_shader_code,
249 const glw::GLchar* const* varying_names, glw::GLuint n_varying_names, bool is_separable)
252 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
330 void Utils::program::compile(glw::GLuint shader_id, const glw::GLchar* shader_code) const
333 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
380 bool Utils::program::isProgramBinarySupported() const
384 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
400 void Utils::program::createFromBinary(const std::vector<GLubyte>& binary, GLenum binary_format)
403 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
418 void Utils::program::getBinary(std::vector<GLubyte>& binary, GLenum& binary_format) const
421 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
442 GLuint Utils::program::getSubroutineIndex(const glw::GLchar* subroutine_name, glw::GLenum shader_stage) const
444 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
467 GLint Utils::program::getSubroutineUniformLocation(const glw::GLchar* uniform_name, glw::GLenum shader_stage) const
469 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
492 GLint Utils::program::getUniformLocation(const glw::GLchar* uniform_name) const
494 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
514 void Utils::program::link() const
517 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
597 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
650 void Utils::program::use() const
652 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
674 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
686 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
700 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
719 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
738 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
761 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
774 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
785 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
831 bool Utils::buildProgram(const glw::Functions& gl, const std::string& vs_body, const std::string& tc_body,
832 const std::string& te_body, const std::string& gs_body, const std::string& fs_body,
833 const glw::GLchar** xfb_varyings, const unsigned int& n_xfb_varyings, glw::GLuint* out_vs_id,
848 const char* vs_body_raw_ptr = vs_body.c_str();
862 const char* tc_body_raw_ptr = tc_body.c_str();
876 const char* te_body_raw_ptr = te_body.c_str();
890 const char* gs_body_raw_ptr = gs_body.c_str();
904 const char* fs_body_raw_ptr = fs_body.c_str();
917 const glw::GLuint so_ids[] = { (out_vs_id != DE_NULL) ? *out_vs_id : 0, (out_tc_id != DE_NULL) ? *out_tc_id : 0,
920 const unsigned int n_so_ids = sizeof(so_ids) / sizeof(so_ids[0]);
975 Utils::_variable_type Utils::getBaseVariableType(const _variable_type& variable_type)
1056 unsigned int Utils::getComponentSizeForVariableType(const _variable_type& variable_type)
1095 glw::GLenum Utils::getGLenumForShaderStage(const _shader_stage& shader_stage)
1132 unsigned int Utils::getNumberOfComponentsForVariableType(const _variable_type& variable_type)
1234 std::string Utils::getShaderStageString(const _shader_stage& shader_stage)
1271 std::string Utils::getShaderStageStringFromGLEnum(const glw::GLenum shader_stage_glenum)
1308 const GLchar* Utils::programInterfaceToStr(glw::GLenum program_interface)
1310 const GLchar* string = "Unknown program interface";
1333 const GLchar* Utils::pnameToStr(glw::GLenum pname)
1335 const GLchar* string = "Unknown pname";
1391 bool Utils::compare(const glw::GLfloat& left, const glw::GLfloat& right)
1393 static const glw::GLfloat m_epsilon = 0.00001f;
1413 Utils::_variable_type Utils::getVariableTypeFromProperties(const _variable_type& base_variable_type,
1414 const unsigned int& n_components)
1566 std::string Utils::getVariableTypeGLSLString(const _variable_type& variable_type)
1688 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1697 const struct
1700 const char* pname_string;
1704 const unsigned int n_pnames = sizeof(pnames) / sizeof(pnames[0]);
1713 const glw::GLint min_value = pnames[n_pname].min_value;
1714 const glw::GLenum& pname = pnames[n_pname].pname;
1715 const char* pname_string = pnames[n_pname].pname_string;
1747 const float epsilon = 1e-5f;
1834 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1891 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
1906 const char* vs_body_raw_ptr = vs_body.c_str();
2005 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2057 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2138 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2160 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2183 bool FunctionalTest1_2::executeTestIteration(const _test_case& test_case)
2185 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2191 const glw::GLchar* xfb_varyings[] = { "result" };
2192 const unsigned int n_xfb_varyings = sizeof(xfb_varyings) / sizeof(xfb_varyings[0]);
2225 const Utils::_variable_type base_variable_type = Utils::getBaseVariableType(test_case.variable_type);
2247 const glw::GLuint subroutine_indices[] = { m_po_getter0_subroutine_index, m_po_getter1_subroutine_index };
2248 const unsigned int n_subroutine_indices = sizeof(subroutine_indices) / sizeof(subroutine_indices[0]);
2275 const void* xfb_data_ptr = gl.mapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, GL_READ_ONLY);
2297 std::string FunctionalTest1_2::getVertexShaderBody(const Utils::_variable_type& variable_type, unsigned int array_size)
2517 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
2555 const Utils::_variable_type variable_types[] = {
2566 const unsigned int n_variable_types = sizeof(variable_types) / sizeof(variable_types[0]);
2597 const _test_case& test_case = *test_case_iterator;
2627 bool FunctionalTest1_2::verifyXFBData(const void* xfb_data, const Utils::_variable_type& variable_type)
2629 const Utils::_variable_type base_variable_type = Utils::getBaseVariableType(variable_type);
2630 const float epsilon = 1e-5f;
2631 const unsigned int n_variable_type_components = Utils::getNumberOfComponentsForVariableType(variable_type);
2633 const unsigned char* traveller_ptr = (const unsigned char*)xfb_data;
2641 const unsigned int ref_values[] = { 0, 1 };
2642 const unsigned int n_ref_values = sizeof(ref_values) / sizeof(ref_values[0]);
2646 const unsigned int ref_value = ref_values[n_ref_value];
2673 const unsigned int ref_values[] = { 4, 5 };
2674 const unsigned int n_ref_values = sizeof(ref_values) / sizeof(ref_values[0]);
2678 const unsigned int ref_value = ref_values[n_ref_value];
2686 const double* double_value_ptr = (double*)traveller_ptr;
2687 const float* float_value_ptr = (float*)traveller_ptr;
2688 const int* int_value_ptr = (int*)traveller_ptr;
2782 static const glw::GLchar* vertex_shader_code =
2836 static const GLchar* varying_names[] = {
2844 static const GLchar* subroutine_uniform_names[] = { "first_routine", "second_routine" };
2846 static const GLchar* subroutine_names[] = { "inverse_order", "negate", "inverse", "square" };
2848 static const GLuint n_varyings = sizeof(varying_names) / sizeof(varying_names[0]);
2849 static const GLuint transform_feedback_buffer_size = n_varyings * sizeof(GLfloat) * 4 /* vec4 */;
2851 static const GLuint inverse_order_routine_index = 0;
2852 static const GLuint negate_routine_index = 1;
2853 static const GLuint inverse_routine_index = 2;
2854 static const GLuint square_routine_index = 3;
2857 static const Utils::vec4<GLfloat> inverse_order_negate_data[5] = {
2863 static const Utils::vec4<GLfloat> inverse_order_inverse_data[5] = {
2869 static const Utils::vec4<GLfloat> inverse_order_square_data[5] = {
2875 static const Utils::vec4<GLfloat> negate_inverse_data[5] = {
2881 static const Utils::vec4<GLfloat> negate_square_data[5] = {
2887 static const Utils::vec4<GLfloat> inverse_square_data[5] = {
2916 const GLsizei length = (GLsizei)strlen(subroutine_uniform_names[i]);
2926 const GLsizei length = (GLsizei)strlen(subroutine_names[i]);
3041 bool FunctionalTest3_4::checkProgramStageiv(glw::GLuint program_id, glw::GLenum pname, glw::GLint expected) const
3043 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3076 const glw::GLchar* resource_name, GLint expected) const
3078 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3118 GLint expected) const
3120 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3153 GLint expected) const
3155 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3187 const glw::GLchar* resource_name) const
3189 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3213 GLuint FunctionalTest3_4::getSubroutineIndex(GLuint program_id, const glw::GLchar* subroutine_name,
3214 bool use_program_query) const
3216 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3246 GLint FunctionalTest3_4::getSubroutineUniformLocation(GLuint program_id, const glw::GLchar* uniform_name,
3247 bool use_program_query) const
3249 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3277 bool FunctionalTest3_4::inspectProgramStageiv(glw::GLuint program_id) const
3281 const inspectionDetails details[] = {
3288 const GLuint n_details = sizeof(details) / sizeof(details[0]);
3307 bool FunctionalTest3_4::inspectProgramInterfaceiv(glw::GLuint program_id) const
3311 const inspectionDetailsForProgramInterface details[] = {
3318 const GLuint n_details = sizeof(details) / sizeof(details[0]);
3340 bool FunctionalTest3_4::inspectProgramResourceiv(GLuint program_id, const GLchar** subroutine_names,
3341 const GLchar** uniform_names) const
3343 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3348 const GLchar* subroutine_name = subroutine_names[subroutine];
3349 const GLint length = (GLint)strlen(subroutine_name) + 1;
3363 const GLuint n_details = sizeof(details) / sizeof(details[0]);
3367 const GLchar* uniform_name = uniform_names[uniform];
3368 const GLint length = (GLint)strlen(uniform_name) + 1;
3369 const GLint location = getSubroutineUniformLocation(program_id, uniform_name, true);
3438 bool FunctionalTest3_4::inspectActiveSubroutineUniformiv(GLuint program_id, const GLchar** uniform_names) const
3440 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3449 const GLuint n_details = sizeof(details) / sizeof(details[0]);
3515 bool FunctionalTest3_4::inspectActiveSubroutineUniformName(GLuint program_id, const GLchar** uniform_names) const
3517 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3566 bool FunctionalTest3_4::inspectActiveSubroutineName(GLuint program_id, const GLchar** subroutine_names) const
3568 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3618 bool FunctionalTest3_4::inspectSubroutineBinding(GLuint program_id, const GLchar** subroutine_names,
3619 const GLchar** uniform_names, bool use_program_query) const
3621 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3680 bool FunctionalTest3_4::testDraw(GLuint program_id, const GLchar* first_routine_name, const GLchar* second_routine_name,
3681 const GLchar** uniform_names, const Utils::vec4<GLfloat> expected_results[5],
3682 bool use_program_query) const
3684 static const GLuint n_varyings = 5;
3685 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
3816 static const GLchar* vertex_shader_code =
3899 static const GLchar* subroutine_names[4][2] = {
3903 static const GLchar* subroutine_uniform_names[4][1] = {
3907 static const GLuint n_subroutine_types = sizeof(subroutine_names) / sizeof(subroutine_names[0]);
3908 static const GLuint n_subroutines_per_type = sizeof(subroutine_names[0]) / sizeof(subroutine_names[0][0]);
3909 static const GLuint n_subroutine_uniforms_per_type =
3912 static const GLchar* uniform_names[] = { "first_input", "second_input", "third_input" };
3913 static const GLuint n_uniform_names = sizeof(uniform_names) / sizeof(uniform_names[0]);
3915 static const GLchar* varying_names[] = { "out_result_from_first_routine", "out_result_from_second_routine",
3917 static const GLuint n_varyings = sizeof(varying_names) / sizeof(varying_names[0]);
3918 static const GLuint transform_feedback_buffer_size = n_varyings * sizeof(GLfloat) * 4 /* vec4 */;
3921 static const Utils::vec4<GLfloat> input_data[3] = { Utils::vec4<GLfloat>(1.0f, 4.0f, 9.0f, 16.0f),
3925 static const Utils::vec4<GLfloat> expected_result_from_first_routine[2] = {
3929 static const Utils::vec4<GLfloat> expected_result_from_second_routine[2] = {
3933 static const Utils::vec4<GLfloat> expected_result_from_third_routine[2] = {
3937 static const Utils::vec4<GLuint> expected_result_from_fourth_routine[2] = { Utils::vec4<GLuint>(0, 0, 0, 0),
3941 static const GLuint subroutine_combinations[][4] = {
3946 static const GLuint n_subroutine_combinations =
4054 void FunctionalTest5::logError(const glw::GLchar* subroutine_names[4][2], const glw::GLuint subroutine_combination[4],
4055 const Utils::vec4<glw::GLfloat> input_data[3],
4056 const Utils::vec4<glw::GLfloat>& first_routine_result,
4057 const Utils::vec4<glw::GLfloat>& second_routine_result,
4058 const Utils::vec4<glw::GLfloat>& third_routine_result,
4059 const Utils::vec4<glw::GLuint>& fourth_routine_result,
4060 const Utils::vec4<glw::GLfloat>& first_routine_expected_result,
4061 const Utils::vec4<glw::GLfloat>& second_routine_expected_result,
4062 const Utils::vec4<glw::GLfloat>& third_routine_expected_result,
4063 const Utils::vec4<glw::GLuint>& fourth_routine_expected_result) const
4131 void FunctionalTest5::testDraw(const glw::GLuint subroutine_combination[4],
4132 const Utils::vec4<glw::GLfloat> input_data[3],
4136 Utils::vec4<glw::GLuint>& out_fourth_routine_result) const
4138 static const GLuint n_uniforms = sizeof(m_uniform_locations) / sizeof(m_uniform_locations[0]);
4139 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4141 static const GLuint n_subroutine_uniforms = sizeof(subroutine_indices) / sizeof(subroutine_indices[0]);
4146 const GLuint location = m_subroutine_uniform_locations[i][0];
4219 bool FunctionalTest5::verify(const Utils::vec4<glw::GLfloat>& first_routine_result,
4220 const Utils::vec4<glw::GLfloat>& second_routine_result,
4221 const Utils::vec4<glw::GLfloat>& third_routine_result,
4222 const Utils::vec4<glw::GLuint>& fourth_routine_result,
4223 const Utils::vec4<glw::GLfloat>& first_routine_expected_result,
4224 const Utils::vec4<glw::GLfloat>& second_routine_expected_result,
4225 const Utils::vec4<glw::GLfloat>& third_routine_expected_result,
4226 const Utils::vec4<glw::GLuint>& fourth_routine_expected_result) const
4253 static const GLchar* vertex_shader_code = "#version 400 core\n"
4282 static const GLchar* varying_name = "out_result";
4285 static const Utils::vec4<GLfloat> input_data(1.0f, 4.0f, 9.0f, 16.0f);
4287 static const Utils::vec4<GLfloat> expected_result(1.0f, 16.0f, 81.0f, 256.0f);
4289 static const GLuint transform_feedback_buffer_size = 4 * sizeof(GLfloat);
4318 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4319 const GLint uniform_location = gl.getUniformLocation(program.m_program_object_id, "input_data");
4395 static const GLchar* vertex_shader_code =
4463 static const GLchar* subroutine_names[] = {
4466 static const GLuint n_subroutine_names = sizeof(subroutine_names) / sizeof(subroutine_names[0]);
4468 static const GLchar* subroutine_uniform_names[] = { "routine[0]", "routine[1]", "routine[2]", "routine[3]" };
4469 static const GLuint n_subroutine_uniform_names =
4472 static const GLchar* uniform_names[] = {
4475 static const GLuint n_uniform_names = sizeof(uniform_names) / sizeof(uniform_names[0]);
4477 static const GLchar* varying_names[] = { "out_combined", "out_combined_inverted",
4482 static const GLuint n_varyings = sizeof(varying_names) / sizeof(varying_names[0]);
4483 static const GLuint transform_feedback_buffer_size = n_varyings * 4 * sizeof(GLfloat);
4486 static const Utils::vec4<GLfloat> uni_left(-1.0f, 0.75f, -0.5f, 0.25f);
4487 static const Utils::vec4<GLfloat> uni_right(1.0f, -0.75f, 0.5f, -0.25f);
4488 static const Utils::vec4<GLuint> uni_indices(1, 2, 0, 3);
4490 static const GLuint subroutine_combinations[][4] = {
4508 static const GLuint n_subroutine_combinations =
4589 void FunctionalTest7_8::calculate(glw::GLuint function, const Utils::vec4<glw::GLfloat>& left,
4590 const Utils::vec4<glw::GLfloat>& right, Utils::vec4<glw::GLfloat>& out) const
4623 const glw::GLuint combination[4], const Utils::vec4<glw::GLfloat>& left, const Utils::vec4<glw::GLfloat>& right,
4624 const Utils::vec4<glw::GLuint>& indices, Utils::vec4<glw::GLfloat>& out_combined,
4627 Utils::vec4<glw::GLfloat>& out_dynamic_inverted, Utils::vec4<glw::GLfloat>& out_loop) const
4630 const GLuint dynamic_combination[4] = { combination[indices.m_x], combination[indices.m_y],
4634 const Utils::vec4<glw::GLfloat> constant_values[] = { Utils::vec4<glw::GLfloat>(1, 2, 3, 4),
4685 void FunctionalTest7_8::logError(const glw::GLuint combination[4], const Utils::vec4<glw::GLfloat>& left,
4686 const Utils::vec4<glw::GLfloat>& right, const Utils::vec4<glw::GLuint>& indices,
4687 const Utils::vec4<glw::GLfloat> vec4_expected[7],
4688 const Utils::vec4<glw::GLfloat> vec4_result[7], glw::GLuint array_length,
4689 bool result[7]) const
4691 static const GLuint n_functions = 4;
4692 static const GLuint n_operations = 7;
4695 const GLuint dynamic_combination[4] = { combination[indices.m_x], combination[indices.m_y],
4716 const Utils::vec4<glw::GLfloat> constant_values[] = { Utils::vec4<glw::GLfloat>(1, 2, 3, 4),
4736 const GLchar* description = 0;
4737 const Utils::vec4<glw::GLfloat>* input = 0;
4738 const GLchar* operation = 0;
4833 bool FunctionalTest7_8::testDraw(const glw::GLuint combination[4], const Utils::vec4<glw::GLfloat>& left,
4834 const Utils::vec4<glw::GLfloat>& right, const Utils::vec4<glw::GLuint>& indices) const
4836 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4837 static const GLuint n_vec4_varyings = 7;
4840 static const GLuint n_subroutine_uniforms = sizeof(subroutine_indices) / sizeof(subroutine_indices[0]);
4860 const GLuint location = m_subroutine_uniform_locations[i];
4943 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
4977 std::string FunctionalTest9::getVertexShaderBody() const
5013 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
5016 const char* xfb_varyings[] = { "result" };
5018 const unsigned int n_xfb_varyings = sizeof(xfb_varyings) / sizeof(xfb_varyings[0]);
5033 const unsigned int xfb_bo_size = static_cast<unsigned int>(sizeof(float) * 4 /* components */ * m_n_points_to_draw);
5062 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
5085 const glw::GLvoid* xfb_data_ptr = gl.mapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, GL_READ_ONLY);
5111 void FunctionalTest9::verifyXFBData(const glw::GLvoid* data_ptr)
5113 const float epsilon = 1e-5f;
5115 const glw::GLfloat* traveller_ptr = (const glw::GLfloat*)data_ptr;
5163 static const GLchar* vertex_shader_code = "#version 400 core\n"
5205 static const GLchar* subroutine_names[] = {
5208 static const GLuint n_subroutine_names = sizeof(subroutine_names) / sizeof(subroutine_names[0]);
5210 static const GLchar* subroutine_uniform_names[] = {
5215 static const GLuint n_subroutine_uniform_names =
5218 static const GLchar* varying_name = "out_result";
5219 static const GLuint transform_feedback_buffer_size = sizeof(GLint);
5221 static const GLuint configuration_increment[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
5223 static const GLuint configuration_decrement[16] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
5225 static const GLuint configuration_mix[16] = { 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1 };
5319 GLint FunctionalTest10::testDraw(const GLuint routine_indices[16]) const
5321 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
5323 static const GLuint n_subroutine_uniforms = sizeof(subroutine_indices) / sizeof(subroutine_indices[0]);
5328 const GLuint location = m_subroutine_uniform_locations[i];
5361 const GLuint FunctionalTest11::m_texture_height = 32;
5362 const GLuint FunctionalTest11::m_texture_width = 32;
5381 static const GLchar* fragment_shader_code =
5537 static const GLchar* geometry_shader_code = "#version 400 core\n"
5563 static const GLchar* vertex_shader_code = "#version 400 core\n"
5573 static const GLchar* subroutine_names[][2] = { { "discard_yes", "discard_no" },
5578 static const GLuint n_subroutine_types = sizeof(subroutine_names) / sizeof(subroutine_names[0]);
5580 static const GLchar* subroutine_uniform_names[] = { "discard_fragment", "set_global_colors", "sample_texture",
5582 static const GLuint n_subroutine_uniform_names =
5585 static const GLchar* uniform_names[] = {
5588 static const GLuint n_uniform_names = sizeof(uniform_names) / sizeof(uniform_names[0]);
5591 static const GLubyte blue_color[4] = { 0, 0, 255, 255 };
5592 static const GLubyte clean_color[4] = { 0, 0, 0, 0 };
5593 static const GLubyte red_color[4] = { 255, 0, 0, 255 };
5596 static const testConfiguration test_configurations[] = {
5633 static const GLuint n_test_cases = sizeof(test_configurations) / sizeof(test_configurations[0]);
5734 void FunctionalTest11::fillTexture(Utils::texture& texture, const glw::GLubyte color[4]) const
5743 const GLuint line_offset = y * m_texture_width * 4;
5747 const GLuint point_offset = x * 4 + line_offset;
5767 bool FunctionalTest11::testDraw(const glw::GLuint routine_configuration[5], const glw::GLuint sampler_configuration[2],
5768 const glw::GLubyte expected_color[4], Utils::texture& color_texture) const
5770 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
5771 static const GLint n_samplers = 2;
5772 static const GLint n_subroutine_uniforms = 5;
5778 const GLuint location = m_uniform_locations[i];
5779 const GLuint texture = m_source_textures[sampler_configuration[i]];
5796 const GLuint location = m_subroutine_uniform_locations[i];
5797 const GLuint routine = routine_configuration[i];
5818 const GLuint line_offset = y * m_texture_width * 4;
5822 const GLuint point_offset = x * 4 + line_offset;
5842 const glw::GLuint FunctionalTest12::m_texture_height = 16;
5843 const glw::GLuint FunctionalTest12::m_texture_width = 16;
5917 void FunctionalTest12::fillTexture(Utils::texture& texture, const glw::GLuint color[4]) const
5926 const GLuint line_offset = y * m_texture_width * 4;
5930 const GLuint point_offset = x * 4 + line_offset;
5948 static const GLchar* fragment_shader_code = "#version 410 core\n"
5985 static const GLchar* geometry_shader_code = "#version 400 core\n"
6011 static const GLchar* vertex_shader_code = "#version 400 core\n"
6021 static const GLchar* subroutine_names[] = { "increment_two", "decrement_three", "read_one" };
6024 static const glw::GLuint atomic_buffer_data[] = { m_texture_width * m_texture_height,
6028 static const glw::GLuint expected_incremented_two[] = { atomic_buffer_data[0], 2 * atomic_buffer_data[1],
6031 static const glw::GLuint expected_decremented_three[] = { 0, expected_incremented_two[1],
6034 static const glw::GLuint expected_read_one[] = { expected_decremented_three[0], expected_decremented_three[1],
6100 bool FunctionalTest12::testAtomicDraw(GLuint subroutine_index, const GLuint expected_results[3]) const
6102 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
6142 static const GLchar* fragment_shader_code =
6176 static const GLchar* geometry_shader_code = "#version 400 core\n"
6202 static const GLchar* vertex_shader_code = "#version 400 core\n"
6212 static const GLchar* subroutine_names[] = { "left_to_right", "right_to_left" };
6214 static const GLchar* uniform_names[] = { "left_image", "right_image" };
6217 static const GLuint blue_color[4] = { 0, 0, 255, 255 };
6218 static const GLuint clean_color[4] = { 16, 32, 64, 128 };
6219 static const GLuint red_color[4] = { 255, 0, 0, 255 };
6305 const GLuint expected_left_color[4], const GLuint expected_right_color[4]) const
6307 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
6359 static const GLchar* fragment_shader_code = "#version 400 core\n"
6398 static const GLchar* geometry_shader_code = "#version 400 core\n"
6424 static const GLchar* vertex_shader_code = "#version 400 core\n"
6434 static const GLchar* subroutine_names[] = { "increment", "decrement" };
6437 static const glw::GLuint buffer_data[] = { m_texture_width * m_texture_height + 1,
6442 static const glw::GLuint expected_incremented[] = { m_texture_width * m_texture_height + buffer_data[0],
6447 static const glw::GLuint expected_decremented[] = { buffer_data[0], buffer_data[1], buffer_data[2],
6506 bool FunctionalTest12::testSSBODraw(GLuint subroutine_index, const GLuint expected_results[4]) const
6508 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
6550 bool FunctionalTest12::verifyTexture(Utils::texture& texture, const GLuint expected_color[4]) const
6559 const GLuint line_offset = y * m_texture_width * 4;
6563 const GLuint point_offset = line_offset + x * 4;
6613 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
7013 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
7034 const char* fs_body_raw_ptr = fs_body.c_str();
7036 const char* gs_body_raw_ptr = gs_body.c_str();
7038 const char* tc_body_raw_ptr = tc_body.c_str();
7040 const char* te_body_raw_ptr = te_body.c_str();
7042 const char* vs_body_raw_ptr = vs_body.c_str();
7060 const glw::GLuint po_ids[] = {
7063 const unsigned int n_po_ids = sizeof(po_ids) / sizeof(po_ids[0]);
7125 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
7145 const unsigned int n_fs_idx = ((n_shader_permutation & (1 << 0)) != 0) ? 1 : 0;
7146 const unsigned int n_gs_idx = ((n_shader_permutation & (1 << 1)) != 0) ? 1 : 0;
7147 const unsigned int n_tc_idx = ((n_shader_permutation & (1 << 2)) != 0) ? 1 : 0;
7148 const unsigned int n_te_idx = ((n_shader_permutation & (1 << 3)) != 0) ? 1 : 0;
7149 const unsigned int n_vs_idx = ((n_shader_permutation & (1 << 4)) != 0) ? 1 : 0;
7150 const unsigned int fs_po_id = m_fs_po_ids[n_fs_idx];
7151 const unsigned int gs_po_id = m_gs_po_ids[n_gs_idx];
7152 const unsigned int tc_po_id = m_tc_po_ids[n_tc_idx];
7153 const unsigned int te_po_id = m_te_po_ids[n_te_idx];
7154 const unsigned int vs_po_id = m_vs_po_ids[n_vs_idx];
7424 const float epsilon = 1e-5f;
7429 const float* row_ptr = (const float*)m_read_buffer + y * m_to_width * 4; /* rgba */
7433 const float* texel_ptr = row_ptr + x * 4; /* rgba */
7479 static const GLchar* vertex_shader_code =
7568 static const GLchar* subroutine_names[][2] = { { "invert", "increment" }, { "div_by_2", "decrement" } };
7569 static const GLuint n_subroutine_types = sizeof(subroutine_names) / sizeof(subroutine_names[0]);
7571 static const GLchar* subroutine_uniform_names[] = { "routine_1", "routine_2" };
7572 static const GLuint n_subroutine_uniform_names =
7575 static const GLchar* uniform_name = "uni_input";
7576 static const GLchar* varying_names[] = { "out_routine_1", "out_routine_2" };
7578 static const GLuint n_varying_names = sizeof(varying_names) / sizeof(varying_names[0]);
7579 static const GLuint transform_feedback_buffer_size = n_varying_names * 4 * sizeof(GLuint);
7582 static const Utils::vec4<GLuint> uni_input[] = { Utils::vec4<GLuint>(8, 64, 4096, 16777216),
7585 static const Utils::vec4<GLuint> out_routine_1[] = { Utils::vec4<GLuint>(16777216, 4096, 64, 8),
7588 static const Utils::vec4<GLuint> out_routine_2[] = { Utils::vec4<GLuint>(4, 32, 2048, 8388608),
7591 static const GLuint n_test_cases = 2;
7675 static const GLuint n_subroutines_per_type = 2;
7741 bool FunctionalTest14_15::testDefaultSubroutineSet(const Utils::vec4<glw::GLuint>& uni_input,
7742 const Utils::vec4<glw::GLuint> expected_routine_1_result[2],
7743 const Utils::vec4<glw::GLuint> expected_routine_2_result[2]) const
7745 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
7822 bool FunctionalTest14_15::testDraw(glw::GLuint routine_configuration, const Utils::vec4<glw::GLuint>& uni_input,
7823 const Utils::vec4<glw::GLuint>& expected_routine_1_result,
7824 const Utils::vec4<glw::GLuint>& expected_routine_2_result) const
7826 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
7829 static const GLuint n_subroutine_uniforms = sizeof(subroutine_indices) / sizeof(subroutine_indices[0]);
7838 const GLuint location = m_subroutine_uniform_locations[i];
7917 bool FunctionalTest14_15::testIndicesAndLocations() const
7919 static const GLuint n_subroutine_types = 2;
7970 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
8067 std::string FunctionalTest16::getShaderBody(const Utils::_shader_stage& shader_stage, const unsigned int& n_id) const
8209 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
8213 const std::string fs_body = getShaderBody(Utils::SHADER_STAGE_FRAGMENT, n_id);
8214 const std::string gs_body = getShaderBody(Utils::SHADER_STAGE_GEOMETRY, n_id);
8215 const std::string tc_body = getShaderBody(Utils::SHADER_STAGE_TESSELLATION_CONTROL, n_id);
8216 const std::string te_body = getShaderBody(Utils::SHADER_STAGE_TESSELLATION_EVALUATION, n_id);
8217 const std::string vs_body = getShaderBody(Utils::SHADER_STAGE_VERTEX, n_id);
8234 const char* fs_body_raw_ptr = fs_body.c_str();
8235 const char* gs_body_raw_ptr = gs_body.c_str();
8237 const char* tc_body_raw_ptr = tc_body.c_str();
8238 const char* te_body_raw_ptr = te_body.c_str();
8239 const char* vs_body_raw_ptr = vs_body.c_str();
8298 const unsigned int n_items = sizeof(items) / sizeof(items[0]);
8405 void FunctionalTest16::getShaderStages(bool retrieve_program_object_shader_ids, const unsigned int& n_id,
8406 const _shader_stage** out_shader_stages) const
8432 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
8481 const _shader_stage* stages[5 /* fs+gs+tc+te+vs */] = { DE_NULL };
8488 const _shader_stage& current_stage = *(stages[n_stage]);
8663 const _shader_stage* shader_stages[Utils::SHADER_STAGE_COUNT] = { DE_NULL };
8670 const _shader_stage& current_shader_stage = *(shader_stages[n_shader_stage]);
8772 void FunctionalTest16::verifySubroutineUniformValues(const _test_case& test_case, const unsigned int& n_id,
8773 const _subroutine_uniform_value_verification& verification)
8775 const _shader_stage* stages[] = {
8782 const unsigned int n_stages = sizeof(stages) / sizeof(stages[0]);
8789 const _shader_stage& current_stage = *(stages[n_stage]);
8803 const _shader_stage& shader_stage, const _subroutine_uniform_value_verification& verification)
8805 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
8920 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9004 std::string FunctionalTest17::getFragmentShaderBody() const
9042 std::string FunctionalTest17::getGeometryShaderBody() const
9112 std::string FunctionalTest17::getTessellationControlShaderBody() const
9159 std::string FunctionalTest17::getTessellationEvaluationShaderBody() const
9201 std::string FunctionalTest17::getVertexShaderBody() const
9230 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9292 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9341 const float epsilon = 1e-5f;
9342 const float expected_data[4] = { 15.0f, 20.0f, 25.0f, 30.0f };
9346 const float* row_ptr = m_to_data + y * 4 /* rgba */ * m_to_width;
9350 const float* pixel_ptr = row_ptr + 4 /* rgba */ * x;
9402 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9450 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9477 const glw::GLvoid* xfb_data_ptr = gl.mapBuffer(GL_TRANSFORM_FEEDBACK_BUFFER, GL_READ_ONLY);
9489 std::string FunctionalTest18_19::getVertexShaderBody() const
9575 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9576 const char* varyings[1] = { "result" };
9578 const unsigned int n_varyings = sizeof(varyings) / sizeof(varyings[0]);
9625 const unsigned int bo_size = static_cast<unsigned int>(sizeof(float) * m_n_points_to_draw);
9663 const glw::GLuint subroutine_bool_operators[] = { m_po_subroutine_returns_false_location,
9665 const unsigned int n_subroutine_bool_operators =
9668 const glw::GLuint subroutine_vec4_operators[] = { m_po_subroutine_divide_by_two_location,
9670 const unsigned int n_subroutine_vec4_operators =
9748 void FunctionalTest18_19::verifyXFBData(const glw::GLvoid* data, glw::GLuint bool_operator1_subroutine_location,
9755 const float epsilon = 1e-5f;
9758 const glw::GLfloat* traveller_ptr = (const glw::GLfloat*)data;
9869 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9897 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
9909 const char* vs_body = "#version 400\n"
10022 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
10268 const glw::GLenum undefined_shader_stages[] = { GL_FRAGMENT_SHADER, GL_GEOMETRY_SHADER, GL_TESS_CONTROL_SHADER,
10270 const unsigned int n_undefined_shader_stages = sizeof(undefined_shader_stages) / sizeof(undefined_shader_stages[0]);
10334 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
10389 void NegativeTest2::executeTestCase(const Utils::_shader_stage& referencing_stage)
10391 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
10393 const std::string fs_body = getFragmentShaderBody(referencing_stage);
10394 const std::string gs_body = getGeometryShaderBody(referencing_stage);
10395 const std::string tc_body = getTessellationControlShaderBody(referencing_stage);
10396 const std::string te_body = getTessellationEvaluationShaderBody(referencing_stage);
10397 const std::string vs_body = getVertexShaderBody(referencing_stage);
10429 std::string NegativeTest2::getFragmentShaderBody(const Utils::_shader_stage& referencing_stage) const
10469 std::string NegativeTest2::getGeometryShaderBody(const Utils::_shader_stage& referencing_stage) const
10512 std::string NegativeTest2::getSubroutineUniformName(const Utils::_shader_stage& stage) const
10569 std::string NegativeTest2::getTessellationControlShaderBody(const Utils::_shader_stage& referencing_stage) const
10608 std::string NegativeTest2::getTessellationEvaluationShaderBody(const Utils::_shader_stage& referencing_stage) const
10647 std::string NegativeTest2::getVertexShaderBody(const Utils::_shader_stage& referencing_stage) const
10726 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
10740 void NegativeTest3::executeTest(const Utils::_shader_stage& shader_stage)
10742 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
10750 const char* body_raw_ptr = DE_NULL;
10809 std::string NegativeTest3::getFragmentShaderBody() const
10839 std::string NegativeTest3::getGeometryShaderBody() const
10872 std::string NegativeTest3::getTessellationControlShaderBody() const
10903 std::string NegativeTest3::getTessellationEvaluationShaderBody() const
10934 std::string NegativeTest3::getVertexShaderBody() const
11008 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
11032 std::string NegativeTest4::getShaderBody(const Utils::_shader_stage& shader_stage,
11033 const unsigned int& n_subroutine_types, const _test_case& test_case) const
11191 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
11209 const glw::GLenum shader_type = Utils::getGLenumForShaderStage(static_cast<Utils::_shader_stage>(shader_stage));
11218 const char* body_raw_ptr = NULL;
11303 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
11355 void NegativeTest5::executeIteration(const Utils::_shader_stage& shader_stage)
11404 std::string NegativeTest5::getFragmentShaderBody(bool include_invalid_subroutine_uniform_declaration) const
11448 std::string NegativeTest5::getGeometryShaderBody(bool include_invalid_subroutine_uniform_declaration) const
11494 std::string NegativeTest5::getTessellationControlShaderBody(bool include_invalid_subroutine_uniform_declaration) const
11539 bool include_invalid_subroutine_uniform_declaration) const
11583 std::string NegativeTest5::getVertexShaderBody(bool include_invalid_subroutine_uniform_declaration) const
11685 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
11738 void NegativeTest6::executeIteration(const Utils::_shader_stage& shader_stage)
11786 std::string NegativeTest6::getFragmentShaderBody(bool include_invalid_declaration) const
11839 std::string NegativeTest6::getGeometryShaderBody(bool include_invalid_declaration) const
11894 std::string NegativeTest6::getTessellationControlShaderBody(bool include_invalid_declaration) const
11947 std::string NegativeTest6::getTessellationEvaluationShaderBody(bool include_invalid_declaration) const
12000 std::string NegativeTest6::getVertexShaderBody(bool include_invalid_declaration) const
12098 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
12121 static const GLchar* vertex_shader_with_static_recursion =
12175 static const GLchar* vertex_shader_with_dynamic_recursion =
12206 static const GLchar* vertex_shader_with_subroutine_function_recursion =
12280 bool NegativeTest7::test(const GLchar* vertex_shader_code, const GLchar* name_of_recursive_routine)
12282 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
12284 static const GLchar* varying_name = "out_result";
12302 catch (const std::exception& exc)
12360 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
12413 void NegativeTest8::executeIteration(const Utils::_shader_stage& shader_stage)
12459 std::string NegativeTest8::getFragmentShaderBody(bool include_invalid_declaration) const
12504 std::string NegativeTest8::getGeometryShaderBody(bool include_invalid_declaration) const
12551 std::string NegativeTest8::getTessellationControlShaderBody(bool include_invalid_declaration) const
12596 std::string NegativeTest8::getTessellationEvaluationShaderBody(bool include_invalid_declaration) const
12641 std::string NegativeTest8::getVertexShaderBody(bool include_invalid_declaration) const
12733 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
12756 std::string NegativeTest9::getTestCaseString(const _test_case& test_case)
12784 std::string NegativeTest9::getVertexShader(const _test_case& test_case)
12864 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
12941 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
13259 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
13274 const _test_case& test_case = *test_case_iterator;
13330 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
13353 std::string NegativeTest11::getTestCaseString(const _test_case& test_case)
13381 std::string NegativeTest11::getVertexShader(const _test_case& test_case)
13455 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
13535 const glw::Functions& gl = m_context.getRenderContext().getFunctions();
13558 std::string NegativeTest12::getTestCaseString(const _test_case& test_case)
13592 std::string NegativeTest12::getVertexShader(const _test_case& test_case)
13702 const glw::Functions& gl = m_context.getRenderContext().getFunctions();