vkd3d-shader/hlsl: Add texCUBE() function.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov 2023-08-25 10:39:21 +02:00 committed by Alexandre Julliard
parent 269747dbf3
commit c39c5b3907
Notes: Alexandre Julliard 2023-08-29 22:15:45 +02:00
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/314
2 changed files with 18 additions and 0 deletions

View File

@ -3478,6 +3478,12 @@ static bool intrinsic_tex3D(struct hlsl_ctx *ctx,
return intrinsic_tex(ctx, params, loc, "tex3D", HLSL_SAMPLER_DIM_3D);
}
static bool intrinsic_texCUBE(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{
return intrinsic_tex(ctx, params, loc, "texCUBE", HLSL_SAMPLER_DIM_CUBE);
}
static bool intrinsic_transpose(struct hlsl_ctx *ctx,
const struct parse_initializer *params, const struct vkd3d_shader_location *loc)
{
@ -3648,6 +3654,7 @@ intrinsic_functions[] =
{"step", 2, true, intrinsic_step},
{"tex2D", -1, false, intrinsic_tex2D},
{"tex3D", -1, false, intrinsic_tex3D},
{"texCUBE", -1, false, intrinsic_texCUBE},
{"transpose", 1, true, intrinsic_transpose},
{"trunc", 1, true, intrinsic_trunc},
};

View File

@ -49,3 +49,14 @@ float4 main() : sv_target
{
return tex2D(s, float2(0.0, 0.0)) + tex3D(s, float3(0.0, 0.0, 0.0));
}
[require]
options: backcompat
[pixel shader]
samplerCUBE s;
float4 main() : sv_target
{
return texCUBE(s, float3(0.0, 0.0, 0.0));
}