radv: call nir_split_var_copies() before nir_lower_var_copies()
[mesa.git] / src / amd / vulkan / radv_meta_decompress.c
index b86f3925cf7f4c6a964e9b4aeb09e7c82b045b93..1a8058c7cc53d8333a1da73032d5d330dec7f002 100644 (file)
@@ -75,11 +75,29 @@ create_pass(struct radv_device *device,
        return result;
 }
 
+static VkResult
+create_pipeline_layout(struct radv_device *device, VkPipelineLayout *layout)
+{
+       VkPipelineLayoutCreateInfo pl_create_info = {
+               .sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO,
+               .setLayoutCount = 0,
+               .pSetLayouts = NULL,
+               .pushConstantRangeCount = 0,
+               .pPushConstantRanges = NULL,
+       };
+
+       return radv_CreatePipelineLayout(radv_device_to_handle(device),
+                                        &pl_create_info,
+                                        &device->meta_state.alloc,
+                                        layout);
+}
+
 static VkResult
 create_pipeline(struct radv_device *device,
                 VkShaderModule vs_module_h,
                uint32_t samples,
                VkRenderPass pass,
+               VkPipelineLayout layout,
                VkPipeline *decompress_pipeline,
                VkPipeline *resummarize_pipeline)
 {
@@ -165,6 +183,7 @@ create_pipeline(struct radv_device *device,
                                VK_DYNAMIC_STATE_SCISSOR,
                        },
                },
+               .layout = layout,
                .renderPass = pass,
                .subpass = 0,
        };
@@ -212,6 +231,9 @@ radv_device_finish_meta_depth_decomp_state(struct radv_device *device)
                radv_DestroyRenderPass(radv_device_to_handle(device),
                                       state->depth_decomp[i].pass,
                                       &state->alloc);
+               radv_DestroyPipelineLayout(radv_device_to_handle(device),
+                                          state->depth_decomp[i].p_layout,
+                                          &state->alloc);
                radv_DestroyPipeline(radv_device_to_handle(device),
                                     state->depth_decomp[i].decompress_pipeline,
                                     &state->alloc);
@@ -243,8 +265,14 @@ radv_device_init_meta_depth_decomp_state(struct radv_device *device)
                if (res != VK_SUCCESS)
                        goto fail;
 
+               res = create_pipeline_layout(device,
+                                            &state->depth_decomp[i].p_layout);
+               if (res != VK_SUCCESS)
+                       goto fail;
+
                res = create_pipeline(device, vs_module_h, samples,
                                      state->depth_decomp[i].pass,
+                                     state->depth_decomp[i].p_layout,
                                      &state->depth_decomp[i].decompress_pipeline,
                                      &state->depth_decomp[i].resummarize_pipeline);
                if (res != VK_SUCCESS)
@@ -312,7 +340,7 @@ static void radv_process_depth_image_inplace(struct radv_cmd_buffer *cmd_buffer,
        struct radv_meta_state *meta_state = &cmd_buffer->device->meta_state;
        VkPipeline pipeline_h;
 
-       if (!image->surface.htile_size)
+       if (!radv_image_has_htile(image))
                return;
 
        radv_meta_save(&saved_state, cmd_buffer,