https://github.com/shader-slang/slang
Revision 563fc0cb8268a3e028f32b93ca94ff1c27cd1a10 authored by Tim Foley on 19 December 2017, 23:17:23 UTC, committed by GitHub on 19 December 2017, 23:17:23 UTC
* Fix up parameter block emit for mixed rewriter+IR

The basic problem here arose when a parameter block was declared in code that will be lowered via IR, but is referenced from user code that will use the AST-based lowering pass. The type legalization would split up the parameter block, and the AST would refer to the new variables, but it would fail to recognize when those variables represent constant buffers, and thus should get implicit-dereference behavior.

The fix here was just to propagate type information through when creating new AST (pseudo-)expressions to represent IR declarations that were split.

A more complete fix down the road should try to make sure that both the expression emit logic and the declaration-emit logic agree on whether a particular declaration of a parameter block or constant buffer needs to support the "implicit dereference" case or not. I'm leaving that to future work.

With this change, two test cases that had been disabled now pass.

* Fixup: don't do implicit deref for `ParameterBlock` values

Right now the rules for `ParameterBlock` and all other uniform praameter groups needs to be different, but the `isImplicitBaseExpr` logic wasn't taking that into account.
1 parent acf2625
History
Tip revision: 563fc0cb8268a3e028f32b93ca94ff1c27cd1a10 authored by Tim Foley on 19 December 2017, 23:17:23 UTC
Fix up parameter block emit for mixed rewriter+IR (#316)
Tip revision: 563fc0c
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-- 6.2 KB
appveyor.yml -rw-r--r-- 3.5 KB
slang.h -rw-r--r-- 39.1 KB
slang.sln -rw-r--r-- 9.1 KB
test.bat -rw-r--r-- 1.4 KB

README.md

back to top