From 3a0e08e89a3ce880df1c4ee9fd32481e9e933bf8 Mon Sep 17 00:00:00 2001 From: tuchs Date: Sat, 25 Jun 2022 22:54:26 +0200 Subject: [PATCH] Fix gles buffer-texture copy for 2d arrays --- wgpu-hal/src/gles/queue.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/wgpu-hal/src/gles/queue.rs b/wgpu-hal/src/gles/queue.rs index 2bac960184..6cdccd9141 100644 --- a/wgpu-hal/src/gles/queue.rs +++ b/wgpu-hal/src/gles/queue.rs @@ -428,7 +428,7 @@ impl super::Queue { } }; match dst_target { - glow::TEXTURE_3D | glow::TEXTURE_2D_ARRAY => { + glow::TEXTURE_3D => { gl.tex_sub_image_3d( dst_target, copy.texture_base.mip_level as i32, @@ -443,6 +443,21 @@ impl super::Queue { unpack_data, ); } + glow::TEXTURE_2D_ARRAY => { + gl.tex_sub_image_3d( + dst_target, + copy.texture_base.mip_level as i32, + copy.texture_base.origin.x as i32, + copy.texture_base.origin.y as i32, + copy.texture_base.array_layer as i32, + copy.size.width as i32, + copy.size.height as i32, + copy.size.depth as i32, + format_desc.external, + format_desc.data_type, + unpack_data, + ); + } glow::TEXTURE_2D => { gl.tex_sub_image_2d( dst_target,