summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_framebuffer.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-05-01 10:15:21 -0600
committerBrian Paul <[email protected]>2009-05-01 10:19:00 -0600
commitcd6734288ddc15a778def9578e128184b3f6bdea (patch)
treead8744162b68930ef508a4d08f63a5ca82d08c88 /src/mesa/state_tracker/st_framebuffer.c
parentb9196c1fa39dd566c5d7ab340e353b77714edb5f (diff)
st: when double buffered, only create front color buffer on demand
Before we always created the front color buffer, even if was never used. This can save some memory.
Diffstat (limited to 'src/mesa/state_tracker/st_framebuffer.c')
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index daaad65ccaf..6ad64739bd8 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -58,19 +58,19 @@ st_create_framebuffer( const __GLcontextModes *visual,
_mesa_initialize_framebuffer(&stfb->Base, visual);
- {
- /* fake frontbuffer */
- /* XXX allocation should only happen in the unusual case
- it's actually needed */
+ if (visual->doubleBufferMode) {
struct gl_renderbuffer *rb
= st_new_renderbuffer_fb(colorFormat, samples);
- _mesa_add_renderbuffer(&stfb->Base, BUFFER_FRONT_LEFT, rb);
+ _mesa_add_renderbuffer(&stfb->Base, BUFFER_BACK_LEFT, rb);
}
-
- if (visual->doubleBufferMode) {
+ else {
+ /* Only allocate front buffer right now if we're single buffered.
+ * If double-buffered, allocate front buffer on demand later.
+ * See check_create_front_buffers().
+ */
struct gl_renderbuffer *rb
= st_new_renderbuffer_fb(colorFormat, samples);
- _mesa_add_renderbuffer(&stfb->Base, BUFFER_BACK_LEFT, rb);
+ _mesa_add_renderbuffer(&stfb->Base, BUFFER_FRONT_LEFT, rb);
}
if (depthFormat == stencilFormat && depthFormat != PIPE_FORMAT_NONE) {