summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-05-11 16:27:50 -0600
committerBrian Paul <brianp@vmware.com>2009-05-11 16:27:50 -0600
commite7cb125b2d9e9c7b1ad89b988fa3bf53ead9eb0c (patch)
treeb47a363853d2ed59184c3b9eb72ccb30d00cbebf /src
parent783e43064b64feb87e0457f96c2275160389f84c (diff)
parentf104e4d666dfccda6f5ad817693216733ddede44 (diff)
Merge branch 'mesa_7_5_branch'
Conflicts: Makefile src/mesa/main/version.h
Diffstat (limited to 'src')
-rw-r--r--src/gallium/state_trackers/wgl/shared/stw_device.h2
-rw-r--r--src/gallium/winsys/drm/intel/dri/Makefile4
-rw-r--r--src/mesa/state_tracker/st_atom_framebuffer.c16
-rw-r--r--src/mesa/state_tracker/st_context.c7
4 files changed, 20 insertions, 9 deletions
diff --git a/src/gallium/state_trackers/wgl/shared/stw_device.h b/src/gallium/state_trackers/wgl/shared/stw_device.h
index 969e3843e7..e097f1f71e 100644
--- a/src/gallium/state_trackers/wgl/shared/stw_device.h
+++ b/src/gallium/state_trackers/wgl/shared/stw_device.h
@@ -37,7 +37,7 @@
#include "stw_pixelformat.h"
-#define STW_MAX_PIXELFORMATS 128
+#define STW_MAX_PIXELFORMATS 256
struct pipe_screen;
diff --git a/src/gallium/winsys/drm/intel/dri/Makefile b/src/gallium/winsys/drm/intel/dri/Makefile
index a4704bc050..ac0891a646 100644
--- a/src/gallium/winsys/drm/intel/dri/Makefile
+++ b/src/gallium/winsys/drm/intel/dri/Makefile
@@ -21,5 +21,5 @@ include ../../Makefile.template
DRI_LIB_DEPS += -ldrm_intel
symlinks: $(TOP)/$(LIB_DIR)/gallium
- @rm -f $(TOP)/lib/gallium/i965_dri.so
- ln -s i915_dri.so $(TOP)/lib/gallium/i965_dri.so
+ @rm -f $(TOP)/$(LIB_DIR)/gallium/i965_dri.so
+ ln -s i915_dri.so $(TOP)/$(LIB_DIR)/gallium/i965_dri.so
diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c
index f23186c73d..4d897b677e 100644
--- a/src/mesa/state_tracker/st_atom_framebuffer.c
+++ b/src/mesa/state_tracker/st_atom_framebuffer.c
@@ -98,8 +98,6 @@ update_framebuffer_state( struct st_context *st )
struct st_renderbuffer *strb;
GLuint i;
- memset(framebuffer, 0, sizeof(*framebuffer));
-
framebuffer->width = fb->Width;
framebuffer->height = fb->Height;
@@ -120,13 +118,20 @@ update_framebuffer_state( struct st_context *st )
}
if (strb->surface) {
- framebuffer->cbufs[framebuffer->nr_cbufs] = strb->surface;
+ pipe_surface_reference(&framebuffer->cbufs[framebuffer->nr_cbufs],
+ strb->surface);
framebuffer->nr_cbufs++;
}
strb->defined = GL_TRUE; /* we'll be drawing something */
}
}
+ for (i = framebuffer->nr_cbufs; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&framebuffer->cbufs[i], NULL);
+ }
+ /*
+ * Depth/Stencil renderbuffer/surface.
+ */
strb = st_renderbuffer(fb->Attachment[BUFFER_DEPTH].Renderbuffer);
if (strb) {
strb = st_renderbuffer(strb->Base.Wrapped);
@@ -134,15 +139,14 @@ update_framebuffer_state( struct st_context *st )
/* rendering to a GL texture, may have to update surface */
update_renderbuffer_surface(st, strb);
}
-
- framebuffer->zsbuf = strb->surface;
+ pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
}
else {
strb = st_renderbuffer(fb->Attachment[BUFFER_STENCIL].Renderbuffer);
if (strb) {
strb = st_renderbuffer(strb->Base.Wrapped);
assert(strb->surface);
- framebuffer->zsbuf = strb->surface;
+ pipe_surface_reference(&framebuffer->zsbuf, strb->surface);
}
}
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 2a1f21c51c..e536029e86 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -233,6 +233,7 @@ void st_destroy_context( struct st_context *st )
struct pipe_context *pipe = st->pipe;
struct cso_context *cso = st->cso_context;
GLcontext *ctx = st->ctx;
+ GLuint i;
/* need to unbind and destroy CSO objects before anything else */
cso_release_all(st->cso_context);
@@ -240,6 +241,12 @@ void st_destroy_context( struct st_context *st )
st_reference_fragprog(st, &st->fp, NULL);
st_reference_vertprog(st, &st->vp, NULL);
+ /* release framebuffer surfaces */
+ for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
+ pipe_surface_reference(&st->state.framebuffer.cbufs[i], NULL);
+ }
+ pipe_surface_reference(&st->state.framebuffer.zsbuf, NULL);
+
_mesa_delete_program_cache(st->ctx, st->pixel_xfer.cache);
_vbo_DestroyContext(st->ctx);