From: Mikko Rasa Date: Wed, 1 Dec 2021 08:52:10 +0000 (+0200) Subject: Use the correct aspect mask for uploading texture data X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=3abde92c3780568c792169e48741f6c5699aa0e7;p=libs%2Fgl.git Use the correct aspect mask for uploading texture data --- diff --git a/source/backends/vulkan/texture1d_backend.cpp b/source/backends/vulkan/texture1d_backend.cpp index d66732bf..1bf60f70 100644 --- a/source/backends/vulkan/texture1d_backend.cpp +++ b/source/backends/vulkan/texture1d_backend.cpp @@ -40,7 +40,7 @@ void VulkanTexture1D::sub_image(unsigned level, int x, unsigned wd, const void * VkBufferImageCopy region = { }; region.bufferOffset = src_off; - region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + region.imageSubresource.aspectMask = get_vulkan_aspect(get_components(storage_fmt)); region.imageSubresource.mipLevel = level; region.imageSubresource.baseArrayLayer = 0; region.imageSubresource.layerCount = 1; diff --git a/source/backends/vulkan/texture2d_backend.cpp b/source/backends/vulkan/texture2d_backend.cpp index 518f4c2e..e40dfe4f 100644 --- a/source/backends/vulkan/texture2d_backend.cpp +++ b/source/backends/vulkan/texture2d_backend.cpp @@ -41,7 +41,7 @@ void VulkanTexture2D::sub_image(unsigned level, int x, int y, unsigned wd, unsig VkBufferImageCopy region = { }; region.bufferOffset = src_off; - region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + region.imageSubresource.aspectMask = get_vulkan_aspect(get_components(storage_fmt)); region.imageSubresource.mipLevel = level; region.imageSubresource.baseArrayLayer = 0; region.imageSubresource.layerCount = 1; diff --git a/source/backends/vulkan/texture3d_backend.cpp b/source/backends/vulkan/texture3d_backend.cpp index 44a25904..86653ef2 100644 --- a/source/backends/vulkan/texture3d_backend.cpp +++ b/source/backends/vulkan/texture3d_backend.cpp @@ -46,7 +46,7 @@ void VulkanTexture3D::sub_image(unsigned level, int x, int y, int z, unsigned wd VkBufferImageCopy region = { }; region.bufferOffset = src_off; - region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + region.imageSubresource.aspectMask = get_vulkan_aspect(get_components(storage_fmt)); region.imageSubresource.mipLevel = level; region.imageSubresource.baseArrayLayer = (is_array() ? z : 0); region.imageSubresource.layerCount = (is_array() ? dp : 1); diff --git a/source/backends/vulkan/texturecube_backend.cpp b/source/backends/vulkan/texturecube_backend.cpp index 98f00044..4d7d0baf 100644 --- a/source/backends/vulkan/texturecube_backend.cpp +++ b/source/backends/vulkan/texturecube_backend.cpp @@ -43,7 +43,7 @@ void VulkanTextureCube::sub_image(unsigned face, unsigned level, int x, int y, u VkBufferImageCopy region = { }; region.bufferOffset = src_off; - region.imageSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + region.imageSubresource.aspectMask = get_vulkan_aspect(get_components(storage_fmt)); region.imageSubresource.mipLevel = level; region.imageSubresource.baseArrayLayer = face; region.imageSubresource.layerCount = 1;