mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
radv/meta: stop creating similar pipeline layouts for depth decompress
Only the pipeline depends on the number of samples. 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:
parent
5b7459d0fa
commit
5361a50d54
2 changed files with 19 additions and 23 deletions
|
|
@ -216,10 +216,9 @@ radv_device_finish_meta_depth_decomp_state(struct radv_device *device)
|
|||
{
|
||||
struct radv_meta_state *state = &device->meta_state;
|
||||
|
||||
for (uint32_t i = 0; i < ARRAY_SIZE(state->depth_decomp); ++i) {
|
||||
radv_DestroyPipelineLayout(radv_device_to_handle(device), state->depth_decomp[i].p_layout, &state->alloc);
|
||||
|
||||
radv_DestroyPipeline(radv_device_to_handle(device), state->depth_decomp[i].decompress_pipeline, &state->alloc);
|
||||
radv_DestroyPipelineLayout(radv_device_to_handle(device), state->depth_decomp.p_layout, &state->alloc);
|
||||
for (uint32_t i = 0; i < ARRAY_SIZE(state->depth_decomp.decompress_pipeline); ++i) {
|
||||
radv_DestroyPipeline(radv_device_to_handle(device), state->depth_decomp.decompress_pipeline[i], &state->alloc);
|
||||
}
|
||||
|
||||
radv_DestroyPipeline(radv_device_to_handle(device), state->expand_depth_stencil_compute_pipeline, &state->alloc);
|
||||
|
|
@ -235,25 +234,22 @@ radv_device_init_meta_depth_decomp_state(struct radv_device *device, bool on_dem
|
|||
struct radv_meta_state *state = &device->meta_state;
|
||||
VkResult res = VK_SUCCESS;
|
||||
|
||||
for (uint32_t i = 0; i < ARRAY_SIZE(state->depth_decomp); ++i) {
|
||||
res = radv_meta_create_pipeline_layout(device, NULL, 0, NULL, &state->depth_decomp.p_layout);
|
||||
if (res != VK_SUCCESS)
|
||||
return res;
|
||||
|
||||
if (on_demand)
|
||||
return res;
|
||||
|
||||
for (uint32_t i = 0; i < ARRAY_SIZE(state->depth_decomp.decompress_pipeline); ++i) {
|
||||
uint32_t samples = 1 << i;
|
||||
|
||||
res = radv_meta_create_pipeline_layout(device, NULL, 0, NULL, &state->depth_decomp[i].p_layout);
|
||||
if (res != VK_SUCCESS)
|
||||
return res;
|
||||
|
||||
if (on_demand)
|
||||
continue;
|
||||
|
||||
res = create_pipeline_gfx(device, samples, state->depth_decomp[i].p_layout,
|
||||
&state->depth_decomp[i].decompress_pipeline);
|
||||
res = create_pipeline_gfx(device, samples, state->depth_decomp.p_layout,
|
||||
&state->depth_decomp.decompress_pipeline[i]);
|
||||
if (res != VK_SUCCESS)
|
||||
return res;
|
||||
}
|
||||
|
||||
if (on_demand)
|
||||
return VK_SUCCESS;
|
||||
|
||||
return create_pipeline_cs(device, &state->expand_depth_stencil_compute_pipeline);
|
||||
}
|
||||
|
||||
|
|
@ -266,14 +262,14 @@ get_pipeline_gfx(struct radv_device *device, struct radv_image *image, VkPipelin
|
|||
VkResult result = VK_SUCCESS;
|
||||
|
||||
mtx_lock(&state->mtx);
|
||||
if (!state->depth_decomp[samples_log2].decompress_pipeline) {
|
||||
result = create_pipeline_gfx(device, samples, state->depth_decomp[samples_log2].p_layout,
|
||||
&state->depth_decomp[samples_log2].decompress_pipeline);
|
||||
if (!state->depth_decomp.decompress_pipeline[samples_log2]) {
|
||||
result = create_pipeline_gfx(device, samples, state->depth_decomp.p_layout,
|
||||
&state->depth_decomp.decompress_pipeline[samples_log2]);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
*pipeline_out = state->depth_decomp[samples_log2].decompress_pipeline;
|
||||
*pipeline_out = state->depth_decomp.decompress_pipeline[samples_log2];
|
||||
|
||||
fail:
|
||||
mtx_unlock(&state->mtx);
|
||||
|
|
|
|||
|
|
@ -257,8 +257,8 @@ struct radv_meta_state {
|
|||
|
||||
struct {
|
||||
VkPipelineLayout p_layout;
|
||||
VkPipeline decompress_pipeline;
|
||||
} depth_decomp[MAX_SAMPLES_LOG2];
|
||||
VkPipeline decompress_pipeline[MAX_SAMPLES_LOG2];
|
||||
} depth_decomp;
|
||||
|
||||
VkDescriptorSetLayout expand_depth_stencil_compute_ds_layout;
|
||||
VkPipelineLayout expand_depth_stencil_compute_p_layout;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue