Skip to content

Commit

Permalink
vulkan: remove unused constant and use correct sizes for mapping
Browse files Browse the repository at this point in the history
the local uniform stream buffer
  • Loading branch information
nikeinikei committed Mar 11, 2024
1 parent 54f27a8 commit 295fb21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/modules/graphics/vulkan/Graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2877,12 +2877,14 @@ void Graphics::mapLocalUniformData(void *data, size_t size, VkDescriptorBufferIn
if (localUniformBuffer->getUsableSize() < alignedSize)
localUniformBuffer.set(new StreamBuffer(this, BUFFERUSAGE_UNIFORM, localUniformBuffer->getSize() * 2), Acquire::NORETAIN);

auto mapInfo = localUniformBuffer->map(alignedSize);
auto mapInfo = localUniformBuffer->map(size);
memcpy(mapInfo.data, data, size);

bufferInfo.buffer = (VkBuffer)localUniformBuffer->getHandle();
bufferInfo.offset = localUniformBuffer->unmap(alignedSize);
bufferInfo.offset = localUniformBuffer->unmap(size);
bufferInfo.range = size;

localUniformBuffer->markUsed(alignedSize);
}

void Graphics::createColorResources()
Expand Down
1 change: 0 additions & 1 deletion src/modules/graphics/vulkan/Shader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace graphics
namespace vulkan
{

static const uint32_t STREAMBUFFER_DEFAULT_SIZE = 16;
static const uint32_t DESCRIPTOR_POOL_SIZE = 1000;

class BindingMapper
Expand Down

0 comments on commit 295fb21

Please sign in to comment.