csyonghe / Spire

Other
174 stars 22 forks source link

Fix bug introduced in 1eee18256190996eddf8c1613ef3fffae0caa372 #70

Closed tangent-vector closed 7 years ago

tangent-vector commented 7 years ago

That change had removed StructSymbol from the front-end, and mistakenly removed the logic in CodeGenerator::VisitStruct that actually added an ILStructType to the list of struct types to be emitted.

This change fixes the issue, and also adds a small test case that actually uses struct types in a few ways. This test currently doesn't help a whole lot, though, because we don't have any end-to-end testing of generating code (in this case, just checking that the generated GLSL is okay would help). Doing a better job with our tests should be a distinct change, though.

With this fix, the SpireMiniEngine project now seems to run correctly again.