[PATCH v2 0/1] MR314: vkd3d-shader/hlsl: Add texCUBE() function.
Included test is only to verify that function compiles, and is simple enough - using either texld or sample. -- v2: vkd3d-shader/hlsl: Add texCUBE() function. https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/314
From: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> --- libs/vkd3d-shader/hlsl.y | 7 +++++++ tests/hlsl/sampler.shader_test | 11 +++++++++++ 2 files changed, 18 insertions(+) diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y index 43ea4b4d0..73257b8e4 100644 --- a/libs/vkd3d-shader/hlsl.y +++ b/libs/vkd3d-shader/hlsl.y @@ -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}, }; diff --git a/tests/hlsl/sampler.shader_test b/tests/hlsl/sampler.shader_test index 628c31868..8b1c550ce 100644 --- a/tests/hlsl/sampler.shader_test +++ b/tests/hlsl/sampler.shader_test @@ -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)); +} -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/314
This merge request was approved by Henri Verbeet. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/314
participants (3)
-
Henri Verbeet (@hverbeet) -
Nikolay Sivov -
Nikolay Sivov (@nsivov)