radv/meta: create the louts for DCC comp-to-single clear on-demand
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
6c6dae59fb
commit
2af57b1cac
@@ -932,6 +932,32 @@ create_dcc_comp_to_single_pipeline(struct radv_device *device, bool is_msaa, VkP
|
|||||||
{
|
{
|
||||||
struct radv_meta_state *state = &device->meta_state;
|
struct radv_meta_state *state = &device->meta_state;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
|
|
||||||
|
if (!state->clear_dcc_comp_to_single_ds_layout) {
|
||||||
|
const VkDescriptorSetLayoutBinding binding = {
|
||||||
|
.binding = 0,
|
||||||
|
.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
|
||||||
|
.descriptorCount = 1,
|
||||||
|
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
};
|
||||||
|
|
||||||
|
result = radv_meta_create_descriptor_set_layout(device, 1, &binding, &state->clear_dcc_comp_to_single_ds_layout);
|
||||||
|
if (result != VK_SUCCESS)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!state->clear_dcc_comp_to_single_p_layout) {
|
||||||
|
const VkPushConstantRange pc_range = {
|
||||||
|
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
||||||
|
.size = 24,
|
||||||
|
};
|
||||||
|
|
||||||
|
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)
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
nir_shader *cs = build_clear_dcc_comp_to_single_shader(device, is_msaa);
|
nir_shader *cs = build_clear_dcc_comp_to_single_shader(device, is_msaa);
|
||||||
|
|
||||||
result = radv_meta_create_compute_pipeline(device, cs, state->clear_dcc_comp_to_single_p_layout, pipeline);
|
result = radv_meta_create_compute_pipeline(device, cs, state->clear_dcc_comp_to_single_p_layout, pipeline);
|
||||||
@@ -946,27 +972,6 @@ init_meta_clear_dcc_comp_to_single_state(struct radv_device *device, bool on_dem
|
|||||||
struct radv_meta_state *state = &device->meta_state;
|
struct radv_meta_state *state = &device->meta_state;
|
||||||
VkResult result;
|
VkResult result;
|
||||||
|
|
||||||
const VkDescriptorSetLayoutBinding binding = {
|
|
||||||
.binding = 0,
|
|
||||||
.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
|
|
||||||
.descriptorCount = 1,
|
|
||||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
|
||||||
};
|
|
||||||
|
|
||||||
result = radv_meta_create_descriptor_set_layout(device, 1, &binding, &state->clear_dcc_comp_to_single_ds_layout);
|
|
||||||
if (result != VK_SUCCESS)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
const VkPushConstantRange pc_range = {
|
|
||||||
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
|
|
||||||
.size = 24,
|
|
||||||
};
|
|
||||||
|
|
||||||
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)
|
|
||||||
return result;
|
|
||||||
|
|
||||||
if (on_demand)
|
if (on_demand)
|
||||||
return VK_SUCCESS;
|
return VK_SUCCESS;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user