HLSL: phase 2b: add l-value operator[] for RWTexture/RWBuffer
This commit adds l-value support for RW texture and buffer objects. Supported are: - pre and post inc/decrement - function out parameters - op-assignments, such as *=, +-, etc. - result values from op-assignments. e.g, val=(MyRwTex[loc] *= 2); Not supported are: - Function inout parameters - multiple post-inc/decrement operators. E.g, MyRWTex[loc]++++;
This commit is contained in:
@@ -81,7 +81,7 @@ public:
|
||||
void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
|
||||
TIntermTyped* handleLengthMethod(const TSourceLoc&, TFunction*, TIntermNode*);
|
||||
void addInputArgumentConversions(const TFunction&, TIntermNode*&) const;
|
||||
TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermAggregate&) const;
|
||||
TIntermTyped* addOutputArgumentConversions(const TFunction&, TIntermAggregate&);
|
||||
void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
|
||||
TFunction* handleConstructorCall(const TSourceLoc&, const TType&);
|
||||
void handleSemantic(TSourceLoc, TQualifier&, const TString& semantic);
|
||||
@@ -152,6 +152,9 @@ public:
|
||||
void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); }
|
||||
void popSwitchSequence() { switchSequenceStack.pop_back(); }
|
||||
|
||||
// Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore.
|
||||
TIntermTyped* handleLvalue(const TSourceLoc&, const char* op, TIntermTyped* node);
|
||||
|
||||
protected:
|
||||
void inheritGlobalDefaults(TQualifier& dst) const;
|
||||
TVariable* makeInternalVariable(const char* name, const TType&) const;
|
||||
@@ -161,6 +164,9 @@ protected:
|
||||
TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
|
||||
TOperator mapAtomicOp(const TSourceLoc& loc, TOperator op, bool isImage);
|
||||
|
||||
// Return true if this node requires L-value conversion (e.g, to an imageStore).
|
||||
bool shouldConvertLValue(const TIntermNode*) const;
|
||||
|
||||
// Array and struct flattening
|
||||
bool shouldFlatten(const TType& type) const { return shouldFlattenIO(type) || shouldFlattenUniform(type); }
|
||||
TIntermTyped* flattenAccess(TIntermTyped* base, int member);
|
||||
|
||||
Reference in New Issue
Block a user