]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/spirv.h
Store required capabilities for SPIR-V builtin functions
[libs/gl.git] / source / glsl / spirv.h
index 98aa673ed8d963ba23aa89cedd90d3433d00f619..c023adae9af3cc5e75a637298afc8f98fd244fc7 100644 (file)
@@ -31,6 +31,7 @@ private:
                char extension[13];
                Word opcode;
                UInt8 arg_order[4];
+               Word capability;
                void (SpirVGenerator::*handler)(FunctionCall &, const std::vector<Id> &);
        };
 
@@ -48,6 +49,7 @@ private:
                unsigned detail;
 
                TypeKey(Id i, unsigned d): type_id(i), detail(d) { }
+               TypeKey(BasicTypeDeclaration::Kind, bool);
 
                bool operator<(const TypeKey &) const;
        };
@@ -62,6 +64,7 @@ private:
                };
 
                ConstantKey(Id t, int i): type_id(t), int_value(i) { }
+               ConstantKey(Id t, unsigned u): type_id(t), int_value(u) { }
                ConstantKey(Id t, float f): type_id(t), float_value(f) { }
 
                bool operator<(const ConstantKey &) const;
@@ -111,11 +114,12 @@ private:
        Id import_extension(const std::string &);
        Id get_id(Node &) const;
        Id allocate_id(Node &, Id);
+       Id allocate_forward_id(Node &);
        Id write_constant(Id, Word, bool);
        static ConstantKey get_constant_key(Id, const Variant &value);
        Id get_constant_id(Id, const Variant &value);
        Id get_vector_constant_id(Id, unsigned, Id);
-       Id get_standard_type_id(BasicTypeDeclaration::Kind, unsigned);
+       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_pointer_type_id(Id, StorageClass);