radv: Fix fragment resolve destination offset.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 26 Dec 2017 15:11:35 +0000 (16:11 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 27 Dec 2017 23:26:07 +0000 (00:26 +0100)
The position start at (dst.x, dst.y), so if we want the source to
start at (src.x, src.y), we have to offset by (src.x-dst.x,src.y-dst.y).

Haven't tested that this fixed anything yet, but found by inspection.

Fixes: 69136f4e633 "radv/meta: add resolve pass using fragment/vertex shaders"
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_meta_resolve_fs.c

index 756309efd2e453b663c7f0da8620f0ed705fd69e..b937c12ec11bb20df55a6338f277e40fa5015bc7 100644 (file)
@@ -407,8 +407,8 @@ emit_resolve(struct radv_cmd_buffer *cmd_buffer,
        cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB;
 
        unsigned push_constants[2] = {
-               src_offset->x,
-               src_offset->y,
+               src_offset->x - dest_offset->x,
+               src_offset->y - dest_offset->y,
        };
        radv_CmdPushConstants(radv_cmd_buffer_to_handle(cmd_buffer),
                              device->meta_state.resolve_fragment.p_layout,