[PATCH vkd3d 6/6] vkd3d-shader/hlsl: Write SM4 addition instructions.

Matteo Bruni matteo.mystral at gmail.com
Thu Aug 26 11:36:25 CDT 2021


On Thu, Aug 26, 2021 at 6:26 PM Zebediah Figura (she/her)
<zfigura at codeweavers.com> wrote:
>
> On 8/26/21 10:48 AM, Matteo Bruni wrote:
> > On Tue, Aug 24, 2021 at 8:19 AM Zebediah Figura <zfigura at codeweavers.com> wrote:
> >>
> >> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> >> ---
> >>   Makefile.am                  |  1 -
> >>   libs/vkd3d-shader/hlsl_sm4.c | 62 ++++++++++++++++++++++++++++++++++++
> >>   2 files changed, 62 insertions(+), 1 deletion(-)
> >
> >> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
> >> index 27058fef..32a4eda1 100644
> >> --- a/libs/vkd3d-shader/hlsl_sm4.c
> >> +++ b/libs/vkd3d-shader/hlsl_sm4.c
> >
> >> +        default:
> >> +        {
> >> +            struct vkd3d_string_buffer *string;
> >> +
> >> +            if ((string = hlsl_type_to_string(ctx, expr->node.data_type)))
> >> +                hlsl_fixme(ctx, expr->node.loc, "SM4 %s expression.", string->buffer);
> >> +            hlsl_release_string_buffer(ctx, string);
> >> +            break;
> >> +        }
> >> +    }
> >> +}
> >
> > This means that the hlsl_fixme(), and thus the compilation failure,
> > only happens when hlsl_type_to_string() succeeds. It's a pretty
> > theoretical issue but still a bit surprising.
> >
>
> That's true in general. On the other hand, if hlsl_type_to_string fails,
> it'll set ctx->result to VKD3D_ERROR_OUT_OF_MEMORY, which
> vkd3d_shader_compile() will return. Since we almost certainly can't
> print an error at that point anyway, I think that qualifies as the best
> we can do.

Ah, indeed. That's certainly good enough for me.



More information about the wine-devel mailing list