[PATCH vkd3d v2 4/5] vkd3d-shader/hlsl: Handle texture types in hlsl_type_to_string().
Giovanni Mascellani
gmascellani at codeweavers.com
Thu Oct 7 06:58:47 CDT 2021
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Il 06/10/21 16:45, Zebediah Figura ha scritto:
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
> libs/vkd3d-shader/hlsl.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
> diff --git a/libs/vkd3d-shader/hlsl.c b/libs/vkd3d-shader/hlsl.c
> index 1f23a478c..87841e0e4 100644
> --- a/libs/vkd3d-shader/hlsl.c
> +++ b/libs/vkd3d-shader/hlsl.c
> @@ -886,6 +886,35 @@ struct vkd3d_string_buffer *hlsl_type_to_string(struct hlsl_ctx *ctx, const stru
> vkd3d_string_buffer_printf(string, "<anonymous struct>");
> return string;
>
> + case HLSL_CLASS_OBJECT:
> + {
> + static const char dimensions[5][HLSL_SAMPLER_DIM_MAX + 1] =
> + {
> + [HLSL_SAMPLER_DIM_1D] = "1D",
> + [HLSL_SAMPLER_DIM_2D] = "2D",
> + [HLSL_SAMPLER_DIM_3D] = "3D",
> + [HLSL_SAMPLER_DIM_CUBE] = "Cube"
> + };
> +
> + switch (type->base_type)
> + {
> + case HLSL_TYPE_TEXTURE:
> + if (type->sampler_dim == HLSL_SAMPLER_DIM_GENERIC)
> + {
> + vkd3d_string_buffer_printf(string, "texture");
> + return string;
> + }
> +
> + vkd3d_string_buffer_printf(string, "Texture%s<%s%u>", dimensions[type->sampler_dim],
> + base_types[type->e.resource_format->base_type], type->e.resource_format->dimx);
> + return string;
> +
> + default:
> + vkd3d_string_buffer_printf(string, "<unexpected type>");
> + return string;
> + }
> + }
> +
> default:
> vkd3d_string_buffer_printf(string, "<unexpected type>");
> return string;
>
More information about the wine-devel
mailing list