Fixing struct initializer order
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "Enums.h"
|
||||
#include <stdexcept>
|
||||
|
||||
using namespace Seele;
|
||||
using namespace Seele::Gfx;
|
||||
|
||||
@@ -35,8 +35,8 @@ Buffer::Buffer(PGraphics graphics, uint64 size, VkBufferUsageFlags usage, Gfx::Q
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
};
|
||||
VmaAllocationCreateInfo allocInfo = {
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
};
|
||||
for (uint32 i = 0; i < numBuffers; ++i)
|
||||
{
|
||||
@@ -170,8 +170,8 @@ void *Buffer::mapRegion(uint64 regionOffset, uint64 regionSize, bool writeOnly)
|
||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||
.pNext = nullptr,
|
||||
.flags = 0,
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
.size = regionSize,
|
||||
.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
};
|
||||
VmaAllocationCreateInfo allocInfo = {
|
||||
@@ -198,7 +198,6 @@ void Buffer::unmap()
|
||||
if (found != pendingBuffers.end())
|
||||
{
|
||||
PendingBuffer &pending = found->value;
|
||||
vmaFlushAllocation(graphics->getAllocator(), pending.allocation, 0, VK_WHOLE_SIZE);
|
||||
if (pending.writeOnly)
|
||||
{
|
||||
if (buffers[currentBuffer].properties & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT)
|
||||
@@ -207,6 +206,7 @@ void Buffer::unmap()
|
||||
}
|
||||
else
|
||||
{
|
||||
vmaFlushAllocation(graphics->getAllocator(), pending.allocation, 0, VK_WHOLE_SIZE);
|
||||
vmaUnmapMemory(graphics->getAllocator(), pending.allocation);
|
||||
PCommand command = graphics->getQueueCommands(owner)->getCommands();
|
||||
VkCommandBuffer cmdHandle = command->getHandle();
|
||||
|
||||
@@ -58,16 +58,16 @@ void Graphics::init(GraphicsInitializer initInfo)
|
||||
pickPhysicalDevice();
|
||||
createDevice(initInfo);
|
||||
VmaAllocatorCreateInfo createInfo = {
|
||||
.physicalDevice = physicalDevice,
|
||||
.device = handle,
|
||||
.instance = instance,
|
||||
.preferredLargeHeapBlockSize = 0,
|
||||
.pAllocationCallbacks = nullptr,
|
||||
.pDeviceMemoryCallbacks = nullptr,
|
||||
.pHeapSizeLimit = nullptr,
|
||||
.physicalDevice = physicalDevice,
|
||||
.preferredLargeHeapBlockSize = 0,
|
||||
.pTypeExternalMemoryHandleTypes = nullptr,
|
||||
.pVulkanFunctions = nullptr,
|
||||
.instance = instance,
|
||||
.vulkanApiVersion = VK_API_VERSION_1_3,
|
||||
.pTypeExternalMemoryHandleTypes = nullptr,
|
||||
};
|
||||
vmaCreateAllocator(&createInfo, &allocator);
|
||||
pipelineCache = new PipelineCache(this, "pipeline.cache");
|
||||
|
||||
@@ -125,8 +125,8 @@ TextureBase::TextureBase(PGraphics graphics, VkImageViewType viewType,
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
};
|
||||
VmaAllocationCreateInfo alloc = {
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
};
|
||||
VK_CHECK(vmaCreateBuffer(graphics->getAllocator(), &stagingInfo, &alloc, &stagingBuffer, &stagingAlloc, nullptr));
|
||||
vmaMapMemory(graphics->getAllocator(), stagingAlloc, &data);
|
||||
@@ -257,8 +257,8 @@ void TextureBase::download(uint32 mipLevel, uint32 arrayLayer, uint32 face, Arra
|
||||
.sharingMode = VK_SHARING_MODE_EXCLUSIVE,
|
||||
};
|
||||
VmaAllocationCreateInfo alloc = {
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
.flags = VMA_ALLOCATION_CREATE_MAPPED_BIT | VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT,
|
||||
.usage = VMA_MEMORY_USAGE_AUTO,
|
||||
};
|
||||
VK_CHECK(vmaCreateBuffer(graphics->getAllocator(), &stagingInfo, &alloc, &stagingBuffer, &stagingAlloc, nullptr));
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
#include <thread>
|
||||
#include <functional>
|
||||
#include "Containers/Array.h"
|
||||
#include "Containers/List.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user