VkBufferCreateInfo-sharingMode-参数问题

VkBufferCreateInfo-sharingMode-parameter issue

谁能帮我解决这个运行时错误:

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);

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

bufferCreateInfo.sharingMode - VK_SHARING_MODE_EXCLUSIVE;

你想要 = 而不是 - ...