=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: vkd3d-shader: Fix resinfo for cube textures.

Alexandre Julliard julliard at winehq.org
Wed Jan 23 17:11:25 CST 2019


Module: vkd3d
Branch: master
Commit: 35e062b0a45434df2259911aef4438954e05d56a
URL:    https://source.winehq.org/git/vkd3d.git/?a=commit;h=35e062b0a45434df2259911aef4438954e05d56a

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Jan 23 12:46:48 2019 +0100

vkd3d-shader: Fix resinfo for cube textures.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 libs/vkd3d-shader/spirv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 7afc255..233b9b5 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -1672,7 +1672,7 @@ vkd3d_spirv_resource_type_table[] =
             SpvCapabilitySampled1D, SpvCapabilityImage1D},
     {VKD3D_SHADER_RESOURCE_TEXTURE_2DARRAY,   SpvDim2D,     1, 0, 3, 2},
     {VKD3D_SHADER_RESOURCE_TEXTURE_2DMSARRAY, SpvDim2D,     1, 1, 3, 2},
-    {VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY, SpvDimCube,   1, 0, 3, 0,
+    {VKD3D_SHADER_RESOURCE_TEXTURE_CUBEARRAY, SpvDimCube,   1, 0, 4, 0,
             SpvCapabilitySampledCubeArray, SpvCapabilityImageCubeArray},
 };
 
@@ -6516,6 +6516,8 @@ static void vkd3d_dxbc_compiler_emit_resinfo(struct vkd3d_dxbc_compiler *compile
 
     vkd3d_dxbc_compiler_prepare_image(compiler, &image, &src[1].reg, NULL, VKD3D_IMAGE_FLAG_NONE);
     size_component_count = image.resource_type_info->coordinate_component_count;
+    if (image.resource_type_info->dim == SpvDimCube)
+        --size_component_count;
     type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_UINT, size_component_count);
 
     supports_mipmaps = src[1].reg.type != VKD3DSPR_UAV && !image.resource_type_info->ms;




More information about the wine-cvs mailing list