vkd3d-shader/hlsl: Implement tex3Dproj().

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-11-09 20:04:35 +01:00 committed by Alexandre Julliard
parent dd6a9135f4
commit 81ff57e07c
Notes: Alexandre Julliard 2023-11-10 21:38:12 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Francisco Casas (@fcasas)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/219

View File

@ -3572,7 +3572,8 @@ static bool intrinsic_tex(struct hlsl_ctx *ctx, const struct parse_initializer *
return false; 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], if (!(coords = add_implicit_conversion(ctx, params->instrs, params->args[1],
hlsl_get_vector_type(ctx, HLSL_TYPE_FLOAT, 4), loc))) 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); 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, static bool intrinsic_texCUBE(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc) const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{ {
@ -3870,6 +3877,7 @@ intrinsic_functions[] =
{"tex2Dlod", 2, false, intrinsic_tex2Dlod}, {"tex2Dlod", 2, false, intrinsic_tex2Dlod},
{"tex2Dproj", 2, false, intrinsic_tex2Dproj}, {"tex2Dproj", 2, false, intrinsic_tex2Dproj},
{"tex3D", -1, false, intrinsic_tex3D}, {"tex3D", -1, false, intrinsic_tex3D},
{"tex3Dproj", 2, false, intrinsic_tex3Dproj},
{"texCUBE", -1, false, intrinsic_texCUBE}, {"texCUBE", -1, false, intrinsic_texCUBE},
{"transpose", 1, true, intrinsic_transpose}, {"transpose", 1, true, intrinsic_transpose},
{"trunc", 1, true, intrinsic_trunc}, {"trunc", 1, true, intrinsic_trunc},