HLSL: Fix #1106. Support shader setting of binding/set for $Global.
This commit is contained in:
@@ -58,6 +58,8 @@ namespace glslang {
|
||||
return EatLocation;
|
||||
else if (lowername == "binding")
|
||||
return EatBinding;
|
||||
else if (lowername == "global_cbuffer_binding")
|
||||
return EatGlobalBinding;
|
||||
} else if (lowernameSpace.size() > 0)
|
||||
return EatNone;
|
||||
|
||||
|
||||
@@ -64,6 +64,7 @@ namespace glslang {
|
||||
EatUnroll,
|
||||
EatLoop,
|
||||
EatBinding,
|
||||
EatGlobalBinding,
|
||||
EatLocation,
|
||||
EatInputAttachment
|
||||
};
|
||||
|
||||
@@ -1869,6 +1869,14 @@ void HlslParseContext::transferTypeAttributes(const TAttributeMap& attributes, T
|
||||
if (attributes.getInt(EatBinding, value, 1))
|
||||
type.getQualifier().layoutSet = value;
|
||||
|
||||
// global cbuffer binding
|
||||
if (attributes.getInt(EatGlobalBinding, value))
|
||||
globalUniformBinding = value;
|
||||
|
||||
// global cbuffer binding
|
||||
if (attributes.getInt(EatGlobalBinding, value, 1))
|
||||
globalUniformSet = value;
|
||||
|
||||
// input attachment
|
||||
if (attributes.getInt(EatInputAttachment, value))
|
||||
type.getQualifier().layoutAttachment = value;
|
||||
|
||||
@@ -187,7 +187,8 @@ public:
|
||||
void pushSwitchSequence(TIntermSequence* sequence) { switchSequenceStack.push_back(sequence); }
|
||||
void popSwitchSequence() { switchSequenceStack.pop_back(); }
|
||||
|
||||
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr) override;
|
||||
virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName,
|
||||
TTypeList* typeList = nullptr) override;
|
||||
|
||||
// Apply L-value conversions. E.g, turning a write to a RWTexture into an ImageStore.
|
||||
TIntermTyped* handleLvalue(const TSourceLoc&, const char* op, TIntermTyped*& node);
|
||||
|
||||
Reference in New Issue
Block a user