mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 22:38:05 +02:00
radv/meta: create fmask copy layouts regardless on-demand
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:
parent
ee1bc2e821
commit
67d720d115
1 changed files with 25 additions and 30 deletions
|
|
@ -111,47 +111,42 @@ create_fmask_copy_pipeline(struct radv_device *device, int samples, VkPipeline *
|
|||
static VkResult
|
||||
radv_device_init_meta_fmask_copy_state_internal(struct radv_device *device, uint32_t samples_log2)
|
||||
{
|
||||
VkResult result;
|
||||
|
||||
if (device->meta_state.fmask_copy.pipeline[samples_log2])
|
||||
return VK_SUCCESS;
|
||||
|
||||
if (!device->meta_state.fmask_copy.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, &device->meta_state.fmask_copy.ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!device->meta_state.fmask_copy.p_layout) {
|
||||
result = radv_meta_create_pipeline_layout(device, &device->meta_state.fmask_copy.ds_layout, 0, NULL,
|
||||
&device->meta_state.fmask_copy.p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
}
|
||||
|
||||
return create_fmask_copy_pipeline(device, 1u << samples_log2, &device->meta_state.fmask_copy.pipeline[samples_log2]);
|
||||
}
|
||||
|
||||
VkResult
|
||||
radv_device_init_meta_fmask_copy_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_copy.ds_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
result =
|
||||
radv_meta_create_pipeline_layout(device, &state->fmask_copy.ds_layout, 0, NULL, &state->fmask_copy.p_layout);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
if (on_demand)
|
||||
return VK_SUCCESS;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue