radv: make sure to init the DCC decompress compute path state
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Thu, 13 Jun 2019 10:44:03 +0000 (12:44 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 17 Jun 2019 09:30:49 +0000 (11:30 +0200)
This fixes a segfault when forcing DCC decompressions on compute
because internal meta objects are not created since the on-demand
stuff.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-By: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_fast_clear.c

index 8f97c1a8f157175d190166d23b7297c7143e66de..176f9803b456024cf723310dc8efbecf720f2d96 100644 (file)
@@ -753,6 +753,14 @@ radv_decompress_dcc_compute(struct radv_cmd_buffer *cmd_buffer,
        state->flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB |
                             RADV_CMD_FLAG_FLUSH_AND_INV_CB_META;
 
+       if (!cmd_buffer->device->meta_state.fast_clear_flush.cmask_eliminate_pipeline) {
+               VkResult ret = radv_device_init_meta_fast_clear_flush_state_internal(cmd_buffer->device);
+               if (ret != VK_SUCCESS) {
+                       cmd_buffer->record_result = ret;
+                       return;
+               }
+       }
+
        radv_meta_save(&saved_state, cmd_buffer, RADV_META_SAVE_DESCRIPTORS |
                                                 RADV_META_SAVE_COMPUTE_PIPELINE);