mesa: Add new constants related to GL_ARB_viewport_array

These limits will be queryable by GL_MAX_VIEWPORTS,
GL_VIEWPORT_SUBPIXEL_BITS, and GL_VIEWPORT_BOUNDS_RANGE.  Drivers that
actually implement the extension must set values for these constants
that comply with the minimum-maximums from the spec.

Most of these changes were part of other patches.  They were separated out
because it make reordering of later patches easier.  Also, MaxViewports wasn't
set by that patch, and I completely overlooked it in review.  It's now obvious
that it's set. :)

v2 (idr): Split these changes out from the original patches.  Keep
MaxViewportWidth and MaxViewportHeight as GLuint.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
Ian Romanick
2014-01-07 14:39:48 -08:00
parent b39bfa4f49
commit 1f59e963b4
3 changed files with 15 additions and 0 deletions

View File

@@ -137,6 +137,9 @@
#define MAX_VIEWPORT_WIDTH 16384 #define MAX_VIEWPORT_WIDTH 16384
#define MAX_VIEWPORT_HEIGHT 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. */ /** Maxmimum size for CVA. May be overridden by the drivers. */
#define MAX_ARRAY_LOCK_SIZE 3000 #define MAX_ARRAY_LOCK_SIZE 3000

View File

@@ -588,6 +588,12 @@ _mesa_init_constants(struct gl_context *ctx)
ctx->Const.MaxViewportWidth = MAX_VIEWPORT_WIDTH; ctx->Const.MaxViewportWidth = MAX_VIEWPORT_WIDTH;
ctx->Const.MaxViewportHeight = MAX_VIEWPORT_HEIGHT; 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 */ /** GL_ARB_uniform_buffer_object */
ctx->Const.MaxCombinedUniformBlocks = 36; ctx->Const.MaxCombinedUniformBlocks = 36;
ctx->Const.MaxUniformBufferBindings = 36; ctx->Const.MaxUniformBufferBindings = 36;

View File

@@ -3166,6 +3166,12 @@ struct gl_constants
GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */ GLfloat MaxSpotExponent; /**< GL_NV_light_max_exponent */
GLuint MaxViewportWidth, MaxViewportHeight; 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]; struct gl_program_constants Program[MESA_SHADER_STAGES];
GLuint MaxProgramMatrices; GLuint MaxProgramMatrices;