summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/r600/r600_blit.c
diff options
context:
space:
mode:
authorJerome Glisse <[email protected]>2010-08-21 22:49:22 -0400
committerJerome Glisse <[email protected]>2010-08-21 22:52:38 -0400
commit36efb86c0570d86d8dfce87fd2416125e0e91b40 (patch)
tree127f6694d20d068d819682e82f96d9ec59685cf3 /src/gallium/drivers/r600/r600_blit.c
parentae34a6393e6519dc32e53fa8407155e8679fc257 (diff)
r600g: partialy fix texturing from depth buffer + initial support for untiling
Partialy fix texturing from depth buffer, depth buffer is tiled following different tile organisation that color buffer. This properly set the tile type & array mode field of texture sampler when sampling from db resource. Add initial support to untiling buffer when transfering them, it's kind of broken by corruption the vertex buffer of previous draw. Signed-off-by: Jerome Glisse <[email protected]>
Diffstat (limited to 'src/gallium/drivers/r600/r600_blit.c')
-rw-r--r--src/gallium/drivers/r600/r600_blit.c27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/gallium/drivers/r600/r600_blit.c b/src/gallium/drivers/r600/r600_blit.c
index aef4fbd9af9..dc57b333a03 100644
--- a/src/gallium/drivers/r600/r600_blit.c
+++ b/src/gallium/drivers/r600/r600_blit.c
@@ -120,7 +120,8 @@ static void r600_clear_depth_stencil(struct pipe_context *ctx,
r600_queries_resume(ctx);
}
-static void r600_resource_copy_region(struct pipe_context *pipe,
+
+static void r600_resource_copy_region(struct pipe_context *ctx,
struct pipe_resource *dst,
struct pipe_subresource subdst,
unsigned dstx, unsigned dsty, unsigned dstz,
@@ -129,8 +130,28 @@ static void r600_resource_copy_region(struct pipe_context *pipe,
unsigned srcx, unsigned srcy, unsigned srcz,
unsigned width, unsigned height)
{
- util_resource_copy_region(pipe, dst, subdst, dstx, dsty, dstz,
- src, subsrc, srcx, srcy, srcz, width, height);
+ struct r600_context *rctx = r600_context(ctx);
+ struct pipe_framebuffer_state *fb = &rctx->framebuffer->state.framebuffer;
+ struct pipe_sampler_state *samplers[PIPE_MAX_ATTRIBS];
+ struct pipe_sampler_view_state *sampler_views[PIPE_MAX_ATTRIBS];
+ unsigned i;
+
+ for (i = 0; i < rctx->ps_nsampler_view; i++) {
+ sampler_views[i] = &rctx->ps_sampler_view[i]->state.sampler_view;
+ }
+ for (i = 0; i < rctx->ps_nsampler; i++) {
+ samplers[i] = &rctx->ps_sampler[i]->state.sampler;
+ }
+ r600_blitter_save_states(ctx);
+ util_blitter_save_framebuffer(rctx->blitter, fb);
+ util_blitter_save_fragment_sampler_states(rctx->blitter, rctx->ps_nsampler, samplers);
+ util_blitter_save_fragment_sampler_views(rctx->blitter, rctx->ps_nsampler_view, sampler_views);
+
+ util_blitter_copy_region(rctx->blitter, dst, subdst, dstx, dsty, dstz,
+ src, subsrc, srcx, srcy, srcz, width, height,
+ TRUE);
+ /* resume queries */
+ r600_queries_resume(ctx);
}
void r600_init_blit_functions(struct r600_context *rctx)