* @param context Test context
**/
XFBStrideOfEmptyListTest::XFBStrideOfEmptyListTest(deqp::Context& context)
- : BufferTestBase(context, "xfb_stride_of_empty_list",
- "Test verifies that xfb_stride qualifier is respected when no xfb_offset is specified")
+ : BufferTestBase(
+ context, "xfb_stride_of_empty_list",
+ "Test verifies correct behavior when xfb_stride qualifier is specified but no xfb_offset is specified")
{
/* Nothing to be done here */
}
break;
case SECOND_MISSING:
- if (GL_NO_ERROR == error)
+ if (GL_NO_ERROR != error)
{
gl.endTransformFeedback();
+ GLU_EXPECT_NO_ERROR(error, "BeginTransformFeedback");
}
- if (GL_INVALID_OPERATION != error)
- {
- m_context.getTestContext().getLog()
- << tcu::TestLog::Message << "XFB at index 1, that is declared as empty, is missing. It was expected "
- "that INVALID_OPERATION will generated by BeginTransformFeedback. Got: "
- << glu::getErrorStr(error) << tcu::TestLog::EndMessage;
+ gl.drawArrays(GL_PATCHES, 0 /* first */, 1 /* count */);
+ error = gl.getError();
- result = false;
- }
+ gl.endTransformFeedback();
+ GLU_EXPECT_NO_ERROR(error, "DrawArrays");
+ GLU_EXPECT_NO_ERROR(gl.getError(), "EndTransformFeedback");
break;
}
/* Data */
uniform.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
- /* Draw call will not be executed, contents does not matter */
xfb_0.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
+ xfb_0.m_expected_data = uniform.m_initial_data;
}
break;
break;
case FIRST_MISSING:
- if (GL_NO_ERROR == error)
+ if (GL_NO_ERROR != error)
{
gl.endTransformFeedback();
+ GLU_EXPECT_NO_ERROR(error, "BeginTransformFeedback");
}
- if (GL_INVALID_OPERATION != error)
- {
- m_context.getTestContext().getLog()
- << tcu::TestLog::Message << "XFB at index 0, that is declared as empty, is missing. It was expected "
- "that INVALID_OPERATION will generated by BeginTransformFeedback. Got: "
- << glu::getErrorStr(error) << tcu::TestLog::EndMessage;
+ gl.drawArrays(GL_PATCHES, 0 /* first */, 1 /* count */);
+ error = gl.getError();
- result = false;
- }
+ gl.endTransformFeedback();
+ GLU_EXPECT_NO_ERROR(error, "DrawArrays");
+ GLU_EXPECT_NO_ERROR(gl.getError(), "EndTransformFeedback");
break;
if (GL_INVALID_OPERATION != error)
{
m_context.getTestContext().getLog()
- << tcu::TestLog::Message << "XFB at index 1, that is written by GS, is missing. It was expected that "
- "INVALID_OPERATION will generated by BeginTransformFeedback. Got: "
+ << tcu::TestLog::Message << "XFB at index 1, that is declared as empty, is missing. It was expected "
+ "that INVALID_OPERATION will generated by BeginTransformFeedback. Got: "
<< glu::getErrorStr(error) << tcu::TestLog::EndMessage;
result = false;
/* Data */
uniform.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
- /* Draw call will not be executed, contents does not matter */
- xfb_1.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
+ /* Data, contents are the same as no modification is expected */
+ xfb_1.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
+ xfb_1.m_expected_data = uniform.m_initial_data;
}
break;
uniform.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
/* Draw call will not be executed, contents does not matter */
- xfb_0.m_initial_data.resize(m_stride);
+ xfb_0.m_initial_data = Utils::Type::vec4.GenerateDataPacked();
}
break;
Utils::Program::NameVector& captured_varyings,
GLint* xfb_components)
{
- captured_varyings.push_back("gs_fs");
+ captured_varyings.push_back("gs_fs1");
+ captured_varyings.push_back("gs_fs2");
*xfb_components = 4;
}
{
out_calculations = "";
- static const GLchar* gs = " gs_fs = uni_gs;\n";
- static const GLchar* fs = " fs_out = vec4(gs_fs);\n";
+ static const GLchar* gs = " gs_fs1 = -uni_gs;\n"
+ " gs_fs2 = uni_gs;\n";
+ static const GLchar* fs = " fs_out = vec4(gs_fs2);\n";
const GLchar* assignments = "";
switch (stage)
void XFBStrideOfEmptyListAndAPITest::getShaderInterface(GLuint /* test_case_index */, Utils::Shader::STAGES stage,
std::string& out_interface)
{
- static const GLchar* gs = "layout (xfb_buffer = 0, xfb_stride = 64) out;\n"
- "layout (xfb_buffer = 1, xfb_offset = 0) out vec4 gs_fs;\n"
+ static const GLchar* gs = "layout (xfb_buffer = 0, xfb_stride = 64) out vec4 gs_fs1;\n"
+ "layout (xfb_buffer = 1, xfb_offset = 0) out vec4 gs_fs2;\n"
"\n"
"layout(binding = 0) uniform gs_block {\n"
" vec4 uni_gs;\n"
"};\n";
- static const GLchar* fs = "in vec4 gs_fs;\n"
+ static const GLchar* fs = "in vec4 gs_fs2;\n"
"out vec4 fs_out;\n";
switch (stage)