https://github.com/shader-slang/slang
Revision efca2bb38700847adb2385d311b8b801376659bb authored by Tim Foley on 01 March 2019, 16:20:09 UTC, committed by GitHub on 01 March 2019, 16:20:09 UTC
This affects layout computation for both the global and entry-point scopes, where multiple discrete shader parameters can be declared, but for layout purposes they must be treated as if they lived in the same `struct` type. If that `struct` type ends up consuming any "ordinary" data (`LayoutResourceKind::Uniform`) then an implicit constant buffer will be needed for that scope (e.g., the way fxc produces a `$Globals` constant buffer for the global scope).

The logic for computing those scope layouts had a bug in it, in that the struct type was not being updated to have the right size for uniform data at the scope. That bug hasn't bitten anybody yet because no Slang users are relying on entry-point uniforms, and global-scope uniforms aren't fully implemented (and get diagnosed as an error elsewhere in the compiler). This change fixes that bug.

This change also refactors things so that the logic for creating a constant buffer layout if and only if needed is moved into `type-layout.cpp` instead of relying on `parameter-binding.cpp` to compute whether or not it needs a block on its own. This is anticipating the rules for deciding whether or not a constant buffer is needed being slightly more thorny once interface types are in the mix.
1 parent 852c88c
History
Tip revision: efca2bb38700847adb2385d311b8b801376659bb authored by Tim Foley on 01 March 2019, 16:20:09 UTC
A small refactor to how implicit constant buffers are getting created. (#871)
Tip revision: efca2bb
File Mode Size
docs
examples
external
source
tests
tools
.editorconfig -rw-r--r-- 937 bytes
.gitattributes -rw-r--r-- 95 bytes
.gitignore -rw-r--r-- 407 bytes
.gitmodules -rw-r--r-- 406 bytes
.travis.yml -rw-r--r-- 1.7 KB
CODE_OF_CONDUCT.md -rw-r--r-- 3.1 KB
LICENSE -rw-r--r-- 1.1 KB
Makefile -rw-r--r-- 6.0 KB
README.md -rw-r--r-- 6.7 KB
appveyor.yml -rw-r--r-- 3.7 KB
premake5.lua -rw-r--r-- 25.3 KB
slang-com-helper.h -rw-r--r-- 4.8 KB
slang-com-ptr.h -rw-r--r-- 4.8 KB
slang.h -rw-r--r-- 85.4 KB
slang.sln -rw-r--r-- 9.8 KB
test.bat -rw-r--r-- 1.4 KB
travis_build.sh -rw-r--r-- 304 bytes
travis_test.sh -rw-r--r-- 435 bytes

README.md

back to top