Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion etna/source/BlockingTransferHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ BlockingTransferHelper::BlockingTransferHelper(CreateInfo info)
.name = "BlockingTransferHelper::stagingBuffer",
})}
{
stagingBuffer.map();
}

void BlockingTransferHelper::uploadBuffer(
Expand Down
8 changes: 1 addition & 7 deletions etna/source/Buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@ Buffer::Buffer(VmaAllocator alloc, CreateInfo info)
vk::to_string(static_cast<vk::Result>(retcode)));
buffer = vk::Buffer(buf);

// make map() forbidden for the user if allocationCreate has VMA_ALLOCATION_CREATE_MAPPED_BIT
if ((info.allocationCreate & VMA_ALLOCATION_CREATE_MAPPED_BIT) != 0u)
mapped = map();

mapped = reinterpret_cast<std::byte*>(allocInfo.pMappedData);
ETNA_VERIFY(mapped == nullptr || info.allocationCreate & VMA_ALLOCATION_CREATE_MAPPED_BIT);

etna::set_debug_name(buffer, info.name.data());
Expand Down Expand Up @@ -88,9 +85,6 @@ void Buffer::reset()
if (!buffer)
return;

if (mapped != nullptr)
unmap();

vmaDestroyBuffer(allocator, VkBuffer(buffer), allocation);
allocator = {};
allocation = {};
Expand Down
4 changes: 1 addition & 3 deletions etna/source/Etna.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,7 @@ Image create_image_from_bytes(Image::CreateInfo info, vk::CommandBuffer cmd_buf,
.name = "tmp_staging_buf",
});

auto* mappedMem = stagingBuf.map();
std::memcpy(mappedMem, data, fullSize);
stagingBuf.unmap();
std::memcpy(stagingBuf.data(), data, fullSize);

ETNA_CHECK_VK_RESULT(cmd_buf.begin(vk::CommandBufferBeginInfo{
.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit,
Expand Down
1 change: 0 additions & 1 deletion etna/source/PerFrameTransferHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ PerFrameTransferHelper::PerFrameTransferHelper(CreateInfo info)
stagingSize <= MAX_STAGING_SIZE,
"PerFrameTransferHelper: total staging size can not exceed {} * multibuffering.",
MAX_STAGING_SIZE);
stagingBuffer.iterate([](auto& buf) { buf.map(); });
}

void PerFrameTransferHelper::UploadProcessor::finish()
Expand Down
Loading