summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-05-18 16:17:50 -0600
committerBrian Paul <brian.paul@tungstengraphics.com>2008-05-18 16:17:50 -0600
commit54fbd8bbd4e5a484d59907bae852908e3a8b8f3c (patch)
tree2e45fac3c2505fe1131ed38e45110e1319f49806 /src/mesa/state_tracker
parentb4219e35e2de783ca03e53c311a8a56f8b633aa1 (diff)
parenta0bfeb0c3ca58a1f4d978f2aaa343ed4009de079 (diff)
Merge branch 'gallium-0.1' into gallium-tex-surfaces
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c4
-rw-r--r--src/mesa/state_tracker/st_cb_readpixels.c2
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c13
-rw-r--r--src/mesa/state_tracker/st_context.c4
-rw-r--r--src/mesa/state_tracker/st_format.c4
5 files changed, 14 insertions, 13 deletions
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 43e00e6acc..4fede7a900 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -781,7 +781,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
}
switch (ps->format) {
- case PIPE_FORMAT_U_S8:
+ case PIPE_FORMAT_S8_UNORM:
{
ubyte *dest = stmap + spanY * ps->pitch + spanX;
memcpy(dest, values, spanWidth);
@@ -930,7 +930,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy,
}
}
break;
- case PIPE_FORMAT_U_S8:
+ case PIPE_FORMAT_S8_UNORM:
memcpy(dst, src, width);
break;
default:
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 3615fafc0a..08934af319 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -92,7 +92,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y,
/* get stencil values */
switch (ps->format) {
- case PIPE_FORMAT_U_S8:
+ case PIPE_FORMAT_S8_UNORM:
{
const ubyte *src = stmap + srcY * ps->pitch + x;
memcpy(values, src, width);
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index fb78c87989..e15ccec89b 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -151,7 +151,7 @@ st_DeleteTextureObject(GLcontext *ctx,
{
struct st_texture_object *stObj = st_texture_object(texObj);
if (stObj->pt)
- pipe_texture_release(&stObj->pt);
+ pipe_texture_reference(&stObj->pt, NULL);
_mesa_delete_texture_object(ctx, texObj);
}
@@ -165,7 +165,7 @@ st_FreeTextureImageData(GLcontext * ctx, struct gl_texture_image *texImage)
DBG("%s\n", __FUNCTION__);
if (stImage->pt) {
- pipe_texture_release(&stImage->pt);
+ pipe_texture_reference(&stImage->pt, NULL);
}
if (texImage->Data) {
@@ -554,7 +554,7 @@ st_TexImage(GLcontext * ctx,
* Release any old malloced memory.
*/
if (stImage->pt) {
- pipe_texture_release(&stImage->pt);
+ pipe_texture_reference(&stImage->pt, NULL);
assert(!texImage->Data);
}
else if (texImage->Data) {
@@ -574,7 +574,7 @@ st_TexImage(GLcontext * ctx,
stImage->face, stImage->level)))) {
DBG("release it\n");
- pipe_texture_release(&stObj->pt);
+ pipe_texture_reference(&stObj->pt, NULL);
assert(!stObj->pt);
stObj->teximage_realloc = FALSE;
}
@@ -1417,7 +1417,7 @@ copy_image_data_to_texture(struct st_context *st,
stImage->face
);
- pipe_texture_release(&stImage->pt);
+ pipe_texture_reference(&stImage->pt, NULL);
}
else if (stImage->base.Data) {
assert(stImage->base.Data != NULL);
@@ -1478,9 +1478,6 @@ st_finalize_texture(GLcontext *ctx,
firstImage->pt != stObj->pt &&
firstImage->pt->last_level >= stObj->lastLevel) {
- if (stObj->pt)
- pipe_texture_release(&stObj->pt);
-
pipe_texture_reference(&stObj->pt, firstImage->pt);
}
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index 8db55a179f..fb397ea510 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -171,6 +171,10 @@ static void st_destroy_context_priv( struct st_context *st )
_vbo_DestroyContext(st->ctx);
+ for (i = 0; i < Elements(st->state.sampler_texture); i++) {
+ pipe_texture_reference(&st->state.sampler_texture[i], NULL);
+ }
+
for (i = 0; i < Elements(st->state.constants); i++) {
if (st->state.constants[i].buffer) {
pipe_reference_buffer(st->pipe, &st->state.constants[i].buffer, NULL);
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 9a385a0457..17a3cfd5a4 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -503,8 +503,8 @@ st_choose_format(struct pipe_context *pipe, GLint internalFormat,
case GL_STENCIL_INDEX4_EXT:
case GL_STENCIL_INDEX8_EXT:
case GL_STENCIL_INDEX16_EXT:
- if (screen->is_format_supported( screen, PIPE_FORMAT_U_S8, surfType ))
- return PIPE_FORMAT_U_S8;
+ if (screen->is_format_supported( screen, PIPE_FORMAT_S8_UNORM, surfType ))
+ return PIPE_FORMAT_S8_UNORM;
if (screen->is_format_supported( screen, PIPE_FORMAT_S8Z24_UNORM, surfType ))
return PIPE_FORMAT_S8Z24_UNORM;
if (screen->is_format_supported( screen, PIPE_FORMAT_Z24S8_UNORM, surfType ))