radv: Handle VK_REMAINING_ARRAY_LAYERS in fast clear eliminate.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 19 Feb 2017 13:00:25 +0000 (14:00 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Sun, 19 Feb 2017 19:58:06 +0000 (20:58 +0100)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_meta_fast_clear.c

index 0902c4550375e6a236c0b571e18011c3b5f0dd44..ffaa9a3d5e82ea827398f9fe759f48a006cd4ecf 100644 (file)
@@ -419,13 +419,13 @@ radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer,
        struct radv_meta_saved_pass_state saved_pass_state;
        VkDevice device_h = radv_device_to_handle(cmd_buffer->device);
        VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
+       uint32_t layer_count = radv_get_layerCount(image, subresourceRange);
 
        assert(cmd_buffer->queue_family_index == RADV_QUEUE_GENERAL);
        radv_meta_save_pass(&saved_pass_state, cmd_buffer);
        radv_meta_save_graphics_reset_vport_scissor(&saved_state, cmd_buffer);
 
-       for (uint32_t layer = 0; layer < subresourceRange->layerCount;
-            ++layer) {
+       for (uint32_t layer = 0; layer < layer_count; ++layer) {
                struct radv_image_view iview;
 
                radv_image_view_init(&iview, cmd_buffer->device,