mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 18:20:10 +01:00
radv/meta: add radv_meta_get_noop_pipeline_layout()
To avoid duplicated objects. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32834>
This commit is contained in:
parent
dd7343f278
commit
105e809a9d
5 changed files with 16 additions and 8 deletions
|
|
@ -608,3 +608,12 @@ radv_break_on_count(nir_builder *b, nir_variable *var, nir_def *count)
|
|||
counter = nir_iadd_imm(b, counter, 1);
|
||||
nir_store_var(b, var, counter, 0x1);
|
||||
}
|
||||
|
||||
VkResult
|
||||
radv_meta_get_noop_pipeline_layout(struct radv_device *device, VkPipelineLayout *layout_out)
|
||||
{
|
||||
const char *key_data = "radv-noop";
|
||||
|
||||
return vk_meta_get_pipeline_layout(&device->vk, &device->meta_state.device, NULL, NULL, key_data, strlen(key_data),
|
||||
layout_out);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -255,6 +255,8 @@ void radv_cmd_buffer_resolve_rendering_fs(struct radv_cmd_buffer *cmd_buffer, st
|
|||
void radv_depth_stencil_resolve_rendering_fs(struct radv_cmd_buffer *cmd_buffer, VkImageAspectFlags aspects,
|
||||
VkResolveModeFlagBits resolve_mode);
|
||||
|
||||
VkResult radv_meta_get_noop_pipeline_layout(struct radv_device *device, VkPipelineLayout *layout_out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -57,13 +57,12 @@ get_pipeline_gfx(struct radv_device *device, struct radv_image *image, VkPipelin
|
|||
char key_data[64];
|
||||
VkResult result;
|
||||
|
||||
snprintf(key_data, sizeof(key_data), "radv-htile-expand-gfx-%d", samples);
|
||||
|
||||
result = vk_meta_get_pipeline_layout(&device->vk, &device->meta_state.device, NULL, NULL, key_data,
|
||||
strlen(key_data), layout_out);
|
||||
result = radv_meta_get_noop_pipeline_layout(device, layout_out);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
snprintf(key_data, sizeof(key_data), "radv-htile-expand-gfx-%d", samples);
|
||||
|
||||
VkPipeline pipeline_from_cache = vk_meta_lookup_pipeline(&device->meta_state.device, key_data, strlen(key_data));
|
||||
if (pipeline_from_cache != VK_NULL_HANDLE) {
|
||||
*pipeline_out = pipeline_from_cache;
|
||||
|
|
|
|||
|
|
@ -125,8 +125,7 @@ get_pipeline(struct radv_device *device, enum radv_color_op op, VkPipeline *pipe
|
|||
|
||||
snprintf(key_data, sizeof(key_data), "radv-color-op-%d", op);
|
||||
|
||||
result = vk_meta_get_pipeline_layout(&device->vk, &device->meta_state.device, NULL, NULL, key_data,
|
||||
strlen(key_data), layout_out);
|
||||
result = radv_meta_get_noop_pipeline_layout(device, layout_out);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ get_pipeline(struct radv_device *device, unsigned fs_key, VkPipeline *pipeline_o
|
|||
|
||||
snprintf(key_data, sizeof(key_data), "radv-resolve-hw-%d", fs_key);
|
||||
|
||||
result = vk_meta_get_pipeline_layout(&device->vk, &device->meta_state.device, NULL, NULL, key_data,
|
||||
strlen(key_data), layout_out);
|
||||
result = radv_meta_get_noop_pipeline_layout(device, layout_out);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue