mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-01 09:40:08 +01:00
lavapipe: create a desc set for immutable sampler layouts
this is necessary in order to bind an all-immutable set as a buffer Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22828>
This commit is contained in:
parent
12a7fc51c7
commit
180f0090e5
2 changed files with 22 additions and 0 deletions
|
|
@ -27,6 +27,18 @@
|
|||
#include "util/u_math.h"
|
||||
#include "util/u_inlines.h"
|
||||
|
||||
static void
|
||||
lvp_descriptor_set_layout_destroy(struct vk_device *_device, struct vk_descriptor_set_layout *_layout)
|
||||
{
|
||||
struct lvp_device *device = container_of(_device, struct lvp_device, vk);
|
||||
struct lvp_descriptor_set_layout *set_layout = (void*)vk_to_lvp_descriptor_set_layout(_layout);
|
||||
|
||||
_layout->ref_cnt = UINT32_MAX;
|
||||
lvp_descriptor_set_destroy(device, set_layout->immutable_set);
|
||||
|
||||
vk_descriptor_set_layout_destroy(_device, _layout);
|
||||
}
|
||||
|
||||
VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDescriptorSetLayout(
|
||||
VkDevice _device,
|
||||
const VkDescriptorSetLayoutCreateInfo* pCreateInfo,
|
||||
|
|
@ -165,6 +177,13 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_CreateDescriptorSetLayout(
|
|||
|
||||
set_layout->dynamic_offset_count = dynamic_offset_count;
|
||||
|
||||
if (set_layout->binding_count == set_layout->immutable_sampler_count) {
|
||||
/* create a bindable set with all the immutable samplers */
|
||||
lvp_descriptor_set_create(device, set_layout, &set_layout->immutable_set);
|
||||
vk_descriptor_set_layout_unref(&device->vk, &set_layout->vk);
|
||||
set_layout->vk.destroy = lvp_descriptor_set_layout_destroy;
|
||||
}
|
||||
|
||||
*pSetLayout = lvp_descriptor_set_layout_to_handle(set_layout);
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
|
|
|||
|
|
@ -313,6 +313,9 @@ struct lvp_descriptor_set_layout {
|
|||
/* Number of dynamic offsets used by this descriptor set */
|
||||
uint32_t dynamic_offset_count;
|
||||
|
||||
/* if this layout is comprised solely of immutable samplers, this will be a bindable set */
|
||||
struct lvp_descriptor_set *immutable_set;
|
||||
|
||||
/* Bindings in this descriptor set */
|
||||
struct lvp_descriptor_set_binding_layout binding[0];
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue