https://github.com/shader-slang/slang
Revision 1b93da040ef00836438437e998c1c9584e3fd4ac authored by Tim Foley on 16 February 2018, 17:04:44 UTC, committed by GitHub on 16 February 2018, 17:04:44 UTC
* Fix bugs around IR legalization of GLSL input/output

- Add case to handle assignment of one `ScalarizedVal::Flavor::address` to another (still need to make sure we are handling all the possible cases there)

- Revamp logic for creating global variable declarations for varying inputs/outputs.
  - Actually handle creating array declarations (not sure if binding locations will be correct)
  - Properly deal with offsetting of locations for nested fields
  - Only create varying input/output layout information as needed for the separate `in` and `out` variables we create to represent a single HLSL `inout` varying

* During SSA generation, recursively remove trivial phis

This is actually written up in the original paper I used as a reference, but I hadn't implemented the case yet.
When you eliminate one phi as trivial (because its only operands were itself and at most one other value), you might find that another phi becomes trivial (because it had this phi as an operand, but now it will have the other value...).

The one thing that made any of this tricky is that our "phi" nodes are really block parameters, and thus they don't technically have operands (`IRUse`s). The `IRUse`s for each phi were being tracked in a separate array, and had their `user` field set to null.

With this change, I set their `user` to be the corresponding `IRParam` for the phi (and that means I changed `IRParam` to inherit from `IRUser` even though it shouldn't really be required).

* Re-build SSA form after specialization/legalization

The main reason to do this is that legalization might scalarize types, and thus might allow us to clean up resource-type local variables that we were not able to clean up when they were part of an aggregate.

Note: we shouldn't really need to do this, because the front-end should actually be guaranteeing that types that include resources are used in "safe" ways, but we currently don't have the analyses required to support that.

* Give an error message if we get GLSL input

The API and command-line interface still recognize and nominally support GLSL input files, because they need to be supported in the "pass-through" mode.
This change just adds an error message if we encounter a GLSL input file in anything other than "pass-through" mode.
1 parent 3254970
History
Tip revision: 1b93da040ef00836438437e998c1c9584e3fd4ac authored by Tim Foley on 16 February 2018, 17:04:44 UTC
IR/Vulkan fixes (#412)
Tip revision: 1b93da0
File Mode Size
build
docs
examples
external
source
tests
tools
.gitattributes -rw-r--r-- 95 bytes
.gitignore -rw-r--r-- 398 bytes
.gitmodules -rw-r--r-- 107 bytes
.travis.yml -rw-r--r-- 1.6 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.1 KB
LICENSE -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 6.3 KB
README.md -rw-r--r-- 4.9 KB
appveyor.yml -rw-r--r-- 3.5 KB
slang.h -rw-r--r-- 41.8 KB
slang.sln -rw-r--r-- 9.1 KB
test.bat -rw-r--r-- 1.4 KB

README.md

back to top