radv/meta: create fmask expand layouts regardless on-demand

To be consistent with other meta operations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30233>
This commit is contained in:
Samuel Pitoiset
2024-07-17 21:49:43 +02:00
committed by Marge Bot
parent 4bef832b10
commit f1ec223cd2

View File

@@ -168,34 +168,6 @@ radv_device_init_meta_fmask_expand_state_internal(struct radv_device *device, ui
if (state->fmask_expand.pipeline[samples_log2])
return VK_SUCCESS;
if (!state->fmask_expand.ds_layout) {
const VkDescriptorSetLayoutBinding bindings[] = {
{
.binding = 0,
.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
.descriptorCount = 1,
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
},
{
.binding = 1,
.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
.descriptorCount = 1,
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
},
};
result = radv_meta_create_descriptor_set_layout(device, 2, bindings, &state->fmask_expand.ds_layout);
if (result != VK_SUCCESS)
return result;
}
if (!state->fmask_expand.p_layout) {
result = radv_meta_create_pipeline_layout(device, &state->fmask_expand.ds_layout, 0, NULL,
&state->fmask_expand.p_layout);
if (result != VK_SUCCESS)
return result;
}
result = create_fmask_expand_pipeline(device, 1 << samples_log2, &state->fmask_expand.pipeline[samples_log2]);
return result;
@@ -204,8 +176,33 @@ radv_device_init_meta_fmask_expand_state_internal(struct radv_device *device, ui
VkResult
radv_device_init_meta_fmask_expand_state(struct radv_device *device, bool on_demand)
{
struct radv_meta_state *state = &device->meta_state;
VkResult result;
const VkDescriptorSetLayoutBinding bindings[] = {
{
.binding = 0,
.descriptorType = VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
.descriptorCount = 1,
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
},
{
.binding = 1,
.descriptorType = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
.descriptorCount = 1,
.stageFlags = VK_SHADER_STAGE_COMPUTE_BIT,
},
};
result = radv_meta_create_descriptor_set_layout(device, 2, bindings, &state->fmask_expand.ds_layout);
if (result != VK_SUCCESS)
return result;
result =
radv_meta_create_pipeline_layout(device, &state->fmask_expand.ds_layout, 0, NULL, &state->fmask_expand.p_layout);
if (result != VK_SUCCESS)
return result;
if (on_demand)
return VK_SUCCESS;