SPV: Support test #pragma for generating the StorageBuffer storage class.
Longer term, this storage class should be generated based on the mode of compilation.
This commit is contained in:
parent
a8d3db6b32
commit
670271890d
7 changed files with 104 additions and 8 deletions
|
|
@ -255,6 +255,10 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector<TString>&
|
|||
error(loc, "\")\" expected to end 'debug' pragma", "#pragma", "");
|
||||
return;
|
||||
}
|
||||
} else if (spvVersion.spv > 0 && tokens[0].compare("use_storage_buffer") == 0) {
|
||||
if (tokens.size() != 1)
|
||||
error(loc, "extra tokens", "#pragma", "");
|
||||
intermediate.setUseStorageBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -178,7 +178,8 @@ public:
|
|||
autoMapBindings(false),
|
||||
flattenUniformArrays(false),
|
||||
useUnknownFormat(false),
|
||||
hlslOffsets(false)
|
||||
hlslOffsets(false),
|
||||
useStorageBuffer(false)
|
||||
{
|
||||
localSize[0] = 1;
|
||||
localSize[1] = 1;
|
||||
|
|
@ -219,6 +220,8 @@ public:
|
|||
bool getNoStorageFormat() const { return useUnknownFormat; }
|
||||
void setHlslOffsets() { hlslOffsets = true; }
|
||||
bool usingHlslOFfsets() const { return hlslOffsets; }
|
||||
void setUseStorageBuffer() { useStorageBuffer = true; }
|
||||
bool usingStorageBuffer() const { return useStorageBuffer; }
|
||||
|
||||
void setVersion(int v) { version = v; }
|
||||
int getVersion() const { return version; }
|
||||
|
|
@ -506,6 +509,7 @@ protected:
|
|||
bool flattenUniformArrays;
|
||||
bool useUnknownFormat;
|
||||
bool hlslOffsets;
|
||||
bool useStorageBuffer;
|
||||
|
||||
typedef std::list<TCall> TGraph;
|
||||
TGraph callGraph;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue