X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fspirv.h;h=add5a967d3659d525901101cb25e3712601a2f03;hb=91e65bc9e24a6889995081035f6f6f0a78a6c20e;hp=21f0ed5331c531c40455cdc5ae7d279f92ef1755;hpb=cc5483cc709fdf7b6966a3e69dabfcafebaaffa0;p=libs%2Fgl.git diff --git a/source/glsl/spirv.h b/source/glsl/spirv.h index 21f0ed53..add5a967 100644 --- a/source/glsl/spirv.h +++ b/source/glsl/spirv.h @@ -48,6 +48,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 +63,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; @@ -84,6 +86,7 @@ private: std::map variable_load_ids; Id next_id; Id r_expression_result_id; + bool r_constant_result; bool constant_expression; bool spec_constant; bool reachable; @@ -114,7 +117,7 @@ private: 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); @@ -127,7 +130,6 @@ private: Id write_expression(Opcode, Id, Id, Id); void write_deconstruct(Id, Id, Id *, unsigned); Id write_construct(Id, const Id *, unsigned); - static BasicTypeDeclaration &get_element_type(BasicTypeDeclaration &); virtual void visit(Block &); virtual void visit(Literal &); @@ -143,7 +145,7 @@ private: virtual void visit(Assignment &); virtual void visit(TernaryExpression &); virtual void visit(FunctionCall &); - void visit_constructor(FunctionCall &, const std::vector &); + void visit_constructor(FunctionCall &, const std::vector &, bool); void visit_builtin_matrix_comp_mult(FunctionCall &, const std::vector &); void visit_builtin_texture(FunctionCall &, const std::vector &); void visit_builtin_texel_fetch(FunctionCall &, const std::vector &);