zink: add pushconst only pipeline layout

Now that all gfx pipelines share the same push constant layout,
create a screen wide push const only layout that is compatible
with all future programs.
This layout will be used to update push constant values, so that
the update can happen at any point before draw call.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19163>
This commit is contained in:
SoroushIMG 2022-10-13 22:48:44 +01:00
parent a0c6286485
commit fd89690795
3 changed files with 8 additions and 1 deletions

View file

@ -807,7 +807,7 @@ zink_pipeline_layout_create(struct zink_screen *screen, VkDescriptorSetLayout *d
pcr[1].size = sizeof(float) * 6;
plci.pushConstantRangeCount = 2;
}
plci.pPushConstantRanges = &pcr[0];
plci.pPushConstantRanges = pcr;
VkPipelineLayout layout;
VkResult result = VKSCR(CreatePipelineLayout)(screen->dev, &plci, NULL, &layout);

View file

@ -1338,6 +1338,8 @@ zink_destroy_screen(struct pipe_screen *pscreen)
util_vertex_state_cache_deinit(&screen->vertex_state_cache);
VKSCR(DestroyPipelineLayout)(screen->dev, screen->gfx_push_constant_layout, NULL);
u_transfer_helper_destroy(pscreen->transfer_helper);
util_queue_finish(&screen->cache_get_thread);
util_queue_destroy(&screen->cache_get_thread);
@ -2604,6 +2606,10 @@ zink_internal_create_screen(const struct pipe_screen_config *config)
screen->buffer_barrier = zink_resource_buffer_barrier;
}
screen->gfx_push_constant_layout = zink_pipeline_layout_create(screen, NULL, 0, false);
if (screen->gfx_push_constant_layout == VK_NULL_HANDLE)
goto fail;
if (!zink_descriptor_layouts_init(screen))
goto fail;

View file

@ -1273,6 +1273,7 @@ struct zink_screen {
struct zink_modifier_prop modifier_props[PIPE_FORMAT_COUNT];
VkExtent2D maxSampleLocationGridSize[5];
VkPipelineLayout gfx_push_constant_layout;
struct {
bool broken_l4a4;