Use allocation size returned by image memory requirements for font image (Fixes #217)

This commit is contained in:
saschawillems 2016-08-22 12:57:40 +02:00
parent a104110b30
commit 81fc142053
2 changed files with 3 additions and 2 deletions

View file

@ -234,6 +234,7 @@ public:
uint8_t *data;
VK_CHECK_RESULT(vkMapMemory(vulkanDevice->logicalDevice, stagingBuffer.memory, 0, allocInfo.allocationSize, 0, (void **)&data));
// Size of the font texture is WIDTH * HEIGHT * 1 byte (only one channel)
memcpy(data, &font24pixels[0][0], STB_FONT_WIDTH * STB_FONT_HEIGHT);
vkUnmapMemory(vulkanDevice->logicalDevice, stagingBuffer.memory);