SPV 1.4: Lookup tables: Use variable initializer and NonWritable...

...when doing a variable lookup on an array of constants.
This commit is contained in:
John Kessenich
2019-02-07 08:04:12 -07:00
parent fbb6bdf046
commit 61a5ce190a
6 changed files with 102 additions and 11 deletions

View File

@@ -61,6 +61,14 @@
namespace spv {
typedef enum {
Spv_1_0 = (1 << 16),
Spv_1_1 = (1 << 16) | (1 << 8),
Spv_1_2 = (1 << 16) | (2 << 8),
Spv_1_3 = (1 << 16) | (3 << 8),
Spv_1_4 = (1 << 16) | (4 << 8),
} SpvVersion;
class Builder {
public:
Builder(unsigned int spvVersion, unsigned int userNumber, SpvBuildLogger* logger);
@@ -300,7 +308,7 @@ public:
void makeDiscard();
// Create a global or function local or IO variable.
Id createVariable(StorageClass, Id type, const char* name = 0);
Id createVariable(StorageClass, Id type, const char* name = 0, Id initializer = NoResult);
// Create an intermediate with an undefined value.
Id createUndefined(Id type);