radv/meta: create itoi r32g32b32 pipelines on-demand when needed
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30248>
This commit is contained in:
@@ -667,7 +667,27 @@ create_itoi_r32g32b32_pipeline(struct radv_device *device, VkPipeline *pipeline)
|
||||
}
|
||||
|
||||
static VkResult
|
||||
radv_device_init_meta_itoi_r32g32b32_state(struct radv_device *device)
|
||||
get_itoi_r32g32b32_pipeline(struct radv_device *device, VkPipeline *pipeline_out)
|
||||
{
|
||||
struct radv_meta_state *state = &device->meta_state;
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
mtx_lock(&state->mtx);
|
||||
if (!state->itoi_r32g32b32.pipeline) {
|
||||
result = create_itoi_r32g32b32_pipeline(device, &state->itoi_r32g32b32.pipeline);
|
||||
if (result != VK_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
*pipeline_out = state->itoi_r32g32b32.pipeline;
|
||||
|
||||
fail:
|
||||
mtx_unlock(&state->mtx);
|
||||
return result;
|
||||
}
|
||||
|
||||
static VkResult
|
||||
radv_device_init_meta_itoi_r32g32b32_state(struct radv_device *device, bool on_demand)
|
||||
{
|
||||
VkResult result;
|
||||
|
||||
@@ -701,6 +721,9 @@ radv_device_init_meta_itoi_r32g32b32_state(struct radv_device *device)
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
if (on_demand)
|
||||
return VK_SUCCESS;
|
||||
|
||||
return create_itoi_r32g32b32_pipeline(device, &device->meta_state.itoi_r32g32b32.pipeline);
|
||||
}
|
||||
|
||||
@@ -938,7 +961,7 @@ radv_device_init_meta_bufimage_state(struct radv_device *device, bool on_demand)
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
result = radv_device_init_meta_itoi_r32g32b32_state(device);
|
||||
result = radv_device_init_meta_itoi_r32g32b32_state(device, on_demand);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
@@ -1401,11 +1424,18 @@ radv_meta_image_to_image_cs_r32g32b32(struct radv_cmd_buffer *cmd_buffer, struct
|
||||
struct radv_meta_blit2d_surf *dst, struct radv_meta_blit2d_rect *rect)
|
||||
{
|
||||
struct radv_device *device = radv_cmd_buffer_device(cmd_buffer);
|
||||
VkPipeline pipeline = device->meta_state.itoi_r32g32b32.pipeline;
|
||||
struct radv_buffer_view src_view, dst_view;
|
||||
unsigned src_offset = 0, dst_offset = 0;
|
||||
unsigned src_stride, dst_stride;
|
||||
VkBuffer src_buffer, dst_buffer;
|
||||
VkPipeline pipeline;
|
||||
VkResult result;
|
||||
|
||||
result = get_itoi_r32g32b32_pipeline(device, &pipeline);
|
||||
if (result != VK_SUCCESS) {
|
||||
vk_command_buffer_set_error(&cmd_buffer->vk, result);
|
||||
return;
|
||||
}
|
||||
|
||||
/* 96-bit formats are only compatible to themselves. */
|
||||
assert(dst->format == VK_FORMAT_R32G32B32_UINT || dst->format == VK_FORMAT_R32G32B32_SINT ||
|
||||
|
Reference in New Issue
Block a user