summaryrefslogtreecommitdiffstats
path: root/src/amd
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-03-06 23:31:48 +0000
committerDave Airlie <[email protected]>2017-03-07 04:01:53 +0000
commitc5947e9787c700239da329fb4c373a5c6b4f35da (patch)
tree8bd74b775036d9bc78997f11b4f267401205b71a /src/amd
parent0ab2dd361fd80c3840b1547cb7e05b4361eaf928 (diff)
radv: move fast clear before resolve into own loop.
Don't fast clear inside the meta loop as things get confused, fixes a crash in: dEQP-VK.api.copy_and_blit.resolve_image.whole_array_image.2_bit Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r--src/amd/vulkan/radv_meta_resolve_cs.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve_cs.c b/src/amd/vulkan/radv_meta_resolve_cs.c
index 9cb4ce81094..3272d1f09d3 100644
--- a/src/amd/vulkan/radv_meta_resolve_cs.c
+++ b/src/amd/vulkan/radv_meta_resolve_cs.c
@@ -326,6 +326,21 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
struct radv_meta_saved_compute_state saved_state;
const uint32_t samples = src_image->samples;
const uint32_t samples_log2 = ffs(samples) - 1;
+
+ for (uint32_t r = 0; r < region_count; ++r) {
+ const VkImageResolve *region = &regions[r];
+ const uint32_t src_base_layer =
+ radv_meta_get_iview_layer(src_image, &region->srcSubresource,
+ &region->srcOffset);
+ VkImageSubresourceRange range;
+ range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
+ range.baseMipLevel = region->srcSubresource.mipLevel;
+ range.levelCount = 1;
+ range.baseArrayLayer = src_base_layer;
+ range.layerCount = region->srcSubresource.layerCount;
+ radv_fast_clear_flush_image_inplace(cmd_buffer, src_image, &range);
+ }
+
radv_meta_save_compute(&saved_state, cmd_buffer, 16);
for (uint32_t r = 0; r < region_count; ++r) {
@@ -350,14 +365,6 @@ void radv_meta_resolve_compute_image(struct radv_cmd_buffer *cmd_buffer,
const struct VkOffset3D dstOffset =
radv_sanitize_image_offset(dest_image->type, region->dstOffset);
- VkImageSubresourceRange range;
- range.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
- range.baseMipLevel = region->srcSubresource.mipLevel;
- range.levelCount = 1;
- range.baseArrayLayer = src_base_layer;
- range.layerCount = region->srcSubresource.layerCount;
- radv_fast_clear_flush_image_inplace(cmd_buffer, src_image, &range);
-
for (uint32_t layer = 0; layer < region->srcSubresource.layerCount;
++layer) {