summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-03-19 17:23:44 +0100
committerMichel Dänzer <michel@tungstengraphics.com>2007-03-19 17:23:44 +0100
commit9b42100c04f14b4f2c1e5fe9748bb0519ed6c516 (patch)
tree9751fda8834652f893034fc30cf5e8eeaa96f3bf /src/mesa
parent77544d7b7d7c6fd03c0df81dca07f1bb3a67c119 (diff)
i915tex: Fix triple buffering after recent Mesa core changes.
Remove superfluous _mesa_resize_framebuffer call which is now harmful because it causes the third renderbuffer to have width/height 0, so Mesa refuses to render to it. In the long term, it would be nice to remove the hack in intel_alloc_window_storage in favour of a proper Mesa interface for flipping between more than two colour buffers.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_buffers.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_buffers.c b/src/mesa/drivers/dri/i915tex/intel_buffers.c
index 62ff54b007..c0b4f438be 100644
--- a/src/mesa/drivers/dri/i915tex/intel_buffers.c
+++ b/src/mesa/drivers/dri/i915tex/intel_buffers.c
@@ -349,6 +349,28 @@ intelWindowMoved(struct intel_context *intel)
/* Update Mesa's notion of window size */
driUpdateFramebufferSize(ctx, dPriv);
+
+ /* Update size of third renderbuffer */
+ if (intel_fb->pf_num_pages == 3) {
+ struct gl_renderbuffer *rb = &intel_fb->color_rb[(intel_fb->pf_current_page
+ + 2) % 3]->Base;
+
+ /* only resize if size is changing */
+ if (rb->Width != intel_fb->Base.Width ||
+ rb->Height != intel_fb->Base.Height) {
+ /* could just as well pass rb->_ActualFormat here */
+ if (rb->AllocStorage(ctx, rb, rb->InternalFormat,
+ intel_fb->Base.Width, intel_fb->Base.Height)) {
+ ASSERT(rb->Width == intel_fb->Base.Width);
+ ASSERT(rb->Height == intel_fb->Base.Height);
+ }
+ else {
+ _mesa_error(ctx, GL_OUT_OF_MEMORY, "Resizing framebuffer");
+ /* no return */
+ }
+ }
+ }
+
intel_fb->Base.Initialized = GL_TRUE; /* XXX remove someday */
/* Update hardware scissor */