mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-04 06:06:17 +00:00
comp/render: Add VkExternalMemoryBufferCreateInfo
Fixes validation error when calling render_buffer_init_exportable VUID-vkBindBufferMemory-memory-02726(ERROR / SPEC): msgNum: -168767885 - Validation Error: [ VUID-vkBindBufferMemory-memory-02726 ] Object 0: handle = 0xe88693000000000c, type = VK_OBJECT_TYPE_BUFFER; Object 1: handle = 0xcad092000000000d, type = VK_OBJECT_TYPE_DEVICE_MEMORY; | MessageID = 0xf5f0ce73 | vkBindBufferMemory(): The VkDeviceMemory (VkDeviceMemory 0xcad092000000000d[]) has an external handleType of VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT which does not include at least one handle from VkBuffer (VkBuffer 0xe88693000000000c[]) handleType Unhandled VkExternalMemoryHandleTypeFlagBits. The Vulkan spec states: If the value of VkExportMemoryAllocateInfo::handleTypes used to allocate memory is not 0, it must include at least one of the handles set in VkExternalMemoryBufferCreateInfo::handleTypes when buffer was created (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkBindBufferMemory-memory-02726) Objects: 2 [0] 0xe88693000000000c, type: 9, name: NULL [1] 0xcad092000000000d, type: 8, name: NULL
This commit is contained in:
parent
a55a5a54b3
commit
7ebd11e1d4
|
@ -26,6 +26,7 @@ create_buffer(struct vk_bundle *vk,
|
||||||
VkBufferUsageFlags usage_flags,
|
VkBufferUsageFlags usage_flags,
|
||||||
VkMemoryPropertyFlags memory_property_flags,
|
VkMemoryPropertyFlags memory_property_flags,
|
||||||
VkDeviceSize size,
|
VkDeviceSize size,
|
||||||
|
const void *pNext_for_create,
|
||||||
const void *pNext_for_allocate,
|
const void *pNext_for_allocate,
|
||||||
VkBuffer *out_buffer,
|
VkBuffer *out_buffer,
|
||||||
VkDeviceMemory *out_memory,
|
VkDeviceMemory *out_memory,
|
||||||
|
@ -37,6 +38,7 @@ create_buffer(struct vk_bundle *vk,
|
||||||
// Create the buffer handle.
|
// Create the buffer handle.
|
||||||
VkBufferCreateInfo buffer_info = {
|
VkBufferCreateInfo buffer_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||||
|
.pNext = pNext_for_create,
|
||||||
.size = size,
|
.size = size,
|
||||||
.usage = usage_flags,
|
.usage = usage_flags,
|
||||||
};
|
};
|
||||||
|
@ -133,6 +135,7 @@ render_buffer_init(struct vk_bundle *vk,
|
||||||
usage_flags, // usage_flags
|
usage_flags, // usage_flags
|
||||||
memory_property_flags, // memory_property_flags
|
memory_property_flags, // memory_property_flags
|
||||||
size, // size
|
size, // size
|
||||||
|
NULL, // pNext for create
|
||||||
NULL, // pNext_for_allocate
|
NULL, // pNext_for_allocate
|
||||||
&buffer->buffer, // out_buffer
|
&buffer->buffer, // out_buffer
|
||||||
&buffer->memory, // out_memory
|
&buffer->memory, // out_memory
|
||||||
|
@ -154,6 +157,11 @@ render_buffer_init_exportable(struct vk_bundle *vk,
|
||||||
{
|
{
|
||||||
VkResult ret;
|
VkResult ret;
|
||||||
|
|
||||||
|
VkExternalMemoryBufferCreateInfo export_create_info = {
|
||||||
|
.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO,
|
||||||
|
.handleTypes = vk_csci_get_image_external_handle_type(vk),
|
||||||
|
};
|
||||||
|
|
||||||
VkExportMemoryAllocateInfo export_alloc_info = {
|
VkExportMemoryAllocateInfo export_alloc_info = {
|
||||||
.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR,
|
||||||
.pNext = NULL,
|
.pNext = NULL,
|
||||||
|
@ -164,6 +172,7 @@ render_buffer_init_exportable(struct vk_bundle *vk,
|
||||||
usage_flags, // usage_flags
|
usage_flags, // usage_flags
|
||||||
memory_property_flags, // memory_property_flags
|
memory_property_flags, // memory_property_flags
|
||||||
size, // size
|
size, // size
|
||||||
|
&export_create_info, // pNext_for_create
|
||||||
&export_alloc_info, // pNext_for_allocate
|
&export_alloc_info, // pNext_for_allocate
|
||||||
&buffer->buffer, // out_buffer
|
&buffer->buffer, // out_buffer
|
||||||
&buffer->memory, // out_memory
|
&buffer->memory, // out_memory
|
||||||
|
|
Loading…
Reference in a new issue