mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
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 <erik.faye-lund@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
d3771ccaa3
commit
00c683bc8e
1 changed files with 2 additions and 3 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue