X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fglsl%2Fspirv.h;h=669342f36a5bb3297bb76ac8a9e8e74913d210bb;hp=98aa673ed8d963ba23aa89cedd90d3433d00f619;hb=3a1b9cbe2441ae670a97541dc8ccb0a2860c8302;hpb=49080e2c9359a3929e77817707ad7e8bf3f8a36d diff --git a/source/glsl/spirv.h b/source/glsl/spirv.h index 98aa673e..669342f3 100644 --- a/source/glsl/spirv.h +++ b/source/glsl/spirv.h @@ -1,5 +1,5 @@ -#ifndef MSP_GL_SL_SPIRV -#define MSP_GL_SL_SPIRV +#ifndef MSP_GL_SL_SPIRV_H_ +#define MSP_GL_SL_SPIRV_H_ #include #include @@ -30,7 +30,8 @@ private: char arg_types[5]; char extension[13]; Word opcode; - UInt8 arg_order[4]; + std::uint8_t arg_order[4]; + Word capability; void (SpirVGenerator::*handler)(FunctionCall &, const std::vector &); }; @@ -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; @@ -77,6 +80,7 @@ private: std::map declared_ids; std::map declared_uniform_ids; std::map standard_type_ids; + std::map image_type_ids; std::map array_type_ids; std::map pointer_type_ids; std::map function_type_ids; @@ -111,11 +115,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); @@ -145,6 +150,7 @@ private: virtual void visit(FunctionCall &); void visit_constructor(FunctionCall &, const std::vector &, bool); void visit_builtin_matrix_comp_mult(FunctionCall &, const std::vector &); + void visit_builtin_texture_query(FunctionCall &, const std::vector &); void visit_builtin_texture(FunctionCall &, const std::vector &); void visit_builtin_texel_fetch(FunctionCall &, const std::vector &); void visit_builtin_interpolate(FunctionCall &, const std::vector &);