Skip to content

Commit

Permalink
Splitter : Fix false positive error when varying is not written by ve…
Browse files Browse the repository at this point in the history
…rtex shader but do not require initialization
  • Loading branch information
TothBenoit committed Oct 16, 2024
1 parent 0d0690b commit a9d88b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hxsl/Splitter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@ class Splitter {
case Var:
if( !vertex ) {
var i = vvars.get(v.origin.id);
if( i != null && i.v.kind == Input ) return;
if( i == null || i.write == 0 ) throw new Error("Varying " + v.v.name + " is not written by vertex shader",p);
if( i != null && i.v.kind == Input )
return;
if( v.requireInit && ( i == null || i.write == 0 ) )
throw new Error("Varying " + v.v.name + " is not written by vertex shader",p);
}
default:
}
Expand Down

0 comments on commit a9d88b6

Please sign in to comment.