From: "Zebediah Figura (she/her)" Subject: Re: [PATCH vkd3d 4/6] vkd3d-shader/hlsl: Parse bitwise AND. Message-Id: <320f0f3c-8c06-91a1-e837-7cb96621539c@codeweavers.com> Date: Tue, 25 Jan 2022 13:08:58 -0600 In-Reply-To: <20220125110753.1358613-4-gmascellani@codeweavers.com> References: <20220125110753.1358613-1-gmascellani@codeweavers.com> <20220125110753.1358613-4-gmascellani@codeweavers.com> On 1/25/22 05:07, Giovanni Mascellani wrote: > Signed-off-by: Giovanni Mascellani > --- > libs/vkd3d-shader/hlsl.y | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/libs/vkd3d-shader/hlsl.y b/libs/vkd3d-shader/hlsl.y > index cff56a74..873ba29d 100644 > --- a/libs/vkd3d-shader/hlsl.y > +++ b/libs/vkd3d-shader/hlsl.y > @@ -1057,6 +1057,30 @@ static struct list *add_binary_arithmetic_expr_merge(struct hlsl_ctx *ctx, struc > return list1; > } > > +static struct hlsl_ir_expr *add_binary_bitwise_expr(struct hlsl_ctx *ctx, struct list *instrs, > + enum hlsl_ir_expr_op op, struct hlsl_ir_node *arg1, struct hlsl_ir_node *arg2, > + const struct vkd3d_shader_location *loc) > +{ > + if (arg1->data_type->base_type == HLSL_TYPE_HALF || arg1->data_type->base_type == HLSL_TYPE_FLOAT) > + return NULL; > + if (arg2->data_type->base_type == HLSL_TYPE_HALF || arg2->data_type->base_type == HLSL_TYPE_FLOAT) > + return NULL; Shouldn't this emit some sort of parse error? > + > + return add_binary_arithmetic_expr(ctx, instrs, op, arg1, arg2, loc); > +}