Vulkan: Fix sample count when uploading layered textures

When uploading layered textures it was assumed that the data uploaded
had the data for all layers and ignored the given extent.
This commit is contained in:
Jeroen Bakker
2024-06-03 13:51:11 +02:00
parent 8077411d59
commit 6ec64cb039

View File

@@ -353,7 +353,7 @@ void VKTexture::update_sub(
/* Vulkan images cannot be directly mapped to host memory and requires a staging buffer. */
VKContext &context = *VKContext::get();
int layers = vk_layer_count(1);
size_t sample_len = size_t(extent.x) * extent.y * extent.z * layers;
size_t sample_len = size_t(extent.x) * extent.y * extent.z;
size_t device_memory_size = sample_len * to_bytesize(device_format_);
if (is_compressed) {