@@ -18,7 +18,7 @@ test("Tests from previous Lux bugs", function() {
1818 var prog = { position : node_exp ,
1919 color : Shade . vec ( 0 , 0 , 0 , 1 ) } ;
2020
21- ok ( Shade . program ( prog ) , "backface culling should not crash optimizer " ) ;
21+ ok ( Shade . program ( prog ) , "discard expressions should be hoisted to fragment program " ) ;
2222
2323 var condition2 = { "type" :"gt" , "guid" :245 , "parents" :[
2424 { "type" :"swizzle{z}" , "guid" :243 , "parents" :[
@@ -27,19 +27,18 @@ test("Tests from previous Lux bugs", function() {
2727 { "type" :"cross" , "guid" :237 , "parents" :[
2828 { "type" :"dFdx" , "guid" :235 , "parents" :[
2929 { "type" :"div" , "guid" :234 , "parents" :[
30- { "type" :"swizzle{xyz}" , "guid" :232 , "parents" :[ { "type" : "reference" , "guid" : 227 } ] } ,
30+ { "type" :"swizzle{xyz}" , "guid" :232 , "parents" :[ exp ] } ,
3131 { "type" :"swizzle{w}" , "guid" :233 , "parents" :[ { "type" :"reference" , "guid" :227 } ] } ] } ] } ,
3232 { "type" :"dFdy" , "guid" :236 , "parents" :[ { "type" :"reference" , "guid" :234 } ] } ] } ] } ,
3333 { "type" :"vec" , "guid" :241 , "parents" :[
3434 { "type" :"constant" , "guid" :239 , "parents" :[ ] , "values" :[ 0 ] } ,
3535 { "type" :"constant" , "guid" :240 , "parents" :[ ] , "values" :[ 0 ] } ,
36- { "type" :"ifelse" , "guid" :231 , "parents" :[
37- { "type" :"constant" , "guid" :228 , "parents" :[ ] , "values" :[ true ] } ,
38- { "type" :"constant" , "guid" :229 , "parents" :[ ] , "values" :[ 1 ] } ,
39- { "type" :"constant" , "guid" :230 , "parents" :[ ] , "values" :[ - 1 ] } ] } ] } ] } ] } ,
36+ { "type" :"constant" , "guid" :241 , "parents" :[ ] , "values" :[ 1 ] } ] } ] } ] } ,
4037 { "type" :"constant" , "guid" :244 , "parents" :[ ] , "values" :[ 0 ] } ] } ;
41- var prog2 = { position : Shade . Debug . from_json ( { "type" :"discard_if" , "guid" :246 , "parents" :[ exp , condition2 ] } ) ,
42- color : Shade . vec ( 0 , 0 , 0 , 1 ) } ;
4338
44- ok ( Shade . program ( prog ) , "backface culling should not crash optimizer" ) ;
39+ var prog2 = { position : Shade . vec ( 0 , 0 , 0 , 0 ) ,
40+ color : Shade . Debug . from_json ( condition2 ) . ifelse ( Shade . vec ( 1 , 0 , 0 , 0 ) ,
41+ Shade . vec ( 0 , 1 , 0 , 0 ) ) } ;
42+
43+ ok ( Shade . program ( prog2 ) , "backface culling should not crash optimizer" ) ;
4544} ) ;
0 commit comments