[PATCH vkd3d 6/6] vkd3d-shader: Treat global variables as written to only if they are uniform.
Matteo Bruni
matteo.mystral at gmail.com
Tue Mar 23 16:35:40 CDT 2021
On Mon, Mar 22, 2021 at 11:03 PM Zebediah Figura
<zfigura at codeweavers.com> wrote:
>
> Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
> ---
> libs/vkd3d-shader/hlsl_codegen.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/libs/vkd3d-shader/hlsl_codegen.c b/libs/vkd3d-shader/hlsl_codegen.c
> index 595e7da6..21bd9ab8 100644
> --- a/libs/vkd3d-shader/hlsl_codegen.c
> +++ b/libs/vkd3d-shader/hlsl_codegen.c
> @@ -398,7 +398,8 @@ static void compute_liveness(struct hlsl_ctx *ctx, struct hlsl_ir_function_decl
>
> LIST_FOR_EACH_ENTRY(var, &ctx->globals->vars, struct hlsl_ir_var, scope_entry)
> {
> - var->first_write = 1;
> + if (var->is_uniform)
> + var->first_write = 1;
> }
Some light testing suggests that static variables are implicitly
initialized to 0, like in C.
More information about the wine-devel
mailing list