summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/api_validate.c
diff options
context:
space:
mode:
authorLyude <[email protected]>2017-03-06 21:47:00 -0500
committerIlia Mirkin <[email protected]>2017-03-31 21:41:20 -0400
commit54af467334db53837171701471fb7854ccdf8dd5 (patch)
tree1853092686151df53e08e0ddcf03a52e96a98e7d /src/mesa/main/api_validate.c
parenta7cb2b40edc308e19d7254f86c1ec1f437c50ab3 (diff)
mesa: Add support for GL_NV_fill_rectangle
Since we don't have the bits required to support this in OpenGLES yet, this only enables support for Desktop OpenGL Signed-off-by: Lyude <[email protected]> Changes since v1: - Simply _mesa_PolygonMode() a little bit - Fix formatting in OpenGL spec excerpts - Move polygon mode checking into _mesa_valid_to_render() Changes since v3: - Improve error message for invalid drawings with GL_FILL_RECTANGLE_NV Reviewed-by: Ilia Mirkin <[email protected]>
Diffstat (limited to 'src/mesa/main/api_validate.c')
-rw-r--r--src/mesa/main/api_validate.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c
index 44d164ad355..af4f7cb4bf3 100644
--- a/src/mesa/main/api_validate.c
+++ b/src/mesa/main/api_validate.c
@@ -189,6 +189,19 @@ _mesa_valid_to_render(struct gl_context *ctx, const char *where)
return GL_FALSE;
}
+ /* From the GL_NV_fill_rectangle spec:
+ *
+ * "An INVALID_OPERATION error is generated by Begin or any Draw command if
+ * only one of the front and back polygon mode is FILL_RECTANGLE_NV."
+ */
+ if ((ctx->Polygon.FrontMode == GL_FILL_RECTANGLE_NV) !=
+ (ctx->Polygon.BackMode == GL_FILL_RECTANGLE_NV)) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "GL_FILL_RECTANGLE_NV must be used as both front/back "
+ "polygon mode or neither");
+ return GL_FALSE;
+ }
+
#ifdef DEBUG
if (ctx->_Shader->Flags & GLSL_LOG) {
struct gl_program **prog = ctx->_Shader->CurrentProgram;