VkBufferCreateInfo-sharingMode-parameter问题

时间:2019-04-18 08:39:29

标签: vulkan

任何人都可以帮助我解决此运行时错误:

14757395258967641292VUID-VkBufferCreateInfo-sharingMode-parameter(ERROR / SPEC): msgNum: 0 - vkCreateBuffer: value of pCreateInfo->sharingMode (-858993460) does not fall within the begin..end range of the core VkSharingMode enumeration tokens and is not an extension added token. The Vulkan spec states: sharingMode must be a valid VkSharingMode value (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkBufferCreateInfo-sharingMode-parameter)
Objects: 1
[0] 0, type: 0, name: NULL

我无法解决此问题。

我的VkBufferCreateInfo如下:

VkBufferCreateInfo bufferCreateInfo;

bufferCreateInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;

bufferCreateInfo.pNext = nullptr;

bufferCreateInfo.flags = 0;

bufferCreateInfo.size = sizeof(Vertex) * vertices.size();

bufferCreateInfo.usage = VK_BUFFER_USAGE_VERTEX_BUFFER_BIT;

bufferCreateInfo.sharingMode - VK_SHARING_MODE_EXCLUSIVE;

bufferCreateInfo.queueFamilyIndexCount = 0;

bufferCreateInfo.pQueueFamilyIndices = nullptr;        

VkResult result = vkCreateBuffer(device, &bufferCreateInfo, nullptr, &vertexBuffer);

1 个答案:

答案 0 :(得分:2)

假设这是真实的代码,而不是转录错误:

bufferCreateInfo.sharingMode - VK_SHARING_MODE_EXCLUSIVE;

您想要=而不是- ...