ctx.endSection();
}
-void draw_elements_base_vertex_invalid_map (NegativeTestContext& ctx)
-{
- GLuint buf = 0;
- GLfloat vertices[1];
-
- ctx.beginSection("GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped.");
- ctx.glGenBuffers(1, &buf);
- ctx.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf);
- ctx.glBufferData(GL_ELEMENT_ARRAY_BUFFER, 10, 0, GL_STATIC_DRAW);
- ctx.glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT);
- ctx.expectError(GL_NO_ERROR);
- ctx.glDrawElementsBaseVertex(GL_POINTS, 1, GL_UNSIGNED_INT, vertices, 1);
- ctx.expectError(GL_INVALID_OPERATION);
- ctx.glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- ctx.glDeleteBuffers(1, &buf);
- ctx.endSection();
-}
-
void draw_elements_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx)
{
+ TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
+
GLfloat vertices[1];
map<string, string> args;
- const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
- args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
+ args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES);
glu::ShaderProgram program(ctx.getRenderContext(), glu::ProgramSources() << glu::ProgramSeparable(true) << glu::VertexSource(tcu::StringTemplate(vertexShaderSource).specialize(args)) << glu::GeometrySource(geometryShaderSource));
ctx.glUseProgram(0);
}
-void draw_elements_instanced_base_vertex_invalid_map (NegativeTestContext& ctx)
-{
- GLfloat vertices[1];
- GLuint buf = 0;
-
- ctx.beginSection("GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped.");
- ctx.glGenBuffers(1, &buf);
- ctx.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf);
- ctx.glBufferData(GL_ELEMENT_ARRAY_BUFFER, 10, 0, GL_STATIC_DRAW);
- ctx.glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT);
- ctx.expectError(GL_NO_ERROR);
- ctx.glDrawElementsInstancedBaseVertex(GL_POINTS, 1, GL_UNSIGNED_INT, vertices, 1, 1);
- ctx.expectError(GL_INVALID_OPERATION);
- ctx.glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- ctx.glDeleteBuffers(1, &buf);
- ctx.endSection();
-
-}
-
void draw_elements_instanced_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx)
{
+ TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
+
GLfloat vertices[1];
map<string, string> args;
- const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
- args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
+ args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES);
glu::ShaderProgram geometryProgram(ctx.getRenderContext(), glu::ProgramSources() << glu::ProgramSeparable(true) << glu::VertexSource(tcu::StringTemplate(vertexShaderSource).specialize(args)) << glu::GeometrySource(geometryShaderSource));
ctx.beginSection("GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object.");
ctx.glUseProgram(0);
}
-void draw_range_elements_base_vertex_invalid_map (NegativeTestContext& ctx)
-{
- GLuint buf = 0;
- GLfloat vertices[1];
-
- ctx.beginSection("GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data store is currently mapped.");
- ctx.glGenBuffers(1, &buf);
- ctx.glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, buf);
- ctx.glBufferData(GL_ELEMENT_ARRAY_BUFFER, 10, 0, GL_STATIC_DRAW);
- ctx.glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER, 0, 5, GL_MAP_READ_BIT);
- ctx.expectError(GL_NO_ERROR);
- ctx.glDrawRangeElementsBaseVertex(GL_POINTS, 0, 1, 1, GL_UNSIGNED_INT, vertices, 1);
- ctx.expectError(GL_INVALID_OPERATION);
- ctx.glUnmapBuffer(GL_ELEMENT_ARRAY_BUFFER);
- ctx.glDeleteBuffers(1, &buf);
- ctx.endSection();
-}
-
void draw_range_elements_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx)
{
+ TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version.");
+
GLfloat vertices[1];
map<string, string> args;
- const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
- args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
+ args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES);
glu::ShaderProgram geometryProgram(ctx.getRenderContext(), glu::ProgramSources() << glu::ProgramSeparable(true) << glu::VertexSource(tcu::StringTemplate(vertexShaderSource).specialize(args)) << glu::GeometrySource(geometryShaderSource));
ctx.beginSection("GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object.");