summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/main/config.h3
-rw-r--r--src/mesa/main/context.c6
-rw-r--r--src/mesa/main/mtypes.h6
3 files changed, 15 insertions, 0 deletions
diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h
index ff9da779bf8..aa2b37aafb7 100644
--- a/src/mesa/main/config.h
+++ b/src/mesa/main/config.h
@@ -137,6 +137,9 @@
#define MAX_VIEWPORT_WIDTH 16384
#define MAX_VIEWPORT_HEIGHT 16384
+/** Maximun number of viewports supported with ARB_viewport_array */
+#define MAX_VIEWPORTS 16
+
/** Maxmimum size for CVA. May be overridden by the drivers. */
#define MAX_ARRAY_LOCK_SIZE 3000
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 0b8fb94e8fb..538322e9eb8 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -588,6 +588,12 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxViewportWidth = MAX_VIEWPORT_WIDTH;
ctx->Const.MaxViewportHeight = MAX_VIEWPORT_HEIGHT;
+ /* Driver must override these values if ARB_viewport_array is supported. */
+ 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;
ctx->Const.MaxUniformBufferBindings = 36;
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 93390ec3703..a939d9c9f62 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3166,6 +3166,12 @@ struct gl_constants
GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */
GLuint 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 Program[MESA_SHADER_STAGES];
GLuint MaxProgramMatrices;