[PATCH vkd3d 6/6] vkd3d-shader: Treat global variables as written to only if they are uniform.
Zebediah Figura (she/her)
zfigura at codeweavers.com
Tue Mar 23 16:59:50 CDT 2021
On 3/23/21 4:35 PM, Matteo Bruni wrote:
> 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.
>
Yes, that's correct. I believe we should handle that by generating
explicit assignments, which means that there's no need to handle it
specially when calculating liveness.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210323/259adf3d/attachment.sig>
More information about the wine-devel
mailing list