radv/meta: rework creating DCC decompress compute pipelines
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30244>
This commit is contained in:

committed by
Marge Bot

parent
792665bbee
commit
e5f3d8d24e
@@ -96,6 +96,26 @@ cleanup:
|
||||
return result;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
get_dcc_decompress_compute_pipeline(struct radv_device *device, VkPipeline *pipeline_out)
|
||||
{
|
||||
struct radv_meta_state *state = &device->meta_state;
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
mtx_lock(&state->mtx);
|
||||
if (!state->fast_clear_flush.dcc_decompress_compute_pipeline) {
|
||||
result = create_dcc_compress_compute(device);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
*pipeline_out = state->fast_clear_flush.dcc_decompress_compute_pipeline;
|
||||
|
||||
fail:
|
||||
mtx_unlock(&state->mtx);
|
||||
return result;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
create_pipeline(struct radv_device *device, VkShaderModule vs_module_h, VkPipelineLayout layout)
|
||||
{
|
||||
@@ -633,22 +653,21 @@ radv_decompress_dcc_compute(struct radv_cmd_buffer *cmd_buffer, struct radv_imag
|
||||
struct radv_meta_saved_state saved_state;
|
||||
struct radv_image_view load_iview = {0};
|
||||
struct radv_image_view store_iview = {0};
|
||||
VkPipeline pipeline;
|
||||
VkResult result;
|
||||
|
||||
result = get_dcc_decompress_compute_pipeline(device, &pipeline);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_command_buffer_set_error(&cmd_buffer->vk, result);
|
||||
return;
|
||||
}
|
||||
|
||||
cmd_buffer->state.flush_bits |=
|
||||
radv_dst_access_flush(cmd_buffer, VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT, VK_ACCESS_2_SHADER_READ_BIT, image);
|
||||
|
||||
if (!device->meta_state.fast_clear_flush.cmask_eliminate_pipeline) {
|
||||
VkResult ret = radv_device_init_meta_fast_clear_flush_state_internal(device);
|
||||
if (ret != VK_SUCCESS) {
|
||||
vk_command_buffer_set_error(&cmd_buffer->vk, ret);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
radv_meta_save(&saved_state, cmd_buffer, RADV_META_SAVE_DESCRIPTORS | RADV_META_SAVE_COMPUTE_PIPELINE);
|
||||
|
||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE,
|
||||
device->meta_state.fast_clear_flush.dcc_decompress_compute_pipeline);
|
||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer), VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
||||
|
||||
for (uint32_t l = 0; l < vk_image_subresource_level_count(&image->vk, subresourceRange); l++) {
|
||||
uint32_t width, height;
|
||||
|
Reference in New Issue
Block a user