summaryrefslogtreecommitdiffstats
path: root/source/slang/options.cpp
diff options
context:
space:
mode:
authorTim Foley <tfoleyNV@users.noreply.github.com>2017-10-09 14:44:40 -0700
committerGitHub <noreply@github.com>2017-10-09 14:44:40 -0700
commit676560b05f945335ff9e091934f1aea3ff373ced (patch)
tree780f943bbcb9c09852c3c7542ad8d8a63302839d /source/slang/options.cpp
parent06b2192aa2bb6698c863388c5d085ba5b1f28374 (diff)
Fix emit logic for `cbuffer` member with initializer (#205)
Given an input declaration like: cbuffer C { int a = -1; } Slang was automatically generating a `packoffset` semantic to place the member manually, but was emitting it *after* the initializer of the original declaration: cbuffer C : register(b) { int a = -1 : packoffset(c0); } That syntax is invalid, of course, and we actually want: cbuffer C : register(b) { int a : packoffset(c0) = -1; } This wasn't spotted earlier because putting initializers on a `cbuffer` member is not commonly done, since it requires reading those values via the reflection API. Slang's reflection API currently provides no way to access default values like this, so they aren't of much use yet. Still, it is better to emit correct syntax even in cases like this one.
Diffstat (limited to 'source/slang/options.cpp')
0 files changed, 0 insertions, 0 deletions