diff options
author | Erik Faye-Lund <[email protected]> | 2019-02-25 12:06:23 +0100 |
---|---|---|
committer | Erik Faye-Lund <[email protected]> | 2019-05-29 10:54:09 +0200 |
commit | 00c683bc8e991031b88cfe0862415e571daf851b (patch) | |
tree | f058f3754bd0a45548d6eddeaa0bff67cc1a046a /src/mesa/main | |
parent | d3771ccaa347a4208807bd30a5366177d3c3aa1d (diff) |
mesa/main: make the PRIMITIVE_RESTART_NV checks consistent
{En,Dis}ableClientState(PRIMITIVE_RESTART_NV) should only work on
compatibility contextxs. While we're at it, modernize the code a bit,
by using the extension helpers instead of open-coding.
Signed-off-by: Erik Faye-Lund <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/enable.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index dc9c77cfb86..ce64e037906 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -107,7 +107,7 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_NV_primitive_restart */ case GL_PRIMITIVE_RESTART_NV: - if (!ctx->Extensions.NV_primitive_restart) + if (!_mesa_has_NV_primitive_restart(ctx)) goto invalid_enum_error; if (ctx->Array.PrimitiveRestart == state) return; @@ -1721,9 +1721,8 @@ _mesa_IsEnabled( GLenum cap ) /* GL_NV_primitive_restart */ case GL_PRIMITIVE_RESTART_NV: - if (ctx->API != API_OPENGL_COMPAT || !ctx->Extensions.NV_primitive_restart) { + if (!_mesa_has_NV_primitive_restart(ctx)) goto invalid_enum_error; - } return ctx->Array.PrimitiveRestart; /* GL 3.1 primitive restart */ |