mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 04:30:10 +01:00
vulkan/runtime: add a multialloc variant for pipeline create
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34874>
This commit is contained in:
parent
565ac1ee6a
commit
fa2627aefb
2 changed files with 38 additions and 6 deletions
|
|
@ -346,6 +346,17 @@ vk_pipeline_robustness_state_fill(const struct vk_device *device,
|
|||
rs->images = vk_device_default_robust_image_behavior(device);
|
||||
}
|
||||
|
||||
static void
|
||||
vk_pipeline_init(struct vk_pipeline *pipeline,
|
||||
const struct vk_pipeline_ops *ops,
|
||||
VkPipelineBindPoint bind_point,
|
||||
VkPipelineCreateFlags2KHR flags)
|
||||
{
|
||||
pipeline->ops = ops;
|
||||
pipeline->bind_point = bind_point;
|
||||
pipeline->flags = flags;
|
||||
}
|
||||
|
||||
void *
|
||||
vk_pipeline_zalloc(struct vk_device *device,
|
||||
const struct vk_pipeline_ops *ops,
|
||||
|
|
@ -354,15 +365,29 @@ vk_pipeline_zalloc(struct vk_device *device,
|
|||
const VkAllocationCallbacks *alloc,
|
||||
size_t size)
|
||||
{
|
||||
struct vk_pipeline *pipeline;
|
||||
|
||||
pipeline = vk_object_zalloc(device, alloc, size, VK_OBJECT_TYPE_PIPELINE);
|
||||
struct vk_pipeline *pipeline =
|
||||
vk_object_zalloc(device, alloc, size, VK_OBJECT_TYPE_PIPELINE);
|
||||
if (pipeline == NULL)
|
||||
return NULL;
|
||||
|
||||
pipeline->ops = ops;
|
||||
pipeline->bind_point = bind_point;
|
||||
pipeline->flags = flags;
|
||||
vk_pipeline_init(pipeline, ops, bind_point, flags);
|
||||
|
||||
return pipeline;
|
||||
}
|
||||
|
||||
void *vk_pipeline_multizalloc(struct vk_device *device,
|
||||
struct vk_multialloc *ma,
|
||||
const struct vk_pipeline_ops *ops,
|
||||
VkPipelineBindPoint bind_point,
|
||||
VkPipelineCreateFlags2KHR flags,
|
||||
const VkAllocationCallbacks *alloc)
|
||||
{
|
||||
struct vk_pipeline *pipeline =
|
||||
vk_object_multizalloc(device, ma, alloc, VK_OBJECT_TYPE_PIPELINE);
|
||||
if (!pipeline)
|
||||
return NULL;
|
||||
|
||||
vk_pipeline_init(pipeline, ops, bind_point, flags);
|
||||
|
||||
return pipeline;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -206,6 +206,13 @@ void *vk_pipeline_zalloc(struct vk_device *device,
|
|||
const VkAllocationCallbacks *alloc,
|
||||
size_t size);
|
||||
|
||||
void *vk_pipeline_multizalloc(struct vk_device *device,
|
||||
struct vk_multialloc *ma,
|
||||
const struct vk_pipeline_ops *ops,
|
||||
VkPipelineBindPoint bind_point,
|
||||
VkPipelineCreateFlags2KHR flags,
|
||||
const VkAllocationCallbacks *alloc);
|
||||
|
||||
void vk_pipeline_free(struct vk_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct vk_pipeline *pipeline);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue