From 362fa6763c3a6cd9cef6a1f84c5ac367295a7961 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 11 Feb 2010 11:34:28 -0700 Subject: mesa: additional constant/limit assertions --- src/mesa/main/context.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/main') 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); -- cgit v1.2.3