aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorLuca Barbieri <[email protected]>2010-09-04 23:20:33 +0200
committerLuca Barbieri <[email protected]>2010-09-05 02:01:02 +0200
commit9fc50968addcefa3ce699a0ec6ebb8496dc527e1 (patch)
tree5efb5cb60883318f91827b9b42aed0c679bce9e3 /src/gallium
parent6dc71d6aa5262ee3fcb79c713f2d91121db79533 (diff)
nvfx: support using blitter to copy depth/stencil resources, fix Heaven
We might want to copy them as color ones though. Also works around crash in Unigine Heaven due to failing to allocate a 64 MB temporary in GART for a CPU copy. Unigine Heaven now works on nv40, albeit with very heavy glitches (with the floating branch with render_hdr 0).
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/nvfx/nvfx_surface.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/nvfx/nvfx_surface.c b/src/gallium/drivers/nvfx/nvfx_surface.c
index e0c85cc629d..aff7ac54b7f 100644
--- a/src/gallium/drivers/nvfx/nvfx_surface.c
+++ b/src/gallium/drivers/nvfx/nvfx_surface.c
@@ -251,8 +251,15 @@ nvfx_resource_copy_region(struct pipe_context *pipe,
ret = nv04_region_copy_2d(ctx, &dst, &src, w, h, dst_to_gpu, src_on_gpu);
if(!ret)
{}
- else if(ret > 0 && dstr->bind & PIPE_BIND_RENDER_TARGET && srcr->bind & PIPE_BIND_SAMPLER_VIEW)
+ else if(ret > 0
+ && dstr->bind & (PIPE_BIND_RENDER_TARGET | PIPE_BIND_DEPTH_STENCIL)
+ && srcr->bind & PIPE_BIND_SAMPLER_VIEW)
{
+ /* this currently works because we hack the bind flags on resource creation to be
+ * the maximum set that the resource type actually supports
+ *
+ * TODO: perhaps support reinterpreting the formats
+ */
struct blitter_context* blitter = nvfx_get_blitter(pipe, 1);
util_blitter_copy_region(blitter, dstr, subdst, dstx, dsty, dstz, srcr, subsrc, srcx, srcy, srcz, w, h, TRUE);
nvfx_put_blitter(pipe, blitter);