[Mesa-dev] [PATCH 25/40] mesa: Add custom get function for SCISSOR_TEST to _mesa_IsEnabledi

Ian Romanick idr at freedesktop.org
Fri Jan 10 17:40:26 PST 2014


From: Courtney Goeltzenleuchter <courtney at LunarG.com>

Now that the scissor enable state is a bitfield need a custom function
to extract the correct value from gl_context.  Modeled
Scissor.EnableFlags after Color.BlendEnabled.
---
 src/mesa/main/enable.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index 4841e84..c0ad766 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1137,6 +1137,13 @@ _mesa_IsEnabledi( GLenum cap, GLuint index )
          return GL_FALSE;
       }
       return (ctx->Color.BlendEnabled >> index) & 1;
+   case GL_SCISSOR_TEST:
+      if (index >= ctx->Const.MaxViewports) {
+         _mesa_error(ctx, GL_INVALID_VALUE, "glIsEnabledIndexed(index=%u)",
+                     index);
+         return GL_FALSE;
+      }
+      return (ctx->Scissor.EnableFlags >> index) & 1;
    default:
       _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabledIndexed(cap=%s)",
                   _mesa_lookup_enum_by_nr(cap));
-- 
1.8.1.4



More information about the mesa-dev mailing list