From 9117629e353f02bec1273ea4844c9356d35fde83 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 19 Mar 2024 09:28:45 +0100 Subject: [PATCH] vkd3d-shader/fx: Handle "half" type for fx_2_0 parameters. Signed-off-by: Nikolay Sivov --- Makefile.am | 1 + libs/vkd3d-shader/fx.c | 1 + tests/hlsl/effect-variables-fx_2.shader_test | 11 +++++++++++ 3 files changed, 13 insertions(+) create mode 100644 tests/hlsl/effect-variables-fx_2.shader_test diff --git a/Makefile.am b/Makefile.am index 01e94fa8..68e8642e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -96,6 +96,7 @@ vkd3d_shader_tests = \ tests/hlsl/effect-technique-fx_2.shader_test \ tests/hlsl/effect-technique-fx_4.shader_test \ tests/hlsl/effect-technique-fx_5.shader_test \ + tests/hlsl/effect-variables-fx_2.shader_test \ tests/hlsl/entry-point-semantics.shader_test \ tests/hlsl/exp.shader_test \ tests/hlsl/expr-indexing.shader_test \ diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index ce47867b..0bc5a8c3 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -643,6 +643,7 @@ static uint32_t write_fx_2_parameter(const struct hlsl_type *type, const char *n switch (type->base_type) { + case HLSL_TYPE_HALF: case HLSL_TYPE_FLOAT: case HLSL_TYPE_BOOL: case HLSL_TYPE_INT: diff --git a/tests/hlsl/effect-variables-fx_2.shader_test b/tests/hlsl/effect-variables-fx_2.shader_test new file mode 100644 index 00000000..ab992253 --- /dev/null +++ b/tests/hlsl/effect-variables-fx_2.shader_test @@ -0,0 +1,11 @@ +[require] +shader model < 3.0 + +[effect] +bool _bool; +float _float; +half _half; + +technique +{ +}