Fixing staging buffers not getting deleted
remove vgcore
This commit is contained in:
@@ -32,6 +32,7 @@ target_sources(Engine
|
||||
Buffer.h
|
||||
DebugVertex.h
|
||||
Descriptor.h
|
||||
Enums.h
|
||||
Graphics.h
|
||||
Initializer.h
|
||||
Mesh.h
|
||||
|
||||
@@ -110,6 +110,7 @@ FormatCompatibilityInfo Gfx::getFormatInfo(SeFormat format)
|
||||
.blockExtent = Vector(1, 1, 1),
|
||||
.texelsPerBlock = 1,
|
||||
};
|
||||
default:
|
||||
throw new std::logic_error("not yet implemented");
|
||||
}
|
||||
throw new std::logic_error("not yet implemented");
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ namespace Gfx
|
||||
static constexpr bool useAsyncCompute = true;
|
||||
static constexpr bool waitIdleOnSubmit = true;
|
||||
static constexpr bool useMeshShading = true;
|
||||
static constexpr uint32 numFramesBuffered = 8;
|
||||
static constexpr uint32 numFramesBuffered = 3;
|
||||
|
||||
// meshlet dimensions curated by NVIDIA
|
||||
static constexpr uint32 numVerticesPerMeshlet = 64;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
#include "Mesh.h"
|
||||
#include "Graphics/Graphics.h"
|
||||
#include "Asset/AssetRegistry.h"
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
@@ -16,6 +17,7 @@ void Mesh::save(ArchiveBuffer& buffer) const
|
||||
Serialization::save(buffer, vertexData->getTypeName());
|
||||
Serialization::save(buffer, vertexCount);
|
||||
Serialization::save(buffer, meshlets);
|
||||
Serialization::save(buffer, referencedMaterial->getAssetIdentifier());
|
||||
vertexData->serializeMesh(id, vertexCount, buffer);
|
||||
}
|
||||
|
||||
@@ -26,6 +28,9 @@ void Mesh::load(ArchiveBuffer& buffer)
|
||||
Serialization::load(buffer, vertexCount);
|
||||
vertexData = VertexData::findByTypeName(typeName);
|
||||
Serialization::load(buffer, meshlets);
|
||||
std::string refId;
|
||||
Serialization::load(buffer, refId);
|
||||
referencedMaterial = AssetRegistry::findMaterialInstance(refId);
|
||||
id = vertexData->allocateVertexData(vertexCount);
|
||||
vertexData->loadMesh(id, meshlets);
|
||||
vertexData->deserializeMesh(id, buffer);
|
||||
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
VertexData* vertexData;
|
||||
MeshId id;
|
||||
uint64 vertexCount;
|
||||
PMaterialInstance referencedMaterial;
|
||||
PMaterialInstanceAsset referencedMaterial;
|
||||
Array<Meshlet> meshlets;
|
||||
void save(ArchiveBuffer& buffer) const;
|
||||
void load(ArchiveBuffer& buffer);
|
||||
@@ -23,12 +23,12 @@ DEFINE_REF(Mesh)
|
||||
namespace Serialization
|
||||
{
|
||||
template<>
|
||||
static void save(ArchiveBuffer& buffer, const OMesh& ptr)
|
||||
void save(ArchiveBuffer& buffer, const OMesh& ptr)
|
||||
{
|
||||
ptr->save(buffer);
|
||||
}
|
||||
template<>
|
||||
static void load(ArchiveBuffer& buffer, OMesh& ptr)
|
||||
void load(ArchiveBuffer& buffer, OMesh& ptr)
|
||||
{
|
||||
ptr = new Mesh();
|
||||
ptr->load(buffer);
|
||||
|
||||
@@ -152,6 +152,6 @@ void BasePass::createRenderPass()
|
||||
tLightGrid = resources->requestTexture("LIGHTCULLING_TLIGHTGRID");
|
||||
}
|
||||
|
||||
void BasePass::modifyRenderPassMacros(Map<const char*, const char*>& defines)
|
||||
void BasePass::modifyRenderPassMacros(Map<const char*, const char*>&)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -20,8 +20,6 @@ LightCullingPass::~LightCullingPass()
|
||||
void LightCullingPass::beginFrame(const Component::Camera& cam)
|
||||
{
|
||||
RenderPass::beginFrame(cam);
|
||||
uint32_t viewportWidth = viewport->getSizeX();
|
||||
uint32_t viewportHeight = viewport->getSizeY();
|
||||
|
||||
uint32 reset = 0;
|
||||
DataSource counterReset = {
|
||||
|
||||
@@ -30,6 +30,7 @@ void RenderPass::beginFrame(const Component::Camera& cam)
|
||||
.projectionMatrix = viewport->getProjectionMatrix(),
|
||||
.cameraPosition = Vector4(cam.getCameraPosition(), 1),
|
||||
.screenDimensions = Vector2(static_cast<float>(viewport->getSizeX()), static_cast<float>(viewport->getSizeY())),
|
||||
.pad0 = Vector2(0),
|
||||
};
|
||||
DataSource uniformUpdate = {
|
||||
.size = sizeof(ViewParameter),
|
||||
|
||||
@@ -75,13 +75,13 @@ public:
|
||||
SeAttachmentStoreOp storeOp = SE_ATTACHMENT_STORE_OP_STORE,
|
||||
SeAttachmentLoadOp stencilLoadOp = SE_ATTACHMENT_LOAD_OP_DONT_CARE,
|
||||
SeAttachmentStoreOp stencilStoreOp = SE_ATTACHMENT_STORE_OP_DONT_CARE)
|
||||
: loadOp(loadOp)
|
||||
: clear()
|
||||
, componentFlags(0)
|
||||
, loadOp(loadOp)
|
||||
, storeOp(storeOp)
|
||||
, stencilLoadOp(stencilLoadOp)
|
||||
, stencilStoreOp(stencilStoreOp)
|
||||
, texture(texture)
|
||||
, clear()
|
||||
, componentFlags(0)
|
||||
{
|
||||
}
|
||||
virtual ~RenderTargetAttachment()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#include "Shader.h"
|
||||
#include "Graphics/RenderPass/DepthPrepass.h"
|
||||
#include "Graphics/RenderPass/BasePass.h"
|
||||
#include <format>
|
||||
|
||||
using namespace Seele;
|
||||
using namespace Seele::Gfx;
|
||||
@@ -52,11 +53,9 @@ void ShaderCompiler::compile()
|
||||
for (const auto& [name, pass] : passes)
|
||||
{
|
||||
std::memset(&permutation, 0, sizeof(ShaderPermutation));
|
||||
permutation = {
|
||||
.hasFragment = pass.hasFragmentShader,
|
||||
.useMeshShading = pass.useMeshShading,
|
||||
.hasTaskShader = pass.hasTaskShader,
|
||||
};
|
||||
permutation.hasFragment = pass.hasFragmentShader;
|
||||
permutation.useMeshShading = pass.useMeshShading;
|
||||
permutation.hasTaskShader = pass.hasTaskShader;
|
||||
std::memcpy(permutation.vertexMeshFile, pass.mainFile.c_str(), sizeof(permutation.vertexMeshFile));
|
||||
if (pass.hasFragmentShader)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace Seele;
|
||||
|
||||
constexpr static uint64 NUM_DEFAULT_ELEMENTS = 1024;
|
||||
constexpr static uint64 NUM_DEFAULT_ELEMENTS = 1024 * 1024;
|
||||
|
||||
void VertexData::resetMeshData()
|
||||
{
|
||||
@@ -19,13 +19,13 @@ void VertexData::resetMeshData()
|
||||
}
|
||||
}
|
||||
|
||||
void VertexData::updateMesh(const Component::Transform& transform, const Component::Mesh& mesh)
|
||||
void VertexData::updateMesh(const Component::Transform& transform, PMesh mesh)
|
||||
{
|
||||
PMaterial mat = mesh.instance->getBaseMaterial();
|
||||
PMaterial mat = mesh->referencedMaterial->getHandle()->getBaseMaterial();
|
||||
MaterialData& matData = materialData[mat->getName()];
|
||||
MaterialInstanceData& matInstanceData = matData.instances[mesh.instance->getId()];
|
||||
MaterialInstanceData& matInstanceData = matData.instances[mesh->referencedMaterial->getHandle()->getId()];
|
||||
matInstanceData.meshes.add(MeshInstanceData{
|
||||
.id = mesh.id,
|
||||
.id = mesh->id,
|
||||
.instance = InstanceData {
|
||||
.transformMatrix = transform.toMatrix(),
|
||||
}
|
||||
@@ -45,10 +45,10 @@ void VertexData::loadMesh(MeshId id, Array<Meshlet> loadedMeshlets)
|
||||
Meshlet& m = loadedMeshlets[currentMesh + i];
|
||||
uint32 vertexOffset = vertexIndices.size();
|
||||
vertexIndices.resize(vertexOffset + m.numVertices);
|
||||
std::memcpy(vertexIndices.data() + vertexOffset, m.uniqueVertices.data(), sizeof(m.uniqueVertices));
|
||||
std::memcpy(vertexIndices.data() + vertexOffset, m.uniqueVertices.data(), m.numVertices * sizeof(uint32));
|
||||
uint32 primitiveOffset = primitiveIndices.size();
|
||||
primitiveIndices.resize(primitiveOffset + (m.numPrimitives * 3));
|
||||
std::memcpy(primitiveIndices.data() + primitiveOffset, m.primitiveLayout.data(), sizeof(m.primitiveLayout));
|
||||
std::memcpy(primitiveIndices.data() + primitiveOffset, m.primitiveLayout.data(), m.numPrimitives * 3 * sizeof(uint8));
|
||||
meshlets.add(MeshletDescription{
|
||||
.boundingBox = MeshletAABB(),
|
||||
.vertexCount = m.numVertices,
|
||||
@@ -193,9 +193,9 @@ void Seele::VertexData::init(Gfx::PGraphics graphics)
|
||||
|
||||
VertexData::VertexData()
|
||||
: idCounter(0)
|
||||
, dirty(false)
|
||||
, head(0)
|
||||
, verticesAllocated(0)
|
||||
, dirty(false)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
namespace Component
|
||||
{
|
||||
struct Mesh;
|
||||
}
|
||||
DECLARE_REF(Mesh)
|
||||
struct MeshId
|
||||
{
|
||||
uint64 id;
|
||||
@@ -60,7 +57,7 @@ public:
|
||||
uint32 indicesOffset;
|
||||
};
|
||||
void resetMeshData();
|
||||
void updateMesh(const Component::Transform& transform, const Component::Mesh& mesh);
|
||||
void updateMesh(const Component::Transform& transform, PMesh mesh);
|
||||
void loadMesh(MeshId id, Array<Meshlet> meshlets);
|
||||
void createDescriptors();
|
||||
MeshId allocateVertexData(uint64 numVertices);
|
||||
|
||||
@@ -18,22 +18,12 @@ SubAllocation::~SubAllocation()
|
||||
owner->markFree(this);
|
||||
}
|
||||
|
||||
constexpr VkDeviceMemory SubAllocation::getHandle() const
|
||||
VkDeviceMemory SubAllocation::getHandle() const
|
||||
{
|
||||
return owner->getHandle();
|
||||
}
|
||||
|
||||
constexpr VkDeviceSize SubAllocation::getSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
constexpr VkDeviceSize SubAllocation::getOffset() const
|
||||
{
|
||||
return alignedOffset;
|
||||
}
|
||||
|
||||
constexpr bool SubAllocation::isReadable() const
|
||||
bool SubAllocation::isReadable() const
|
||||
{
|
||||
return owner->isReadable();
|
||||
}
|
||||
@@ -203,30 +193,6 @@ void Allocation::markFree(PSubAllocation allocation)
|
||||
}
|
||||
}
|
||||
|
||||
constexpr VkDeviceMemory Allocation::getHandle() const
|
||||
{
|
||||
return allocatedMemory;
|
||||
}
|
||||
|
||||
constexpr void* Allocation::getMappedPointer()
|
||||
{
|
||||
if (!canMap)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
if (!isMapped)
|
||||
{
|
||||
vkMapMemory(device, allocatedMemory, 0, bytesAllocated, 0, &mappedPointer);
|
||||
isMapped = true;
|
||||
}
|
||||
return mappedPointer;
|
||||
}
|
||||
|
||||
constexpr bool Allocation::isReadable() const
|
||||
{
|
||||
return readable;
|
||||
}
|
||||
|
||||
void Allocation::flushMemory()
|
||||
{
|
||||
VkMappedMemoryRange range = {
|
||||
@@ -260,6 +226,7 @@ Allocator::Allocator(PGraphics graphics)
|
||||
VkMemoryHeap memoryHeap = memProperties.memoryHeaps[i];
|
||||
HeapInfo heapInfo;
|
||||
heapInfo.maxSize = memoryHeap.size;
|
||||
std::cout << "Creating heap " << i << " with properties " << memoryHeap.flags << " size " << memoryHeap.size << std::endl;
|
||||
heaps.add(std::move(heapInfo));
|
||||
}
|
||||
}
|
||||
@@ -293,6 +260,7 @@ OSubAllocation Allocator::allocate(const VkMemoryRequirements2 &memRequirements2
|
||||
{
|
||||
OAllocation newAllocation = new Allocation(graphics, this, requirements.size, memoryTypeIndex, properties, dedicatedInfo);
|
||||
heaps[heapIndex].inUse += newAllocation->bytesAllocated;
|
||||
std::cout << "Heap " << heapIndex << " +" <<newAllocation->bytesAllocated << ": " << (float)heaps[heapIndex].inUse / heaps[heapIndex].maxSize << "%" << std::endl;
|
||||
heaps[heapIndex].allocations.add(std::move(newAllocation));
|
||||
return heaps[heapIndex].allocations.back()->getSuballocation(requirements.size, requirements.alignment);
|
||||
}
|
||||
@@ -312,7 +280,7 @@ OSubAllocation Allocator::allocate(const VkMemoryRequirements2 &memRequirements2
|
||||
// no suitable allocations found, allocate new block
|
||||
OAllocation newAllocation = new Allocation(graphics, this, (requirements.size > MemoryBlockSize) ? requirements.size : (VkDeviceSize)MemoryBlockSize, memoryTypeIndex, properties, nullptr);
|
||||
heaps[heapIndex].inUse += newAllocation->bytesAllocated;
|
||||
heaps[heapIndex].allocations.add(std::move(newAllocation));
|
||||
std::cout << "Heap " << heapIndex << " +" <<newAllocation->bytesAllocated << ": " << (float)heaps[heapIndex].inUse / heaps[heapIndex].maxSize << "%" << std::endl; heaps[heapIndex].allocations.add(std::move(newAllocation));
|
||||
return heaps[heapIndex].allocations.back()->getSuballocation(requirements.size, requirements.alignment);
|
||||
}
|
||||
|
||||
@@ -321,12 +289,13 @@ void Allocator::free(Allocation *allocation)
|
||||
std::scoped_lock lck(lock);
|
||||
for (auto& heap : heaps)
|
||||
{
|
||||
for (uint32 i = 0; i < heap.allocations.size(); ++i)
|
||||
for (uint32 heapIndex = 0; heapIndex < heap.allocations.size(); ++heapIndex)
|
||||
{
|
||||
if (heap.allocations[i] == allocation)
|
||||
if (heap.allocations[heapIndex] == allocation)
|
||||
{
|
||||
heap.inUse -= allocation->bytesAllocated;
|
||||
heap.allocations.removeAt(i, false);
|
||||
std::cout << "Heap " << heapIndex << " -" <<allocation->bytesAllocated << ":" << (float)heaps[heapIndex].inUse / heaps[heapIndex].maxSize << "%" << std::endl;
|
||||
heap.allocations.removeAt(heapIndex, false);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -374,31 +343,21 @@ void StagingBuffer::invalidateMemory()
|
||||
allocation->invalidateMemory();
|
||||
}
|
||||
|
||||
constexpr VkDeviceMemory StagingBuffer::getMemoryHandle() const
|
||||
VkDeviceMemory StagingBuffer::getMemoryHandle() const
|
||||
{
|
||||
return allocation->getHandle();
|
||||
}
|
||||
|
||||
constexpr VkDeviceSize StagingBuffer::getOffset() const
|
||||
VkDeviceSize StagingBuffer::getOffset() const
|
||||
{
|
||||
return allocation->getOffset();
|
||||
}
|
||||
|
||||
constexpr uint64 StagingBuffer::getSize() const
|
||||
uint64 StagingBuffer::getSize() const
|
||||
{
|
||||
return allocation->getSize();
|
||||
}
|
||||
|
||||
constexpr bool StagingBuffer::isReadable() const
|
||||
{
|
||||
return readable;
|
||||
}
|
||||
|
||||
constexpr VkBufferUsageFlags StagingBuffer::getUsage() const
|
||||
{
|
||||
return usage;
|
||||
}
|
||||
|
||||
StagingManager::StagingManager(PGraphics graphics, PAllocator allocator)
|
||||
: graphics(graphics), allocator(allocator)
|
||||
{
|
||||
@@ -422,8 +381,9 @@ OStagingBuffer StagingManager::allocateStagingBuffer(uint64 size, VkBufferUsageF
|
||||
{
|
||||
//std::cout << "Reusing staging buffer" << std::endl;
|
||||
activeBuffers.add(freeBuffer);
|
||||
OStagingBuffer owner = std::move(freeBuffer);
|
||||
freeBuffers.remove(it, false);
|
||||
return std::move(freeBuffer);
|
||||
return owner;
|
||||
}
|
||||
}
|
||||
//std::cout << "Creating new stagingbuffer" << std::endl;
|
||||
@@ -463,6 +423,8 @@ OStagingBuffer StagingManager::allocateStagingBuffer(uint64 size, VkBufferUsageF
|
||||
);
|
||||
vkBindBufferMemory(graphics->getDevice(), buffer, stagingBuffer->getMemoryHandle(), stagingBuffer->getOffset());
|
||||
|
||||
std::cout << "Creating new stagingbuffer size " << stagingBuffer->getSize() << std::endl;
|
||||
|
||||
activeBuffers.add(stagingBuffer);
|
||||
|
||||
return stagingBuffer;
|
||||
@@ -471,6 +433,11 @@ OStagingBuffer StagingManager::allocateStagingBuffer(uint64 size, VkBufferUsageF
|
||||
void StagingManager::releaseStagingBuffer(OStagingBuffer buffer)
|
||||
{
|
||||
std::scoped_lock l(lock);
|
||||
if(activeBuffers.find(buffer) == activeBuffers.end())
|
||||
{
|
||||
return;
|
||||
}
|
||||
activeBuffers.remove(buffer);
|
||||
std::cout << "Releasing stagingbuffer size " << buffer->getSize() << std::endl;
|
||||
freeBuffers.add(std::move(buffer));
|
||||
}
|
||||
@@ -17,10 +17,20 @@ class SubAllocation
|
||||
public:
|
||||
SubAllocation(PAllocation owner, VkDeviceSize allocatedOffset, VkDeviceSize size, VkDeviceSize alignedOffset, VkDeviceSize allocatedSize);
|
||||
~SubAllocation();
|
||||
constexpr VkDeviceMemory getHandle() const;
|
||||
constexpr VkDeviceSize getSize() const;
|
||||
constexpr VkDeviceSize getOffset() const;
|
||||
constexpr bool isReadable() const;
|
||||
VkDeviceMemory getHandle() const;
|
||||
|
||||
constexpr VkDeviceSize getSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
constexpr VkDeviceSize getOffset() const
|
||||
{
|
||||
return alignedOffset;
|
||||
}
|
||||
|
||||
bool isReadable() const;
|
||||
|
||||
void *getMappedPointer();
|
||||
void flushMemory();
|
||||
void invalidateMemory();
|
||||
@@ -43,9 +53,30 @@ public:
|
||||
~Allocation();
|
||||
OSubAllocation getSuballocation(VkDeviceSize size, VkDeviceSize alignment);
|
||||
void markFree(PSubAllocation alloc);
|
||||
constexpr VkDeviceMemory getHandle() const;
|
||||
constexpr void* getMappedPointer();
|
||||
constexpr bool isReadable() const;
|
||||
constexpr VkDeviceMemory getHandle() const
|
||||
{
|
||||
return allocatedMemory;
|
||||
}
|
||||
|
||||
constexpr void* getMappedPointer()
|
||||
{
|
||||
if (!canMap)
|
||||
{
|
||||
return nullptr;
|
||||
}
|
||||
if (!isMapped)
|
||||
{
|
||||
vkMapMemory(device, allocatedMemory, 0, bytesAllocated, 0, &mappedPointer);
|
||||
isMapped = true;
|
||||
}
|
||||
return mappedPointer;
|
||||
}
|
||||
|
||||
constexpr bool isReadable() const
|
||||
{
|
||||
return readable;
|
||||
}
|
||||
|
||||
void flushMemory();
|
||||
void invalidateMemory();
|
||||
|
||||
@@ -134,11 +165,19 @@ public:
|
||||
{
|
||||
return buffer;
|
||||
}
|
||||
constexpr VkDeviceMemory getMemoryHandle() const;
|
||||
constexpr VkDeviceSize getOffset() const;
|
||||
constexpr uint64 getSize() const;
|
||||
constexpr bool isReadable() const;
|
||||
constexpr VkBufferUsageFlags getUsage() const;
|
||||
VkDeviceMemory getMemoryHandle() const;
|
||||
VkDeviceSize getOffset() const;
|
||||
uint64 getSize() const;
|
||||
constexpr bool isReadable() const
|
||||
{
|
||||
return readable;
|
||||
}
|
||||
|
||||
constexpr VkBufferUsageFlags getUsage() const
|
||||
{
|
||||
return usage;
|
||||
}
|
||||
|
||||
private:
|
||||
OSubAllocation allocation;
|
||||
VkBuffer buffer;
|
||||
|
||||
@@ -291,6 +291,7 @@ UniformBuffer::UniformBuffer(PGraphics graphics, const UniformBufferCreateInfo &
|
||||
|
||||
UniformBuffer::~UniformBuffer()
|
||||
{
|
||||
graphics->getStagingManager()->releaseStagingBuffer(std::move(dedicatedStagingBuffer));
|
||||
}
|
||||
|
||||
bool UniformBuffer::updateContents(const DataSource &sourceData)
|
||||
@@ -363,7 +364,12 @@ VkAccessFlags UniformBuffer::getDestAccessMask()
|
||||
ShaderBuffer::ShaderBuffer(PGraphics graphics, const ShaderBufferCreateInfo &sourceData)
|
||||
: Gfx::ShaderBuffer(graphics->getFamilyMapping(), sourceData.stride, sourceData.sourceData.size / sourceData.stride, sourceData.sourceData)
|
||||
, Vulkan::Buffer(graphics, sourceData.sourceData.size, VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, currentOwner, sourceData.dynamic)
|
||||
, dedicatedStagingBuffer(nullptr)
|
||||
{
|
||||
if(sourceData.dynamic)
|
||||
{
|
||||
dedicatedStagingBuffer = graphics->getStagingManager()->allocateStagingBuffer(sourceData.sourceData.size, VK_BUFFER_USAGE_TRANSFER_SRC_BIT);
|
||||
}
|
||||
if (sourceData.sourceData.data != nullptr)
|
||||
{
|
||||
void *data = lock();
|
||||
@@ -374,6 +380,7 @@ ShaderBuffer::ShaderBuffer(PGraphics graphics, const ShaderBufferCreateInfo &sou
|
||||
|
||||
ShaderBuffer::~ShaderBuffer()
|
||||
{
|
||||
graphics->getStagingManager()->releaseStagingBuffer(std::move(dedicatedStagingBuffer));
|
||||
}
|
||||
|
||||
bool ShaderBuffer::updateContents(const DataSource &sourceData)
|
||||
@@ -422,13 +429,13 @@ void ShaderBuffer::requestOwnershipTransfer(Gfx::QueueType newOwner)
|
||||
|
||||
void ShaderBuffer::executeOwnershipBarrier(Gfx::QueueType newOwner)
|
||||
{
|
||||
Vulkan::ShaderBuffer::executeOwnershipBarrier(newOwner);
|
||||
Vulkan::Buffer::executeOwnershipBarrier(newOwner);
|
||||
}
|
||||
|
||||
void ShaderBuffer::executePipelineBarrier(VkAccessFlags srcAccess, VkPipelineStageFlags srcStage,
|
||||
VkAccessFlags dstAccess, VkPipelineStageFlags dstStage)
|
||||
{
|
||||
Vulkan::ShaderBuffer::executePipelineBarrier(srcAccess, srcStage, dstAccess, dstStage);
|
||||
Vulkan::Buffer::executePipelineBarrier(srcAccess, srcStage, dstAccess, dstStage);
|
||||
}
|
||||
|
||||
VkAccessFlags ShaderBuffer::getSourceAccessMask()
|
||||
|
||||
@@ -34,7 +34,7 @@ protected:
|
||||
struct BufferAllocation
|
||||
{
|
||||
VkBuffer buffer;
|
||||
PSubAllocation allocation;
|
||||
OSubAllocation allocation;
|
||||
};
|
||||
PGraphics graphics;
|
||||
uint32 currentBuffer;
|
||||
@@ -140,6 +140,5 @@ protected:
|
||||
VkAccessFlags dstAccess, VkPipelineStageFlags dstStage);
|
||||
};
|
||||
DEFINE_REF(IndexBuffer)
|
||||
|
||||
}
|
||||
}
|
||||
@@ -172,6 +172,8 @@ VkDeviceCreateInfo init::DeviceCreateInfo(VkDeviceQueueCreateInfo *queueInfos, u
|
||||
createInfo.enabledLayerCount = layerCount;
|
||||
createInfo.ppEnabledLayerNames = layers;
|
||||
#else
|
||||
(void)layers;
|
||||
(void)layerCount;
|
||||
createInfo.enabledLayerCount = 0;
|
||||
layerCount = 0;
|
||||
layers = nullptr;
|
||||
|
||||
@@ -217,7 +217,7 @@ void TextureHandle::download(uint32 mipLevel, uint32 arrayLayer, uint32 face, Ar
|
||||
auto prevlayout = layout;
|
||||
changeLayout(Gfx::SE_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL);
|
||||
PCmdBuffer cmdBuffer = graphics->getQueueCommands(currentOwner)->getCommands();
|
||||
Gfx::FormatCompatibilityInfo formatInfo = Gfx::getFormatInfo(format);
|
||||
//Gfx::FormatCompatibilityInfo formatInfo = Gfx::getFormatInfo(format);
|
||||
VkBufferImageCopy region = {
|
||||
.bufferOffset = 0,
|
||||
.bufferRowLength = 0,
|
||||
|
||||
Reference in New Issue
Block a user