projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
837b555
)
swrast: remove MAX_WIDTH arrays in s_depth.c
author
Brian Paul
<brianp@vmware.com>
Mon, 20 Feb 2012 03:08:52 +0000
(20:08 -0700)
committer
Brian Paul
<brianp@vmware.com>
Fri, 24 Feb 2012 15:03:03 +0000
(08:03 -0700)
src/mesa/swrast/s_depth.c
patch
|
blob
|
history
diff --git
a/src/mesa/swrast/s_depth.c
b/src/mesa/swrast/s_depth.c
index c9038820964a788c6c8ae0fa52363ec9c1223553..26126a9329ff7c2f942d59a156ed451c851defc4 100644
(file)
--- a/
src/mesa/swrast/s_depth.c
+++ b/
src/mesa/swrast/s_depth.c
@@
-419,9
+419,15
@@
_swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
const GLuint count = span->end;
GLuint i;
GLboolean anyPass = GL_FALSE;
- GLuint
zBufferTemp[MAX_WIDTH]
;
+ GLuint
*zBufferTemp
;
const GLuint *zBufferVals;
+ zBufferTemp = (GLuint *) malloc(count * sizeof(GLuint));
+ if (!zBufferTemp) {
+ /* don't generate a stream of OUT_OF_MEMORY errors here */
+ return GL_FALSE;
+ }
+
if (span->arrayMask & SPAN_XY)
zStart = NULL;
else
@@
-453,6
+459,8
@@
_swrast_depth_bounds_test( struct gl_context *ctx, SWspan *span )
}
}
+ free(zBufferTemp);
+
return anyPass;
}