WIP: HLSL: add ability to pass struct buffers with counters to fns
This modifies function parameter passing to pass the counter buffer associated with a struct buffer to a function as a hidden parameter. Similarly function declarations will have hidden parameters added to accept the associated counter buffers. There is a limitation: if a SB type may or may not have an associated counter, passing it as a function parameter will assume that it does, and the counter will appear in the linkage whether or not there is a counter method used on the object.
This commit is contained in:
parent
b29cc30cdb
commit
2bb1f39fa7
6 changed files with 533 additions and 108 deletions
|
|
@ -275,6 +275,7 @@ protected:
|
|||
|
||||
// Test method names
|
||||
bool isStructBufferMethod(const TString& name) const;
|
||||
void counterBufferType(const TSourceLoc& loc, TType& type);
|
||||
|
||||
// Return standard sample position array
|
||||
TIntermConstantUnion* getSamplePosArray(int count);
|
||||
|
|
@ -283,6 +284,9 @@ protected:
|
|||
bool isStructBufferType(const TType& type) const { return getStructBufferContentType(type) != nullptr; }
|
||||
TIntermTyped* indexStructBufferContent(const TSourceLoc& loc, TIntermTyped* buffer) const;
|
||||
TIntermTyped* getStructBufferCounter(const TSourceLoc& loc, TIntermTyped* buffer);
|
||||
TString getStructBuffCounterName(const TString&) const;
|
||||
void addStructBuffArguments(const TSourceLoc& loc, TIntermAggregate*&);
|
||||
void addStructBufferHiddenCounterParam(const TSourceLoc& loc, TParameter&, TIntermAggregate*&);
|
||||
|
||||
// Return true if this type is a reference. This is not currently a type method in case that's
|
||||
// a language specific answer.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue