maps work again

This commit is contained in:
Dynamitos
2025-03-25 18:10:32 +01:00
parent a91aeab309
commit edfe34a394
3 changed files with 113 additions and 137 deletions
+1 -1
View File
@@ -102,7 +102,7 @@ void BufferAllocation::updateContents(uint64 regionOffset, uint64 regionSize, vo
.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT,
.usage = VMA_MEMORY_USAGE_AUTO,
};
OBufferAllocation staging = new BufferAllocation(graphics, "UpdateStaging", stagingInfo, stagingAlloc, Gfx::QueueType::GRAPHICS);
OBufferAllocation staging = new BufferAllocation(graphics, fmt::format("{0}UpdateStaging", name), stagingInfo, stagingAlloc, Gfx::QueueType::GRAPHICS);
uint8* data;
VK_CHECK(vmaMapMemory(graphics->getAllocator(), staging->allocation, (void**)&data));
+3 -4
View File
@@ -201,7 +201,7 @@ DescriptorSet::~DescriptorSet() {}
void DescriptorSet::updateConstants(const std::string& mappingName, uint32 offset, void* data) {
std::memcpy(constantData.data() + owner->getLayout()->mappings[mappingName].constantOffset, (char*)data + offset,
owner->getLayout()->mappings[name].constantSize);
owner->getLayout()->mappings[mappingName].constantSize);
}
void DescriptorSet::updateBuffer(const std::string& mappingName, uint32 index, Gfx::PShaderBuffer shaderBuffer) {
@@ -418,8 +418,7 @@ void DescriptorSet::updateAccelerationStructure(const std::string& mappingName,
void DescriptorSet::writeChanges() {
if (constantData.size() > 0) {
if (constantsBuffer != nullptr)
{
if (constantsBuffer != nullptr) {
graphics->getDestructionManager()->queueResourceForDestruction(std::move(constantsBuffer));
}
constantsBuffer = new BufferAllocation(graphics, owner->getLayout()->getName(),
@@ -452,7 +451,7 @@ void DescriptorSet::writeChanges() {
.pBufferInfo = &bufferInfos.back(),
});
}
if (writeDescriptors.size() > 0) {
if (isCurrentlyBound()) {
std::cout << "Descriptor currently bound, allocate a new one instead" << std::endl;