summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBen Skeggs <skeggsb@gmail.com>2008-03-02 02:35:17 +1100
committerBen Skeggs <skeggsb@gmail.com>2008-03-02 02:35:17 +1100
commit132def0c4182b8d2251e9d6e2b5b470cb806713c (patch)
tree8609fed67628e3ebf0d0af4a05982ff7cc211be1 /src/mesa
parent17f6db9d0197657cd753249ef60355c6fd983032 (diff)
parent07d6347e8a51fc7bbd5c586a5739f17c68c5eafd (diff)
Merge branch 'upstream-gallium-0.1' into nouveau-gallium-0.1
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c12
-rw-r--r--src/mesa/state_tracker/st_cb_drawpixels.c12
-rw-r--r--src/mesa/state_tracker/st_context.h2
-rw-r--r--src/mesa/state_tracker/st_gen_mipmap.c3
4 files changed, 17 insertions, 12 deletions
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index a4ac726816..697d2cdfb4 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -55,6 +55,7 @@ update_textures(struct st_context *st)
const GLuint su = fprog->Base.SamplerUnits[unit];
struct gl_texture_object *texObj = st->ctx->Texture.Unit[su]._Current;
struct st_texture_object *stObj = st_texture_object(texObj);
+ struct pipe_texture *pt;
if (texObj) {
GLboolean flush, retval;
@@ -67,16 +68,15 @@ update_textures(struct st_context *st)
* this table before being deleted, otherwise the pointer
* comparison below could fail.
*/
- if (st->state.sampler_texture[unit] != stObj) {
- struct pipe_texture *pt = st_get_stobj_texture(stObj);
- st->state.sampler_texture[unit] = stObj;
+
+ pt = st_get_stobj_texture(stObj);
+
+ if (st->state.sampler_texture[unit] != pt) {
+ st->state.sampler_texture[unit] = pt;
st->pipe->set_sampler_texture(st->pipe, unit, pt);
}
- stObj = st->state.sampler_texture[unit];
-
if (stObj && stObj->dirtyData) {
- struct pipe_texture *pt = st_get_stobj_texture(stObj);
st->pipe->texture_update(st->pipe, pt);
stObj->dirtyData = GL_FALSE;
}
diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c
index 6c0d75cc55..65c9fda9cb 100644
--- a/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -727,8 +727,7 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z,
pipe->bind_rasterizer_state(pipe, ctx->st->state.rasterizer->data);
pipe->bind_fs_state(pipe, ctx->st->state.fs->data);
pipe->bind_vs_state(pipe, ctx->st->state.vs->cso->data);
- pipe->set_sampler_texture(pipe, unit,
- st_get_stobj_texture(ctx->st->state.sampler_texture[unit]));
+ pipe->set_sampler_texture(pipe, unit, ctx->st->state.sampler_texture[unit]);
pipe->bind_sampler_state(pipe, unit, ctx->st->state.sampler[unit]->data);
pipe->set_viewport_state(pipe, &ctx->st->state.viewport);
}
@@ -1299,7 +1298,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
psRead,
srcx, srcy, width, height);
}
- else {
+ else if (type == GL_COLOR) {
/* alternate path using get/put_tile() */
GLfloat *buf = (GLfloat *) malloc(width * height * 4 * sizeof(GLfloat));
@@ -1308,6 +1307,13 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy,
free(buf);
}
+ else {
+ /* GL_DEPTH */
+ GLuint *buf = (GLuint *) malloc(width * height * sizeof(GLuint));
+ pipe_get_tile_z(pipe, psRead, srcx, srcy, width, height, buf);
+ pipe_put_tile_z(pipe, psTex, 0, 0, width, height, buf);
+ free(buf);
+ }
/* draw textured quad */
draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2],
diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h
index 5be4769be4..1fbf9721e7 100644
--- a/src/mesa/state_tracker/st_context.h
+++ b/src/mesa/state_tracker/st_context.h
@@ -86,7 +86,7 @@ struct st_context
struct pipe_clip_state clip;
struct pipe_constant_buffer constants[2];
struct pipe_framebuffer_state framebuffer;
- struct st_texture_object *sampler_texture[PIPE_MAX_SAMPLERS];
+ struct pipe_texture *sampler_texture[PIPE_MAX_SAMPLERS];
struct pipe_poly_stipple poly_stipple;
struct pipe_scissor_state scissor;
struct pipe_viewport_state viewport;
diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c
index 243dc0b1d0..841d77abbc 100644
--- a/src/mesa/state_tracker/st_gen_mipmap.c
+++ b/src/mesa/state_tracker/st_gen_mipmap.c
@@ -312,8 +312,7 @@ st_render_mipmap(struct st_context *st,
pipe->bind_vs_state(pipe, st->state.vs->cso->data);
if (st->state.sampler[0])
pipe->bind_sampler_state(pipe, 0, st->state.sampler[0]->data);
- pipe->set_sampler_texture(pipe, 0,
- st_get_stobj_texture(st->state.sampler_texture[0]));
+ pipe->set_sampler_texture(pipe, 0, st->state.sampler_texture[0]);
pipe->set_viewport_state(pipe, &st->state.viewport);
return TRUE;