summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-03-08 11:43:20 -0700
committerBrian Paul <brianp@vmware.com>2010-03-08 11:43:20 -0700
commite5923a1240d8b32f5af080b0b4191d3b9299a630 (patch)
treeb186ab69c91eeb1be91c9f3705db82fead819728 /src
parent39ab5ae30c303dd561252cb592d4de35814b6a70 (diff)
parente1762fb870f86afc4f6bd000b4a1c059d161f10d (diff)
Merge branch '7.8'
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c7
-rw-r--r--src/gallium/state_trackers/vega/paint.c3
-rw-r--r--src/mesa/drivers/dri/r600/r600_context.c1
-rw-r--r--src/mesa/main/texrender.c97
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c5
6 files changed, 94 insertions, 23 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index bc2f307c33..9058f76c1d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -538,6 +538,9 @@ lp_build_sample_wrap_linear(struct lp_build_sample_context *bld,
default:
assert(0);
+ coord0 = NULL;
+ coord1 = NULL;
+ weight = NULL;
}
*x0_out = coord0;
@@ -700,6 +703,7 @@ lp_build_sample_wrap_nearest(struct lp_build_sample_context *bld,
default:
assert(0);
+ icoord = NULL;
}
return icoord;
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 3b30954ac8..aedfdf1b46 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -299,13 +299,14 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc)
x, y, TILE_SIZE, TILE_SIZE,
tc->tile.data.color32, 0/*STRIDE*/);
- /* do this? */
- clear_clear_flag(tc->clear_flags, addr);
-
numCleared++;
}
}
}
+
+ /* reset all clear flags to zero */
+ memset(tc->clear_flags, 0, sizeof(tc->clear_flags));
+
#if 0
debug_printf("num cleared: %u\n", numCleared);
#endif
diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c
index caf0c14b74..cdb87d3bf6 100644
--- a/src/gallium/state_trackers/vega/paint.c
+++ b/src/gallium/state_trackers/vega/paint.c
@@ -639,9 +639,6 @@ VGint paint_bind_samplers(struct vg_paint *paint, struct pipe_sampler_state **sa
}
break;
default:
- samplers[0] = &paint->pattern.sampler; /* dummy */
- textures[0] = 0;
- return 0;
break;
}
return 0;
diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c
index 3d6802e735..134e97e7c3 100644
--- a/src/mesa/drivers/dri/r600/r600_context.c
+++ b/src/mesa/drivers/dri/r600/r600_context.c
@@ -140,6 +140,7 @@ static const struct dri_extension card_extensions[] = {
{"GL_NV_blend_square", NULL},
{"GL_NV_vertex_program", GL_NV_vertex_program_functions},
{"GL_SGIS_generate_mipmap", NULL},
+ {"GL_ARB_pixel_buffer_object", NULL},
{NULL, NULL}
/* *INDENT-ON* */
};
diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c
index 5a528535c0..d29af5a5b2 100644
--- a/src/mesa/main/texrender.c
+++ b/src/mesa/main/texrender.c
@@ -84,6 +84,14 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, &flt);
+ zValues[i] = (GLuint) (flt * 0xffffff);
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_get_row");
}
@@ -139,6 +147,15 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
zValues[i] = ((GLuint) (flt * 0xffffff)) << 8;
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ GLuint *zValues = (GLuint *) values;
+ for (i = 0; i < count; i++) {
+ GLfloat flt;
+ trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset,
+ z, &flt);
+ zValues[i] = (GLuint) (flt * 0xffffff);
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_get_values");
}
@@ -193,6 +210,15 @@ texture_put_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
}
@@ -246,6 +272,15 @@ texture_put_row_rgb(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_put_row");
}
@@ -296,6 +331,15 @@ texture_put_mono_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint zValue = *((const GLuint *) value);
+ const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff));
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x + i, y, z, &flt);
+ }
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_row");
}
@@ -346,6 +390,15 @@ texture_put_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint *zValues = (const GLuint *) values;
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ GLfloat flt = (GLfloat) ((zValues[i] & 0xffffff) * (1.0 / 0xffffff));
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
+ }
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_put_values");
}
@@ -395,6 +448,15 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb,
}
}
}
+ else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) {
+ const GLuint zValue = *((const GLuint *) value);
+ const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff));
+ for (i = 0; i < count; i++) {
+ if (!mask || mask[i]) {
+ trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt);
+ }
+ }
+ }
else {
_mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_values");
}
@@ -491,24 +553,35 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att)
trb->Base.Width = trb->TexImage->Width;
trb->Base.Height = trb->TexImage->Height;
trb->Base.InternalFormat = trb->TexImage->InternalFormat;
+ trb->Base.Format = trb->TexImage->TexFormat;
+
/* XXX may need more special cases here */
- if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) {
- trb->Base.Format = MESA_FORMAT_Z24_S8;
+ switch (trb->TexImage->TexFormat) {
+ case MESA_FORMAT_Z24_S8:
trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
trb->Base._BaseFormat = GL_DEPTH_STENCIL;
- }
- else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) {
- trb->Base.Format = MESA_FORMAT_Z16;
- trb->Base.DataType = GL_UNSIGNED_SHORT;
+ break;
+ case MESA_FORMAT_S8_Z24:
+ trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA;
trb->Base._BaseFormat = GL_DEPTH_STENCIL;
- }
- else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) {
- trb->Base.Format = MESA_FORMAT_Z32;
+ break;
+ case MESA_FORMAT_Z24_X8:
+ trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ case MESA_FORMAT_X8_Z24:
+ trb->Base.DataType = GL_UNSIGNED_INT_8_24_REV_MESA;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ case MESA_FORMAT_Z16:
+ trb->Base.DataType = GL_UNSIGNED_SHORT;
+ trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
+ break;
+ case MESA_FORMAT_Z32:
trb->Base.DataType = GL_UNSIGNED_INT;
trb->Base._BaseFormat = GL_DEPTH_COMPONENT;
- }
- else {
- trb->Base.Format = trb->TexImage->TexFormat;
+ break;
+ default:
trb->Base.DataType = CHAN_TYPE;
trb->Base._BaseFormat = GL_RGBA;
}
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 8fded0c69f..00e9d1dccb 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -410,17 +410,12 @@ st_finish_render_texture(GLcontext *ctx,
st_flush( ctx->st, PIPE_FLUSH_RENDER_CACHE, NULL );
- if (strb->surface)
- pipe_surface_reference( &strb->surface, NULL );
-
strb->rtt = NULL;
/*
printf("FINISH RENDER TO TEXTURE surf=%p\n", strb->surface);
*/
- _mesa_reference_renderbuffer(&att->Renderbuffer, NULL);
-
/* restore previous framebuffer state */
st_invalidate_state(ctx, _NEW_BUFFERS);
}