HLSL: add readonly qualifier to tbuffer, so they end up as SRV

This commit is contained in:
steve-lunarg
2017-04-20 13:16:23 -06:00
parent be28355019
commit 7b1dcd6693
7 changed files with 101 additions and 29 deletions

View File

@@ -1846,13 +1846,16 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
// This storage qualifier will tell us whether it's an AST
// block type or just a generic structure type.
TStorageQualifier storageQualifier = EvqTemporary;
bool readonly = false;
// CBUFFER
if (acceptTokenClass(EHTokCBuffer))
if (acceptTokenClass(EHTokCBuffer)) {
storageQualifier = EvqUniform;
// TBUFFER
else if (acceptTokenClass(EHTokTBuffer))
} else if (acceptTokenClass(EHTokTBuffer)) {
storageQualifier = EvqBuffer;
readonly = true;
}
// CLASS
// STRUCT
else if (! acceptTokenClass(EHTokClass) && ! acceptTokenClass(EHTokStruct))
@@ -1908,6 +1911,7 @@ bool HlslGrammar::acceptStruct(TType& type, TIntermNode*& nodeList)
new(&type) TType(typeList, structName);
else {
postDeclQualifier.storage = storageQualifier;
postDeclQualifier.readonly = readonly;
new(&type) TType(typeList, structName, postDeclQualifier); // sets EbtBlock
}