[PATCH v2 vkd3d] vkd3d-shader: Skip generating SM1 array operations.
Eventually they will be split or otherwise transformed before getting here. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> --- v2: Report a compiler error (and fail compilation). libs/vkd3d-shader/hlsl_sm1.c | 6 ++++++ libs/vkd3d-shader/vkd3d_shader_private.h | 1 + 2 files changed, 7 insertions(+) diff --git a/libs/vkd3d-shader/hlsl_sm1.c b/libs/vkd3d-shader/hlsl_sm1.c index 8ea663dc..c13f0a2e 100644 --- a/libs/vkd3d-shader/hlsl_sm1.c +++ b/libs/vkd3d-shader/hlsl_sm1.c @@ -768,6 +768,12 @@ static void write_sm1_instructions(struct hlsl_ctx *ctx, struct vkd3d_bytecode_b FIXME("Matrix operations need to be lowered.\n"); break; } + if (instr->data_type->type == HLSL_CLASS_ARRAY) + { + hlsl_error(ctx, instr->loc, VKD3D_SHADER_ERROR_HLSL_COMPILER_ERROR, + "Compiler error, array operations need to be lowered."); + break; + } assert(instr->data_type->type == HLSL_CLASS_SCALAR || instr->data_type->type == HLSL_CLASS_VECTOR); } diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index b64c4b10..4ea6f88d 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -112,6 +112,7 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_HLSL_INVALID_RETURN = 5014, VKD3D_SHADER_ERROR_HLSL_OVERLAPPING_RESERVATIONS = 5015, VKD3D_SHADER_ERROR_HLSL_INVALID_RESERVATION = 5016, + VKD3D_SHADER_ERROR_HLSL_COMPILER_ERROR = 5299, VKD3D_SHADER_WARNING_HLSL_IMPLICIT_TRUNCATION = 5300, }; -- 2.26.3
I don't feel strongly about the compiler error question, but as it turns out I already have a patch locally which splits array copies.
On Wed, Aug 11, 2021 at 4:37 PM Zebediah Figura (she/her) <zfigura(a)codeweavers.com> wrote:
I don't feel strongly about the compiler error question, but as it turns out I already have a patch locally which splits array copies.
It's not the end of the world since it's been like this for a while and this compiler is not plugged in Wine yet, but this patch does avoid asserting when compiling some shaders.
participants (3)
-
Matteo Bruni -
Matteo Bruni -
Zebediah Figura (she/her)