summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2010-02-11 11:34:28 -0700
committerBrian Paul <[email protected]>2010-02-11 11:34:54 -0700
commit362fa6763c3a6cd9cef6a1f84c5ac367295a7961 (patch)
tree1ab7d863afecb8cabe63fcc9d737ac6c8c7f926a
parent0be04f710eef72c03a6c7c01c378b003dbb4b5ce (diff)
mesa: additional constant/limit assertions
-rw-r--r--src/mesa/main/context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
index 2165af2882c..c292d1fea5e 100644
--- a/src/mesa/main/context.c
+++ b/src/mesa/main/context.c
@@ -593,17 +593,22 @@ check_context_limits(GLcontext *ctx)
assert(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX);
/* Texture unit checks */
+ assert(ctx->Const.MaxTextureImageUnits > 0);
assert(ctx->Const.MaxTextureImageUnits <= MAX_TEXTURE_IMAGE_UNITS);
+ assert(ctx->Const.MaxTextureCoordUnits > 0);
assert(ctx->Const.MaxTextureCoordUnits <= MAX_TEXTURE_COORD_UNITS);
+ assert(ctx->Const.MaxTextureUnits > 0);
assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureUnits <= MAX_TEXTURE_COORD_UNITS);
assert(ctx->Const.MaxTextureUnits == MIN2(ctx->Const.MaxTextureImageUnits,
ctx->Const.MaxTextureCoordUnits));
+ assert(ctx->Const.MaxCombinedTextureImageUnits > 0);
assert(ctx->Const.MaxCombinedTextureImageUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
assert(ctx->Const.MaxTextureCoordUnits <= MAX_COMBINED_TEXTURE_IMAGE_UNITS);
/* number of coord units cannot be greater than number of image units */
assert(ctx->Const.MaxTextureCoordUnits <= ctx->Const.MaxTextureImageUnits);
+
/* Texture size checks */
assert(ctx->Const.MaxTextureLevels <= MAX_TEXTURE_LEVELS);
assert(ctx->Const.Max3DTextureLevels <= MAX_3D_TEXTURE_LEVELS);