[PATCH vkd3d v7 5/6] vkd3d-shader/hlsl: Handle conditionals in copy propagation.

Giovanni Mascellani gmascellani at codeweavers.com
Thu Nov 18 03:01:38 CST 2021


Hi,

On 18/11/21 05:18, Zebediah Figura (she/her) wrote:
>>> +    if (!hlsl_array_reserve(ctx, (void**)&state->variables, 
>>> &state->capacity, state->depth + 2, sizeof(*state->variables)))
>>
>> "state->depth + 2" looks wrong; is it?
> 
> Wait, never mind, I see why this looks wrong. The fact that "depth" is 
> 1-biased seems confusing to me, though...

I agree it is a bit strange, but I think it's correct too.

As whether to store the recursion depth or the number of stack levels 
(which is depth + 1), I think it's a matter of tastes. If you want "+ 1" 
here, you'll have a lot of "- 1" in other places (mostly _get_variable 
and _create_variable). I like depth more (mostly because I like to 
initialize things to zero), but I am flexible here.

Giovanni.



More information about the wine-devel mailing list