From 36efb86c0570d86d8dfce87fd2416125e0e91b40 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Sat, 21 Aug 2010 22:49:22 -0400 Subject: 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 --- src/gallium/drivers/r600/r600_blit.c | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'src/gallium/drivers/r600/r600_blit.c') 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) -- cgit v1.2.3