[Mesa-dev] [PATCH 11/18] mesa: Add custom get function for SCISSOR

Courtney Goeltzenleuchter courtney at lunarg.com
Wed Nov 20 14:59:27 PST 2013


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 at LunarG.com>
---
 src/mesa/main/context.c    | 3 +++
 src/mesa/main/extensions.c | 1 +
 src/mesa/main/get.c        | 1 +
 src/mesa/main/mtypes.h     | 8 +++++++-
 4 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 91f3812..2baf4ef 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -589,6 +589,9 @@ _mesa_init_constants(struct gl_context *ctx)
 
    /* Driver must override if it supports ARB_viewport_array */
    ctx->Const.MaxViewports = 1;
+   ctx->Const.ViewportSubpixelBits = 0;
+   ctx->Const.ViewportBounds.Min = 0;
+   ctx->Const.ViewportBounds.Max = 0;
 
    /** GL_ARB_uniform_buffer_object */
    ctx->Const.MaxCombinedUniformBlocks = 36;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 104618c..dc82d5a 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -171,6 +171,7 @@ static const struct extension extension_table[] = {
    { "GL_ARB_vertex_shader",                       o(ARB_vertex_shader),                       GL,             2002 },
    { "GL_ARB_vertex_type_10f_11f_11f_rev",         o(ARB_vertex_type_10f_11f_11f_rev),         GL,             2013 },
    { "GL_ARB_vertex_type_2_10_10_10_rev",          o(ARB_vertex_type_2_10_10_10_rev),          GL,             2009 },
+   { "GL_ARB_viewport_array",                      o(ARB_viewport_array),                      GL,             2010 },
    { "GL_ARB_window_pos",                          o(dummy_true),                              GLL,            2001 },
    /* EXT extensions */
    { "GL_EXT_abgr",                                o(dummy_true),                              GL,             1995 },
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
index 9e5c04a..de1d9c5 100644
--- a/src/mesa/main/get.c
+++ b/src/mesa/main/get.c
@@ -378,6 +378,7 @@ EXTRA_EXT(ARB_texture_buffer_range);
 EXTRA_EXT(ARB_texture_multisample);
 EXTRA_EXT(ARB_texture_gather);
 EXTRA_EXT(ARB_shader_atomic_counters);
+EXTRA_EXT(ARB_viewport_array);
 
 static const int
 extra_ARB_color_buffer_float_or_glcore[] = {
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 63d1420..01be5de 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3118,8 +3118,13 @@ struct gl_constants
    GLfloat MaxShininess;                     /**< GL_NV_light_max_exponent */
    GLfloat MaxSpotExponent;                  /**< GL_NV_light_max_exponent */
 
-   GLuint MaxViewportWidth, MaxViewportHeight;
+   GLfloat MaxViewportWidth, MaxViewportHeight;
    GLuint MaxViewports;                      /**< GL_ARB_viewport_array */
+   GLuint ViewportSubpixelBits;              /**< GL_ARB_viewport_array */
+   struct {
+      GLfloat Min;
+      GLfloat Max;
+   } ViewportBounds;                         /**< GL_ARB_viewport_array */
 
    struct gl_program_constants VertexProgram;   /**< GL_ARB_vertex_program */
    struct gl_program_constants FragmentProgram; /**< GL_ARB_fragment_program */
@@ -3381,6 +3386,7 @@ struct gl_extensions
    GLboolean ARB_vertex_shader;
    GLboolean ARB_vertex_type_10f_11f_11f_rev;
    GLboolean ARB_vertex_type_2_10_10_10_rev;
+   GLboolean ARB_viewport_array;
    GLboolean EXT_blend_color;
    GLboolean EXT_blend_equation_separate;
    GLboolean EXT_blend_func_separate;
-- 
1.8.1.2



More information about the mesa-dev mailing list