aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/swrast/s_context.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-02-27 07:24:18 +0100
committermarha <marha@users.sourceforge.net>2012-02-27 07:24:18 +0100
commitc4f44c07c6662d1ce08603945ccc4fa5afaa742a (patch)
tree5daa31bcbf8c90e74d99d679611a2d44f3ccede1 /mesalib/src/mesa/swrast/s_context.c
parent5fb4fb602bde5140dcea45464e3b70a49078ad2e (diff)
downloadvcxsrv-c4f44c07c6662d1ce08603945ccc4fa5afaa742a.tar.gz
vcxsrv-c4f44c07c6662d1ce08603945ccc4fa5afaa742a.tar.bz2
vcxsrv-c4f44c07c6662d1ce08603945ccc4fa5afaa742a.zip
fontconfig pixman mesa git update 27 Feb 2012
Diffstat (limited to 'mesalib/src/mesa/swrast/s_context.c')
-rw-r--r--mesalib/src/mesa/swrast/s_context.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/mesalib/src/mesa/swrast/s_context.c b/mesalib/src/mesa/swrast/s_context.c
index cc304d70c..63350b2e7 100644
--- a/mesalib/src/mesa/swrast/s_context.c
+++ b/mesalib/src/mesa/swrast/s_context.c
@@ -726,6 +726,18 @@ _swrast_CreateContext( struct gl_context *ctx )
const GLuint maxThreads = 1;
#endif
+ assert(ctx->Const.MaxViewportWidth <= SWRAST_MAX_WIDTH);
+ assert(ctx->Const.MaxViewportHeight <= SWRAST_MAX_WIDTH);
+
+ assert(ctx->Const.MaxRenderbufferSize <= SWRAST_MAX_WIDTH);
+
+ /* make sure largest texture image is <= SWRAST_MAX_WIDTH in size */
+ assert((1 << (ctx->Const.MaxTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
+ assert((1 << (ctx->Const.MaxCubeTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
+ assert((1 << (ctx->Const.Max3DTextureLevels - 1)) <= SWRAST_MAX_WIDTH);
+
+ assert(PROG_MAX_WIDTH == SWRAST_MAX_WIDTH);
+
if (SWRAST_DEBUG) {
_mesa_debug(ctx, "_swrast_CreateContext\n");
}
@@ -790,6 +802,19 @@ _swrast_CreateContext( struct gl_context *ctx )
ctx->swrast_context = swrast;
+ swrast->stencil_temp.buf1 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+ swrast->stencil_temp.buf2 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+ swrast->stencil_temp.buf3 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+ swrast->stencil_temp.buf4 = (GLubyte *) malloc(SWRAST_MAX_WIDTH * sizeof(GLubyte));
+
+ if (!swrast->stencil_temp.buf1 ||
+ !swrast->stencil_temp.buf2 ||
+ !swrast->stencil_temp.buf3 ||
+ !swrast->stencil_temp.buf4) {
+ _swrast_DestroyContext(ctx);
+ return GL_FALSE;
+ }
+
return GL_TRUE;
}
@@ -806,6 +831,12 @@ _swrast_DestroyContext( struct gl_context *ctx )
if (swrast->ZoomedArrays)
FREE( swrast->ZoomedArrays );
FREE( swrast->TexelBuffer );
+
+ free(swrast->stencil_temp.buf1);
+ free(swrast->stencil_temp.buf2);
+ free(swrast->stencil_temp.buf3);
+ free(swrast->stencil_temp.buf4);
+
FREE( swrast );
ctx->swrast_context = 0;