From 40f5c35837a4dbe663fcd347ca9e8852de35fb72 Mon Sep 17 00:00:00 2001 From: Anders Leino Date: Tue, 19 Nov 2024 15:17:18 +0200 Subject: [PATCH] wgpu: Specify cube face when writing cube textures This helps to address https://github.com/shader-slang/slang/issues/4943 --- src/wgpu/wgpu-texture.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wgpu/wgpu-texture.cpp b/src/wgpu/wgpu-texture.cpp index 877176a..30f0a1a 100644 --- a/src/wgpu/wgpu-texture.cpp +++ b/src/wgpu/wgpu-texture.cpp @@ -102,7 +102,7 @@ Result DeviceImpl::createTexture(const TextureDesc& desc_, const SubresourceData WGPUImageCopyTexture imageCopyTexture = {}; imageCopyTexture.texture = texture->m_texture; imageCopyTexture.mipLevel = mipLevel; - imageCopyTexture.origin = {0, 0, 0}; + imageCopyTexture.origin = {0, 0, desc.type == TextureType::TextureCube ? arrayLayer : 0U}; imageCopyTexture.aspect = WGPUTextureAspect_All; WGPUExtent3D writeSize = {};