radv/meta: remove unnecessary goto
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30262>
This commit is contained in:
committed by
Marge Bot
parent
c96f2c5e3d
commit
5b7459d0fa
@@ -1003,15 +1003,11 @@ meta_blit2d_create_pipe_layout(struct radv_device *device, int idx, uint32_t log
|
||||
|
||||
result = radv_meta_create_descriptor_set_layout(device, 1, &binding, &device->meta_state.blit2d[log2_samples].ds_layouts[idx]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
result = radv_meta_create_pipeline_layout(device,
|
||||
&device->meta_state.blit2d[log2_samples].ds_layouts[idx], num_push_constant_range, push_constant_ranges, &device->meta_state.blit2d[log2_samples].p_layouts[idx]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return VK_SUCCESS;
|
||||
fail:
|
||||
return result;
|
||||
return radv_meta_create_pipeline_layout(device, &device->meta_state.blit2d[log2_samples].ds_layouts[idx],
|
||||
num_push_constant_range, push_constant_ranges,
|
||||
&device->meta_state.blit2d[log2_samples].p_layouts[idx]);
|
||||
}
|
||||
|
||||
VkResult
|
||||
|
||||
@@ -540,7 +540,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device, bool on_demand)
|
||||
|
||||
result = radv_meta_create_descriptor_set_layout(device, 2, bindings, &device->meta_state.itoi.img_ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
const VkPushConstantRange pc_range = {
|
||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
@@ -550,7 +550,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device, bool on_demand)
|
||||
result = radv_meta_create_pipeline_layout(device, &device->meta_state.itoi.img_ds_layout, 1, &pc_range,
|
||||
&device->meta_state.itoi.img_p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
if (on_demand)
|
||||
return VK_SUCCESS;
|
||||
@@ -559,7 +559,7 @@ radv_device_init_meta_itoi_state(struct radv_device *device, bool on_demand)
|
||||
uint32_t samples = 1 << i;
|
||||
result = create_itoi_pipeline(device, false, false, samples, &device->meta_state.itoi.pipeline[i]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
}
|
||||
|
||||
for (uint32_t src_3d = 0; src_3d < 2; src_3d++) {
|
||||
@@ -576,12 +576,10 @@ radv_device_init_meta_itoi_state(struct radv_device *device, bool on_demand)
|
||||
|
||||
result = create_itoi_pipeline(device, src_3d, dst_3d, 1, pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
return VK_SUCCESS;
|
||||
fail:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -955,7 +955,7 @@ init_meta_clear_dcc_comp_to_single_state(struct radv_device *device, bool on_dem
|
||||
|
||||
result = radv_meta_create_descriptor_set_layout(device, 1, &binding, &state->clear_dcc_comp_to_single_ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
const VkPushConstantRange pc_range = {
|
||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
@@ -965,7 +965,7 @@ init_meta_clear_dcc_comp_to_single_state(struct radv_device *device, bool on_dem
|
||||
result = radv_meta_create_pipeline_layout(device, &state->clear_dcc_comp_to_single_ds_layout, 1, &pc_range,
|
||||
&state->clear_dcc_comp_to_single_p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
if (on_demand)
|
||||
return VK_SUCCESS;
|
||||
@@ -973,10 +973,9 @@ init_meta_clear_dcc_comp_to_single_state(struct radv_device *device, bool on_dem
|
||||
for (uint32_t i = 0; i < 2; i++) {
|
||||
result = create_dcc_comp_to_single_pipeline(device, !!i, &state->clear_dcc_comp_to_single_pipeline[i]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
}
|
||||
|
||||
fail:
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -57,7 +57,6 @@ static VkResult
|
||||
create_dcc_compress_compute(struct radv_device *device)
|
||||
{
|
||||
VkResult result = VK_SUCCESS;
|
||||
nir_shader *cs = build_dcc_decompress_compute_shader(device);
|
||||
|
||||
const VkDescriptorSetLayoutBinding bindings[] = {
|
||||
{
|
||||
@@ -77,21 +76,19 @@ create_dcc_compress_compute(struct radv_device *device)
|
||||
result = radv_meta_create_descriptor_set_layout(
|
||||
device, 2, bindings, &device->meta_state.fast_clear_flush.dcc_decompress_compute_ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
return result;
|
||||
|
||||
result =
|
||||
radv_meta_create_pipeline_layout(device, &device->meta_state.fast_clear_flush.dcc_decompress_compute_ds_layout, 0,
|
||||
NULL, &device->meta_state.fast_clear_flush.dcc_decompress_compute_p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
return result;
|
||||
|
||||
nir_shader *cs = build_dcc_decompress_compute_shader(device);
|
||||
|
||||
result =
|
||||
radv_meta_create_compute_pipeline(device, cs, device->meta_state.fast_clear_flush.dcc_decompress_compute_p_layout,
|
||||
&device->meta_state.fast_clear_flush.dcc_decompress_compute_pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
ralloc_free(cs);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@ create_pipeline(struct radv_device *device, VkFormat format, VkPipeline *pipelin
|
||||
VkResult result;
|
||||
VkDevice device_h = radv_device_to_handle(device);
|
||||
|
||||
nir_shader *vs_module = radv_meta_build_nir_vs_generate_vertices(device);
|
||||
nir_shader *fs_module = build_nir_fs(device);
|
||||
|
||||
if (!device->meta_state.resolve.p_layout) {
|
||||
result = radv_meta_create_pipeline_layout(device, NULL, 0, NULL, &device->meta_state.resolve.p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
return result;
|
||||
}
|
||||
|
||||
nir_shader *vs_module = radv_meta_build_nir_vs_generate_vertices(device);
|
||||
nir_shader *fs_module = build_nir_fs(device);
|
||||
|
||||
VkFormat color_formats[2] = {format, format};
|
||||
const VkPipelineRenderingCreateInfo rendering_create_info = {
|
||||
.sType = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO,
|
||||
@@ -142,12 +142,7 @@ create_pipeline(struct radv_device *device, VkFormat format, VkPipeline *pipelin
|
||||
.custom_blend_mode = V_028808_CB_RESOLVE,
|
||||
},
|
||||
&device->meta_state.alloc, pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
ralloc_free(vs_module);
|
||||
ralloc_free(fs_module);
|
||||
return result;
|
||||
|
||||
@@ -187,20 +187,15 @@ create_layout(struct radv_device *device)
|
||||
|
||||
result = radv_meta_create_descriptor_set_layout(device, 2, bindings, &device->meta_state.resolve_compute.ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
const VkPushConstantRange pc_range = {
|
||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
.size = 16,
|
||||
};
|
||||
|
||||
result = radv_meta_create_pipeline_layout(device, &device->meta_state.resolve_compute.ds_layout, 1, &pc_range,
|
||||
&device->meta_state.resolve_compute.p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return VK_SUCCESS;
|
||||
fail:
|
||||
return result;
|
||||
return radv_meta_create_pipeline_layout(device, &device->meta_state.resolve_compute.ds_layout, 1, &pc_range,
|
||||
&device->meta_state.resolve_compute.p_layout);
|
||||
}
|
||||
|
||||
static VkResult
|
||||
|
||||
@@ -58,20 +58,15 @@ create_layout(struct radv_device *device)
|
||||
|
||||
result = radv_meta_create_descriptor_set_layout(device, 1, &binding, &device->meta_state.resolve_fragment.ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return result;
|
||||
|
||||
const VkPushConstantRange pc_range = {
|
||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
.size = 8,
|
||||
};
|
||||
|
||||
result = radv_meta_create_pipeline_layout(device, &device->meta_state.resolve_fragment.ds_layout, 1, &pc_range,
|
||||
&device->meta_state.resolve_fragment.p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
return VK_SUCCESS;
|
||||
fail:
|
||||
return result;
|
||||
return radv_meta_create_pipeline_layout(device, &device->meta_state.resolve_fragment.ds_layout, 1, &pc_range,
|
||||
&device->meta_state.resolve_fragment.p_layout);
|
||||
}
|
||||
|
||||
static const VkPipelineVertexInputStateCreateInfo normal_vi_create_info = {
|
||||
|
||||
@@ -2079,7 +2079,6 @@ VkResult
|
||||
radv_device_init_dgc_prepare_state(struct radv_device *device)
|
||||
{
|
||||
VkResult result;
|
||||
nir_shader *cs = build_dgc_prepare_shader(device);
|
||||
|
||||
const VkDescriptorSetLayoutBinding binding = {
|
||||
.binding = 0,
|
||||
@@ -2090,7 +2089,7 @@ radv_device_init_dgc_prepare_state(struct radv_device *device)
|
||||
|
||||
result = radv_meta_create_descriptor_set_layout(device, 1, &binding, &device->meta_state.dgc_prepare.ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
return result;
|
||||
|
||||
const VkPushConstantRange pc_range = {
|
||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||
@@ -2100,14 +2099,12 @@ radv_device_init_dgc_prepare_state(struct radv_device *device)
|
||||
result = radv_meta_create_pipeline_layout(device, &device->meta_state.dgc_prepare.ds_layout, 1, &pc_range,
|
||||
&device->meta_state.dgc_prepare.p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
return result;
|
||||
|
||||
nir_shader *cs = build_dgc_prepare_shader(device);
|
||||
|
||||
result = radv_meta_create_compute_pipeline(device, cs, device->meta_state.dgc_prepare.p_layout,
|
||||
&device->meta_state.dgc_prepare.pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
ralloc_free(cs);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user