summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/enable.c
diff options
context:
space:
mode:
authorCourtney Goeltzenleuchter <courtney@LunarG.com>2013-11-13 13:22:39 -0700
committerIan Romanick <ian.d.romanick@intel.com>2014-01-20 11:32:00 -0800
commit917db0bc3dfdec1536018d96aab261e485b8d872 (patch)
treef4b265940c8bd5ca3d75d03eabbc2b62a4077dff /src/mesa/main/enable.c
parent6d9c0011a05a2137ca40fa9ed720520fcc29578f (diff)
downloadexternal_mesa3d-917db0bc3dfdec1536018d96aab261e485b8d872.zip
external_mesa3d-917db0bc3dfdec1536018d96aab261e485b8d872.tar.gz
external_mesa3d-917db0bc3dfdec1536018d96aab261e485b8d872.tar.bz2
mesa: Add custom get function for SCISSOR_TEST to _mesa_IsEnabledi
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. Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/main/enable.c')
-rw-r--r--src/mesa/main/enable.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index a624690..640db84 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -1136,6 +1136,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));