* @param ignored
**/
void BufferTestBase::getCapturedVaryings(glw::GLuint /* test_case_index */,
- Utils::Program::NameVector& /* captured_varyings */)
+ Utils::Program::NameVector& /* captured_varyings */,
+ GLint* /* xfb_components */)
{
/* Nothing to be done */
}
Utils::VertexArray vao(m_context);
/* Get captured varyings */
- getCapturedVaryings(test_case_index, captured_varyings);
+ GLint xfb_components;
+ getCapturedVaryings(test_case_index, captured_varyings, &xfb_components);
+
+ /* Don't generate shaders that try to capture more XFB components than the implementation's limit */
+ if (captured_varyings.size() > 0)
+ {
+ const Functions& gl = m_context.getRenderContext().getFunctions();
+
+ GLint max_xfb_components;
+ gl.getIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, &max_xfb_components);
+ GLU_EXPECT_NO_ERROR(gl.getError(), "GetIntegerv");
+
+ if (xfb_components > max_xfb_components)
+ return true;
+ }
/* Get shader sources */
const std::string& fragment_shader = getShaderSource(test_case_index, Utils::Shader::FRAGMENT);
* @param captured_varyings Vector of varying names to be captured
**/
void XFBStrideOfEmptyListAndAPITest::getCapturedVaryings(glw::GLuint /* test_case_index */,
- Utils::Program::NameVector& captured_varyings)
+ Utils::Program::NameVector& captured_varyings,
+ GLint* xfb_components)
{
captured_varyings.push_back("gs_fs");
+ *xfb_components = 4;
}
/** Get body of main function for given shader stage
* @param ignored
* @param captured_varyings List of names
**/
-void XFBOverrideQualifiersWithAPITest::getCapturedVaryings(glw::GLuint /* test_case_index */,
- Utils::Program::NameVector& captured_varyings)
+void XFBOverrideQualifiersWithAPITest::getCapturedVaryings(glw::GLuint test_case_index,
+ Utils::Program::NameVector& captured_varyings,
+ GLint* xfb_components)
{
captured_varyings.resize(1);
captured_varyings[0] = "trunks";
+
+ /* The test captures 3 varyings of type 'type' */
+ Utils::Type type = getType(test_case_index);
+ GLint type_size = type.GetSize(false);
+ *xfb_components = 3 * type_size / 4;
}
/** Get body of main function for given shader stage
virtual void getBufferDescriptors(glw::GLuint test_case_index, bufferDescriptor::Vector& out_descriptors);
- virtual void getCapturedVaryings(glw::GLuint test_case_index, Utils::Program::NameVector& captured_varyings);
+ virtual void getCapturedVaryings(glw::GLuint test_case_index, Utils::Program::NameVector& captured_varyings, glw::GLint* xfb_components);
virtual void getShaderBody(glw::GLuint test_case_index, Utils::Shader::STAGES stage, std::string& out_assignments,
std::string& out_calculations);
virtual bool executeDrawCall(bool tesEnabled, glw::GLuint test_case_index);
virtual void getBufferDescriptors(glw::GLuint test_case_index, bufferDescriptor::Vector& out_descriptors);
- virtual void getCapturedVaryings(glw::GLuint test_case_index, Utils::Program::NameVector& captured_varyings);
+ virtual void getCapturedVaryings(glw::GLuint test_case_index, Utils::Program::NameVector& captured_varyings, glw::GLint* xfb_components);
virtual void getShaderBody(glw::GLuint test_case_index, Utils::Shader::STAGES stage, std::string& out_assignments,
std::string& out_calculations);
/* Protected methods */
virtual void getBufferDescriptors(glw::GLuint test_case_index, bufferDescriptor::Vector& out_descriptors);
- virtual void getCapturedVaryings(glw::GLuint test_case_index, Utils::Program::NameVector& captured_varyings);
+ virtual void getCapturedVaryings(glw::GLuint test_case_index, Utils::Program::NameVector& captured_varyings, glw::GLint* xfb_components);
virtual void getShaderBody(glw::GLuint test_case_index, Utils::Shader::STAGES stage, std::string& out_assignments,
std::string& out_calculations);