]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/spirv.h
Use extended alignment in SPIR-V struct layout when necessary
[libs/gl.git] / source / glsl / spirv.h
index 6971e2a9c43eb2ec8cc180b94043a6388229858e..a83478b0fb6d370d621864aa300ed8fcf4c8f1bd 100644 (file)
@@ -70,6 +70,7 @@ private:
                bool operator<(const ConstantKey &) const;
        };
 
+       Features features;
        Stage *stage = 0;
        FunctionDeclaration *current_function = 0;
        std::vector<const InterfaceLayout *> interface_layouts;
@@ -79,6 +80,7 @@ private:
        std::map<std::string, Id> imported_extension_ids;
        std::map<Node *, Declaration> declared_ids;
        std::map<std::string, Id> declared_uniform_ids;
+       std::map<unsigned, Id> declared_spec_ids;
        std::map<TypeKey, Id> standard_type_ids;
        std::map<Id, Id> image_type_ids;
        std::map<TypeKey, Id> array_type_ids;
@@ -105,7 +107,7 @@ private:
 public:
        SpirVGenerator();
 
-       void apply(Module &);
+       void apply(Module &, const Features &);
        const std::vector<Word> &get_code() const { return content.code; }
 
 private:
@@ -122,7 +124,7 @@ private:
        Id get_vector_constant_id(Id, unsigned, Id);
        Id get_standard_type_id(BasicTypeDeclaration::Kind, unsigned, bool = true);
        bool is_scalar_type(Id, BasicTypeDeclaration::Kind) const;
-       Id get_array_type_id(TypeDeclaration &, unsigned);
+       Id get_array_type_id(TypeDeclaration &, Id, bool);
        Id get_pointer_type_id(Id, StorageClass);
        Id get_variable_type_id(const VariableDeclaration &);
        Id get_load_id(VariableDeclaration &);