From 60ce81112b14eb1e0e3ded9ea3598bd60063ee90 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Tue, 13 Aug 2024 23:59:41 +0200 Subject: [PATCH] vkd3d-shader/fx: Support string annotations for fx_4+. Signed-off-by: Nikolay Sivov --- libs/vkd3d-shader/fx.c | 4 ++++ tests/hlsl/strings.shader_test | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/fx.c b/libs/vkd3d-shader/fx.c index 3547b7d4..4a364421 100644 --- a/libs/vkd3d-shader/fx.c +++ b/libs/vkd3d-shader/fx.c @@ -1360,6 +1360,10 @@ static void write_fx_4_annotation(struct hlsl_ir_var *var, struct fx_write_conte offset = write_fx_4_default_value(var->data_type, var->default_values, fx); put_u32(buffer, offset); } + else if (type->class == HLSL_CLASS_STRING) + { + write_fx_4_string_initializer(var, fx); + } else { hlsl_fixme(ctx, &var->loc, "Writing annotations for type class %u is not implemented.", type->class); diff --git a/tests/hlsl/strings.shader_test b/tests/hlsl/strings.shader_test index 6128ae8c..5cbc384f 100644 --- a/tests/hlsl/strings.shader_test +++ b/tests/hlsl/strings.shader_test @@ -110,7 +110,7 @@ float4 main() : sv_target { return 0; } shader model >= 5.0 shader model < 6.0 -[effect todo] +[effect] float4 f < string a = "\nAAA\tBBB\rCCC\fDDD\vEEE\sFFF";