summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/osmesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2014-03-01 11:16:27 -0700
committerBrian Paul <[email protected]>2014-03-04 08:49:15 -0700
commitcbacee207faf866b0444beb583d3d6f341a8ee78 (patch)
treeb7cd955b4225e8d9ae30d458589fed13d22d4d5f /src/gallium/state_trackers/osmesa
parent3d7c8836a6076a5006763fb5fab7e7882e03659b (diff)
st/osmesa: check buffer size when searching for buffers
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75543 Cc: "10.1" <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/osmesa')
-rw-r--r--src/gallium/state_trackers/osmesa/osmesa.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/state_trackers/osmesa/osmesa.c b/src/gallium/state_trackers/osmesa/osmesa.c
index 8b30025b717..6b27c8af12c 100644
--- a/src/gallium/state_trackers/osmesa/osmesa.c
+++ b/src/gallium/state_trackers/osmesa/osmesa.c
@@ -480,12 +480,13 @@ osmesa_create_buffer(enum pipe_format color_format,
/**
- * Search linked list for a buffer with matching pixel formats.
+ * Search linked list for a buffer with matching pixel formats and size.
*/
static struct osmesa_buffer *
osmesa_find_buffer(enum pipe_format color_format,
enum pipe_format ds_format,
- enum pipe_format accum_format)
+ enum pipe_format accum_format,
+ GLsizei width, GLsizei height)
{
struct osmesa_buffer *b;
@@ -493,7 +494,9 @@ osmesa_find_buffer(enum pipe_format color_format,
for (b = BufferList; b; b = b->next) {
if (b->visual.color_format == color_format &&
b->visual.depth_stencil_format == ds_format &&
- b->visual.accum_format == accum_format) {
+ b->visual.accum_format == accum_format &&
+ b->width == width &&
+ b->height == height) {
return b;
}
}
@@ -673,7 +676,7 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
/* See if we already have a buffer that uses these pixel formats */
osbuffer = osmesa_find_buffer(color_format,
osmesa->depth_stencil_format,
- osmesa->accum_format);
+ osmesa->accum_format, width, height);
if (!osbuffer) {
/* Existing buffer found, create new buffer */
osbuffer = osmesa_create_buffer(color_format,