[Mesa-dev] [PATCH V4 05/19] mesa: add new max sample count state

Chris Forbes chrisf at ijw.co.nz
Tue Feb 26 02:10:46 PST 2013


- GL_MAX_COLOR_TEXTURE_SAMPLES
- GL_MAX_DEPTH_TEXTURE_SAMPLES
- GL_MAX_INTEGER_SAMPLES

V2: initialize limits to 1 in _mesa_init_constants as suggested by Brian
and Paul

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
 src/mesa/main/context.c          | 5 +++++
 src/mesa/main/get_hash_params.py | 3 +++
 src/mesa/main/mtypes.h           | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 02acfc2..cdcf7ad 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -661,6 +661,11 @@ _mesa_init_constants(struct gl_context *ctx)
 
    /* ES 3.0 or ARB_ES3_compatibility */
    ctx->Const.MaxElementIndex = 0xffffffffu;
+
+   /* GL_ARB_texture_multisample */
+   ctx->Const.MaxColorTextureSamples = 1;
+   ctx->Const.MaxDepthTextureSamples = 1;
+   ctx->Const.MaxIntegerSamples = 1;
 }
 
 
diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
index 205139d..0f900a3 100644
--- a/src/mesa/main/get_hash_params.py
+++ b/src/mesa/main/get_hash_params.py
@@ -661,6 +661,9 @@ descriptor=[
 # GL_ARB_texture_multisample / GL 3.2
   [ "TEXTURE_BINDING_2D_MULTISAMPLE", "LOC_CUSTOM, TYPE_INT, TEXTURE_2D_MULTISAMPLE_INDEX, extra_ARB_texture_multisample" ],
   [ "TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY", "LOC_CUSTOM, TYPE_INT, TEXTURE_2D_MULTISAMPLE_ARRAY_INDEX, extra_ARB_texture_multisample" ],
+  [ "MAX_COLOR_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxColorTextureSamples), extra_ARB_texture_multisample" ],
+  [ "MAX_DEPTH_TEXTURE_SAMPLES", "CONTEXT_INT(Const.MaxDepthTextureSamples), extra_ARB_texture_multisample" ],
+  [ "MAX_INTEGER_SAMPLES", "CONTEXT_INT(Const.MaxIntegerSamples), extra_ARB_texture_multisample" ],
 
 
 # GL_ARB_sampler_objects / GL 3.3
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index a292d98..446f91d 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3035,6 +3035,11 @@ struct gl_constants
     * backslash character ('\') in GLSL source.
     */
    GLboolean DisableGLSLLineContinuations;
+
+   /** GL_ARB_texture_multisample */
+   GLint MaxColorTextureSamples;
+   GLint MaxDepthTextureSamples;
+   GLint MaxIntegerSamples;
 };
 
 
-- 
1.8.1.4



More information about the mesa-dev mailing list