Skip to content

Fix warning X4000: use of potentially uninitialized variable#2

Open
Antoshidza wants to merge 1 commit intoalexanderameye:mainfrom
Antoshidza:main
Open

Fix warning X4000: use of potentially uninitialized variable#2
Antoshidza wants to merge 1 commit intoalexanderameye:mainfrom
Antoshidza:main

Conversation

@Antoshidza
Copy link

In unity 6 on Vulkan graphics API there is a warning: Shader warning in 'StencilDebug': use of potentially uninitialized variable (draw_digit) at kernel StencilDebug at StencilDebug.compute(39) (on vulkan) which happens because hlsl compiler is crazy and doesn't understand next code structure

if(predicate)
    return x;
return y;

It wants instead

if(predicate)
    return x;
else 
    return y;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant