Hello,
April 19, 2022 6:44 AM, "Giovanni Mascellani" gmascellani@codeweavers.com wrote:
Hi,
Il 18/04/22 08:34, Giovanni Mascellani ha scritto:
Otherwise we can get failed assertions: assert(node->type == HLSL_IR_LOAD); because broadcasts to these types are not implemented yet. Signed-off-by: Francisco Casasfcasas@codeweavers.com
libs/vkd3d-shader/hlsl_codegen.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c index 73e3b73f..2104c48b 100644 --- a/libs/vkd3d-shader/hlsl_codegen.c +++ b/libs/vkd3d-shader/hlsl_codegen.c @@ -628,6 +628,13 @@ static bool split_array_copies(struct hlsl_ctx *ctx, struct hlsl_ir_node *instr, element_type = type->e.array.type; element_size = hlsl_type_get_array_element_reg_size(element_type);
- if (rhs->type != HLSL_IR_LOAD)
- {
- hlsl_error(ctx, &instr->loc, VKD3D_SHADER_ERROR_HLSL_NOT_IMPLEMENTED,
- "array store rhs is not HLSL_IR_LOAD, missing broadcast?");
- return false;
- }
If the problem here is that the compiler is missing a feature, then I don't think hlsl_error() is appropriate, because that would be for a user error. I guess hlsl_fixme() is what should be used here.
I see, I think you are right.
Also, notice that the error message is usually formatted with a leading upper case letter and with a trailing dot (but no trailing newline).
Okay, I will try to remember that. I think I didn't pay too much attention to this patch because I just wrote it so that the tests in the following patch of my branch:
725ae863 fcasas tests: Test complex broadcasts.
didn't fail the aforementioned assertion.
Last, I am not completely sure of what the issue is here, but if eventually properly implementing other parts of the compiler will make this code useless, then I'd add a comment saying that.
Yes, this issue stops happening with:
6d2a14a0 fcasas vkd3d-shader/hlsl: Lower complex broadcasts.