summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/polygon.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/polygon.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/polygon.c')
-rw-r--r--src/mesa/main/polygon.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
index 4caf62adfea..1bb7190bc24 100644
--- a/src/mesa/main/polygon.c
+++ b/src/mesa/main/polygon.c
@@ -131,8 +131,17 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
_mesa_enum_to_string(face),
_mesa_enum_to_string(mode));
- if (mode!=GL_POINT && mode!=GL_LINE && mode!=GL_FILL) {
- _mesa_error( ctx, GL_INVALID_ENUM, "glPolygonMode(mode)" );
+ switch (mode) {
+ case GL_POINT:
+ case GL_LINE:
+ case GL_FILL:
+ break;
+ case GL_FILL_RECTANGLE_NV:
+ if (ctx->Extensions.NV_fill_rectangle)
+ break;
+ /* fall-through */
+ default:
+ _mesa_error(ctx, GL_INVALID_ENUM, "glPolygonMode(mode)");
return;
}