WIP: track declared builtin type [proposal]
Marking as WIP since it might deserve discussion or at least explicit consideration. During type sanitization, the TQualifier's TBuiltInVariable type is lost. However, sometimes it's needed downstream. There were already two methods in use to track it through to places it was needed: one in the TParameter, and one in a map in the HlslParseContext used for structured buffers. The latter was going to be insufficient when SB types with counters are passed to user functions, and it's proving awkward to track the data to where it's needed. This PR holds a proposal: track the original declared builtin type in the TType, so it's trivially available where needed. This lets the other two mechanisms be removed (and they are in this PR). There's a side benefit of not losing certain types of information before the reflection interface. This PR is only that proposal, so it changes no test results. If it's acceptable, I'll use it for the last piece of SB counter functionality.
This commit is contained in:
parent
1a010b8368
commit
a4bfed129f
4 changed files with 21 additions and 35 deletions
|
|
@ -400,6 +400,7 @@ public:
|
|||
invariant = false;
|
||||
noContraction = false;
|
||||
makeTemporary();
|
||||
declaredBuiltIn = EbvNone;
|
||||
}
|
||||
|
||||
// drop qualifiers that don't belong in a temporary variable
|
||||
|
|
@ -457,6 +458,7 @@ public:
|
|||
const char* semanticName;
|
||||
TStorageQualifier storage : 6;
|
||||
TBuiltInVariable builtIn : 8;
|
||||
TBuiltInVariable declaredBuiltIn : 8;
|
||||
TPrecisionQualifier precision : 3;
|
||||
bool invariant : 1; // require canonical treatment for cross-shader invariance
|
||||
bool noContraction: 1; // prevent contraction and reassociation, e.g., for 'precise' keyword, and expressions it affects
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue