Lines Matching defs:program

207 const glw::GLenum Utils::program::ARB_COMPUTE_SHADER = 0x91B9;
213 Utils::program::program(deqp::Context& context)
229 Utils::program::~program()
234 /** Build program
244 * @param is_separable Selects if monolithis or separable program should be built. Defaults to false
246 void Utils::program::build(const glw::GLchar* compute_shader_code, const glw::GLchar* fragment_shader_code,
303 /* Create program object */
321 /* Link program */
330 void Utils::program::compile(glw::GLuint shader_id, const glw::GLchar* shader_code) const
380 bool Utils::program::isProgramBinarySupported() const
395 /** Create program from provided binary
397 * @param binary Buffer with binary form of program
400 void Utils::program::createFromBinary(const std::vector<GLubyte>& binary, GLenum binary_format)
405 /* Create program object */
413 /** Get binary form of program
418 void Utils::program::getBinary(std::vector<GLubyte>& binary, GLenum& binary_format) const
442 GLuint Utils::program::getSubroutineIndex(const glw::GLchar* subroutine_name, glw::GLenum shader_stage) const
467 GLint Utils::program::getSubroutineUniformLocation(const glw::GLchar* uniform_name, glw::GLenum shader_stage) const
492 GLint Utils::program::getUniformLocation(const glw::GLchar* uniform_name) const
511 /** Attach shaders and link program
514 void Utils::program::link() const
584 m_context.getTestContext().getLog() << tcu::TestLog::Message << "Failed to link program:\n"
587 TCU_FAIL("Failed to link program");
591 /** Delete program object and all attached shaders
594 void Utils::program::remove()
599 /* Make sure program object is no longer used by GL */
602 /* Clean program object */
650 void Utils::program::use() const
791 /** Builds a program object consisting of up to 5 shader stages
793 * The shaders are attached to the program object, then compiled. Finally,
794 * the program object is linked.
796 * XFB can be optionally configured for the program object.
813 * program object.
816 * program object.
819 * program object.
822 * program object.
825 * program object.
826 * @param out_po_id Deref will be used to store GL id of a generated program object.
829 * @return true if the program was built successfully, false otherwise.
839 /* Link the program object */
842 /* Create objects, set up shader bodies and attach all requested shaders to the program object */
1302 /** Returns string that represents program interface name
1306 * @return String representation of known program interface
1310 const GLchar* string = "Unknown program interface";
1893 /* Generate program & shader objects */
1899 /* Attach the shader to the program object */
1922 /* Try to link the program object */
1976 /* Initialize a test program object */
2188 /* Build the test program */
2200 TCU_FAIL("Test program failed to build.");
2242 /* Activate test program object */
2550 /* Initialize a test program object */
2907 Utils::program program(m_context);
2935 program.build(0 /* cs */, 0 /* fs */, 0 /* gs */, 0 /* tcs */, 0 /* test */, vertex_shader_code, varying_names,
2946 program.use();
2949 if ((false == inspectProgramStageiv(program.m_program_object_id)) ||
2950 (false == inspectActiveSubroutineUniformiv(program.m_program_object_id, subroutine_uniform_names)) ||
2951 (false == inspectActiveSubroutineUniformName(program.m_program_object_id, subroutine_uniform_names)) ||
2952 (false == inspectActiveSubroutineName(program.m_program_object_id, subroutine_names)) ||
2954 inspectSubroutineBinding(program.m_program_object_id, subroutine_names, subroutine_uniform_names, false)))
2962 if ((false == inspectProgramInterfaceiv(program.m_program_object_id)) ||
2964 inspectProgramResourceiv(program.m_program_object_id, subroutine_names, subroutine_uniform_names)) ||
2966 inspectSubroutineBinding(program.m_program_object_id, subroutine_names, subroutine_uniform_names, true)))
2973 if ((false == testDraw(program.m_program_object_id, subroutine_names[inverse_order_routine_index],
2976 (false == testDraw(program.m_program_object_id, subroutine_names[inverse_order_routine_index],
2979 (false == testDraw(program.m_program_object_id, subroutine_names[inverse_order_routine_index],
2982 (false == testDraw(program.m_program_object_id, subroutine_names[negate_routine_index],
2985 (false == testDraw(program.m_program_object_id, subroutine_names[negate_routine_index],
2988 (false == testDraw(program.m_program_object_id, subroutine_names[inverse_routine_index],
2997 if ((false == testDraw(program.m_program_object_id, subroutine_names[inverse_order_routine_index],
3000 (false == testDraw(program.m_program_object_id, subroutine_names[inverse_order_routine_index],
3003 (false == testDraw(program.m_program_object_id, subroutine_names[inverse_order_routine_index],
3006 (false == testDraw(program.m_program_object_id, subroutine_names[negate_routine_index],
3009 (false == testDraw(program.m_program_object_id, subroutine_names[negate_routine_index],
3012 (false == testDraw(program.m_program_object_id, subroutine_names[inverse_routine_index],
3178 /** Returns index of program resource
3434 * @param uniform_names Array of subroutine uniform names available in program
3511 * @param uniform_names Array of subroutine uniform names available in program
3562 * @param subroutine_names Array of subroutine names available in program
3613 * @param subroutine_names Array of subroutine names available in program
3614 * @param uniform_names Array of subroutine uniform names available in program
3959 Utils::program program(m_context);
3964 program.build(0 /* cs */, 0 /* fs */, 0 /* gs */, 0 /* tcs */, 0 /* test */, vertex_shader_code, varying_names,
3967 program.use();
3983 program.getSubroutineUniformLocation(subroutine_uniform_names[type][uniform], GL_VERTEX_SHADER);
3989 program.getSubroutineIndex(subroutine_names[type][routine], GL_VERTEX_SHADER);
3996 m_uniform_locations[i] = program.getUniformLocation(uniform_names[i]);
4298 Utils::program program(m_context);
4303 program.build(0 /* cs */, 0 /* fs */, 0 /* gs */, 0 /* tcs */, 0 /* test */, vertex_shader_code, &varying_name,
4306 program.use();
4319 const GLint uniform_location = gl.getUniformLocation(program.m_program_object_id, "input_data");
4518 Utils::program program(m_context);
4525 program.build(0 /* cs */, 0 /* fs */, 0 /* gs */, 0 /* tcs */, 0 /* test */, vertex_shader_code, varying_names,
4528 program.use();
4538 m_subroutine_indices[routine] = program.getSubroutineIndex(subroutine_names[routine], GL_VERTEX_SHADER);
4545 program.getSubroutineUniformLocation(subroutine_uniform_names[uniform], GL_VERTEX_SHADER);
4551 m_uniform_locations[i] = program.getUniformLocation(uniform_names[i]);
4927 "Makes sure that program with one function associated with 3 different "
5015 /* Set up program object */
5242 Utils::program program(m_context);
5247 program.build(0 /* cs */, 0 /* fs */, 0 /* gs */, 0 /* tcs */, 0 /* test */, vertex_shader_code, &varying_name,
5250 program.use();
5263 m_subroutine_indices[routine] = program.getSubroutineIndex(subroutine_names[routine], GL_VERTEX_SHADER);
5270 program.getSubroutineUniformLocation(subroutine_uniform_names[uniform], GL_VERTEX_SHADER);
5645 Utils::program program(m_context);
5650 program.build(0 /* cs */, fragment_shader_code /* fs */, geometry_shader_code /* gs */, 0 /* tcs */, 0 /* test */,
5653 program.use();
5669 m_subroutine_indices[type][0] = program.getSubroutineIndex(subroutine_names[type][0], GL_FRAGMENT_SHADER);
5670 m_subroutine_indices[type][1] = program.getSubroutineIndex(subroutine_names[type][1], GL_FRAGMENT_SHADER);
5677 program.getSubroutineUniformLocation(subroutine_uniform_names[uniform], GL_FRAGMENT_SHADER);
5683 m_uniform_locations[i] = program.getUniformLocation(uniform_names[i]);
6041 Utils::program program(m_context);
6045 program.build(0 /* cs */, fragment_shader_code /* fs */, geometry_shader_code /* gs */, 0 /* tcs */, 0 /* test */,
6048 program.use();
6067 GLuint increment_two = program.getSubroutineIndex(subroutine_names[0], GL_FRAGMENT_SHADER);
6068 GLuint decrement_three = program.getSubroutineIndex(subroutine_names[1], GL_FRAGMENT_SHADER);
6069 GLuint read_one = program.getSubroutineIndex(subroutine_names[2], GL_FRAGMENT_SHADER);
6226 Utils::program program(m_context);
6231 program.build(0 /* cs */, fragment_shader_code /* fs */, geometry_shader_code /* gs */, 0 /* tcs */, 0 /* test */,
6234 program.use();
6255 GLuint left_to_right = program.getSubroutineIndex(subroutine_names[0], GL_FRAGMENT_SHADER);
6256 GLuint right_to_left = program.getSubroutineIndex(subroutine_names[1], GL_FRAGMENT_SHADER);
6259 m_left_image = program.getUniformLocation(uniform_names[0]);
6260 m_right_image = program.getUniformLocation(uniform_names[1]);
6454 Utils::program program(m_context);
6458 program.build(0 /* cs */, fragment_shader_code /* fs */, geometry_shader_code /* gs */, 0 /* tcs */, 0 /* test */,
6461 program.use();
6479 GLuint increment = program.getSubroutineIndex(subroutine_names[0], GL_FRAGMENT_SHADER);
6480 GLuint decrement = program.getSubroutineIndex(subroutine_names[1], GL_FRAGMENT_SHADER);
6672 } /* for (both shader program object variants) */
7019 /* Make sure no program is used */
7059 /* Verify that all shader program objects have been linked successfully */
7075 TCU_FAIL("Shader program object linking failed.");
7077 } /* for (all shader program objects) */
7078 } /* for (both shader program object variants) */
7317 } /* for (all program shader object permutations) */
7600 Utils::program program(m_context);
7604 bool is_program_binary_supported = program.isProgramBinarySupported();
7607 program.build(0 /* cs */, 0 /* fs */, 0 /* gs */, 0 /* tcs */, 0 /* test */, vertex_shader_code,
7617 program.getSubroutineIndex(subroutine_names[type][0], GL_VERTEX_SHADER);
7620 program.getSubroutineIndex(subroutine_names[type][1], GL_VERTEX_SHADER);
7627 program.getSubroutineUniformLocation(subroutine_uniform_names[uniform], GL_VERTEX_SHADER);
7630 /* Delete program and recreate it from binary */
7634 program.getBinary(program_binary, binary_format);
7635 program.remove();
7636 program.createFromBinary(program_binary, binary_format);
7639 program.use();
7652 m_subroutine_indices[type][0] = program.getSubroutineIndex(subroutine_names[type][0], GL_VERTEX_SHADER);
7653 m_subroutine_indices[type][1] = program.getSubroutineIndex(subroutine_names[type][1], GL_VERTEX_SHADER);
7660 program.getSubroutineUniformLocation(subroutine_uniform_names[uniform], GL_VERTEX_SHADER);
7664 m_uniform_location = program.getUniformLocation(uniform_name);
7669 /* Test program binary */
7945 "Checks that when the active program for a shader stage is re-linke or "
8060 * the program/pipeline object the shader will be used for.
8211 for (unsigned int n_id = 0; n_id < 2 /* test program/shader objects */; ++n_id)
8224 m_testCtx.getLog() << tcu::TestLog::Message << "Failed to build test program object, index:"
8228 TCU_FAIL("Failed to build a test program");
8233 /* Initialize shader program objects */
8256 TCU_FAIL("Fragment shader program failed to link");
8258 TCU_FAIL("Geometry shader program failed to link");
8260 TCU_FAIL("Tessellation control shader program failed to link");
8262 TCU_FAIL("Tessellation evaluation shader program failed to link");
8264 TCU_FAIL("Vertex shader program failed to link");
8266 /* Initialize pipeline program object */
8347 /* Temporarily bind the program pipeline. */
8366 /* Unbind the program pipeline object */
8374 TEST_CASE_SWITCH_TO_DIFFERENT_PROGRAM_OBJECT, /* makes the verification routine use program object descriptor */
8392 } /* for (both program descriptors) */
8395 /** Retrieves IDs of shaders OR shader program objects, depending on which of the two
8399 * false to return shader program IDs.
8400 * @param n_id Index of the program/pipeline object the shaders
8460 for (unsigned int n_object_id = 0; n_object_id < 2; /* pipeline/program objects allocated for the test */
8524 /* Switch to a different program object and then back to current PO.
8746 } /* for (all program object descriptors) */
8748 /* Unbind the program object */
8766 * it will either query program object stages or separate shader objects.
8769 * @param n_id Index of the program/pipeline object to use for the verification
8897 "Creates a program which uses the same subroutine and subroutine uniform "
8899 "and then makes sure that such program compiles and works as expected.")
9000 /** Retrieves body of a fragment shader that should be used by the test program.
9038 /** Retrieves body of a geometry shader that should be used by the test program.
9108 /** Retrieves body of a tessellation control shader that should be used by the test program.
9155 * by the test program.
9197 /** Retrieves body of a vertex shader that should be used by the test program.
9243 /* Set up test program object */
9254 TCU_FAIL("Failed to link test program object");
9302 /* Use the test program to render a full-screen test quad */
9331 /** Verifies the data that have been rendered by the test program.
9590 TCU_FAIL("Failed to build test program object");
9899 /* Create program objects */
9965 /* Set up & link the test program object */
9982 /* Query test program object's properties */
10034 * if the program object identified by <program> has not been successfully
10045 "error code when called for a non-linked program object."
10213 * program is active.
10230 "when called without an active program object."
10266 * program is active for the shader stage identified by <shadertype>.
10286 "program object."
10379 /** Builds an offending program object and tries to link it. We're either expecting
10382 * If the program object builds successfully, the test has failed.
10403 /* Test program should not have built correctly ! */
10404 m_testCtx.getLog() << tcu::TestLog::Message << "In the following program, one of the stages references "
10416 } /* if (test program was built successfully) */
10418 /* Release the shaders & the program object that buildProgram() created */
11279 "trying to link a program with no subroutine for subroutine "
11371 << "A program object, consisting of the following shaders, has linked"
11661 "a program object includes two functions with the same name and one "
11754 << "A program object, consisting of the following shaders, has linked"
12058 * shader stages will be assigned valid bodies. Test should fail if the program
12086 : TestCase(context, "recursion", "Verify that it is not possible to build program with recursing subroutines")
12273 /** Try to build program from vertex shader code.
12286 /* Try to build program */
12292 Utils::program program(m_context);
12295 program.build(0, 0, 0, 0, 0, vertex_shader_code, 0, 0);
12300 index = program.getSubroutineIndex(name_of_recursive_routine, GL_VERTEX_SHADER);
12323 /* Delete program and shader */
12429 << "A program object consisting of FS+GS+TC+TE+VS stages has linked successfully, "
12691 * valid bodies. The test fails if a program built of such shaders links successfully.
12875 /* Try to build a program object using invalid vertex shader, specific to the
12891 m_testCtx.getLog() << tcu::TestLog::Message << "A program object was successfully built for ["
12922 "a program will fail to compile or link if any shader or stage contains"
13276 /* Try to build the program object */
13285 m_testCtx.getLog() << tcu::TestLog::Message << "A program object was successfully built for ["
13475 /* Try to build a program object using invalid vertex shader, specific to the
13491 m_testCtx.getLog() << tcu::TestLog::Message << "A program object was successfully built for ["
13713 /* Try to build a program object using invalid vertex shader, specific to the
13729 m_testCtx.getLog() << tcu::TestLog::Message << "A program object was successfully built for ["