]> git.tdb.fi Git - libs/gl.git/commitdiff
Use the correct aspect mask for uploading texture data
authorMikko Rasa <tdb@tdb.fi>
Wed, 1 Dec 2021 08:52:10 +0000 (10:52 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 1 Dec 2021 08:53:30 +0000 (10:53 +0200)
source/backends/vulkan/texture1d_backend.cpp
source/backends/vulkan/texture2d_backend.cpp
source/backends/vulkan/texture3d_backend.cpp
source/backends/vulkan/texturecube_backend.cpp

index d66732bf6b7c62056058b38abf7cfa6e9d01e74d..1bf60f701d720733df4f9bbe8dd1236d330cc594 100644 (file)
@@ -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;
index 518f4c2ea54d552e0d50113f8c75a7f813d6e51c..e40dfe4fedf3003287503f195f4b2426cc86cd37 100644 (file)
@@ -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;
index 44a25904161306afbb5ab52a9f24a420bb57edef..86653ef2b04796f4148050b11780e16884fc932e 100644 (file)
@@ -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);
index 98f000447c8a2f3aef69cacdfe20e929719d73dc..4d7d0baf14d053c97c3e8ddda9eabd5cdb28b7d9 100644 (file)
@@ -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;