[PATCH vkd3d 4/6] vkd3d-shader/hlsl: Write the RDEF section.

Matteo Bruni matteo.mystral at gmail.com
Thu Aug 19 10:31:07 CDT 2021


On Tue, Aug 17, 2021 at 7:40 PM Zebediah Figura <zfigura at codeweavers.com> wrote:
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
>  include/vkd3d_d3dcommon.idl              |  45 ++++++++
>  libs/vkd3d-shader/hlsl_sm4.c             | 141 +++++++++++++++++++++++
>  libs/vkd3d-shader/vkd3d_shader_private.h |   2 +
>  3 files changed, 188 insertions(+)
>

> diff --git a/libs/vkd3d-shader/hlsl_sm4.c b/libs/vkd3d-shader/hlsl_sm4.c
> index c9a427d8..e9cfa2b6 100644
> --- a/libs/vkd3d-shader/hlsl_sm4.c
> +++ b/libs/vkd3d-shader/hlsl_sm4.c

> +    i = 0;
> +    LIST_FOR_EACH_ENTRY(cbuffer, &ctx->buffers, struct hlsl_buffer, entry)
> +    {
> +        size_t vars_start = bytecode_get_size(&buffer);
> +        const struct hlsl_ir_var *var;
> +
> +        if (!cbuffer->reg.allocated)
> +            continue;
> +
> +        set_u32(&buffer, cbuffers_offset + (i++ * 6 + 2) * sizeof(uint32_t), vars_start);
> +
> +        LIST_FOR_EACH_ENTRY(var, &ctx->extern_vars, struct hlsl_ir_var, extern_entry)
> +        {
> +            if (var->is_uniform && var->buffer == cbuffer)
> +            {
> +                uint32_t flags = 0;
> +
> +                if (var->last_read)
> +                    flags |= D3D_SVF_USED;
> +
> +                put_u32(&buffer, 0); /* name */

Mostly for my own reference, the variable name is left unset here. It
will be filled in the next patch, together with the type.



More information about the wine-devel mailing list