From 81ff57e07c88f70b9d1f2dff595037288cdc48df Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Thu, 9 Nov 2023 20:04:35 +0100 Subject: [PATCH] vkd3d-shader/hlsl: Implement tex3Dproj(). Signed-off-by: Nikolay Sivov --- libs/vkd3d-shader/hlsl.y | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index e70ccf08..b5fe4126 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -3572,7 +3572,8 @@ static bool intrinsic_tex(struct hlsl_ctx *ctx, const struct parse_initializer * return false; } } - else if (!strcmp(name, "tex2Dproj")) + else if (!strcmp(name, "tex2Dproj") + || !strcmp(name, "tex3Dproj")) { if (!(coords = add_implicit_conversion(ctx, params->instrs, params->args[1], hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 4), loc))) @@ -3688,6 +3689,12 @@ static bool intrinsic_tex3D(struct hlsl_ctx *ctx, return intrinsic_tex(ctx, params, loc, "tex3D", HLSL_SAMPLER_DIM_3D); } +static bool intrinsic_tex3Dproj(struct hlsl_ctx *ctx, + const struct parse_initializer *params, const struct vkd3d_shader_location *loc) +{ + return intrinsic_tex(ctx, params, loc, "tex3Dproj", HLSL_SAMPLER_DIM_3D); +} + static bool intrinsic_texCUBE(struct hlsl_ctx *ctx, const struct parse_initializer *params, const struct vkd3d_shader_location *loc) { @@ -3870,6 +3877,7 @@ intrinsic_functions[] = {"tex2Dlod", 2, false, intrinsic_tex2Dlod}, {"tex2Dproj", 2, false, intrinsic_tex2Dproj}, {"tex3D", -1, false, intrinsic_tex3D}, + {"tex3Dproj", 2, false, intrinsic_tex3Dproj}, {"texCUBE", -1, false, intrinsic_texCUBE}, {"transpose", 1, true, intrinsic_transpose}, {"trunc", 1, true, intrinsic_trunc},