]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/spirv.h
Use default member initializers for simple types
[libs/gl.git] / source / glsl / spirv.h
index d680ee3c8a76e01d8e244aadc1307fbccd457aa9..6971e2a9c43eb2ec8cc180b94043a6388229858e 100644 (file)
@@ -30,7 +30,7 @@ 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<Id> &);
        };
@@ -70,8 +70,8 @@ private:
                bool operator<(const ConstantKey &) const;
        };
 
-       Stage *stage;
-       FunctionDeclaration *current_function;
+       Stage *stage = 0;
+       FunctionDeclaration *current_function = 0;
        std::vector<const InterfaceLayout *> interface_layouts;
        SpirVContent content;
        SpirVWriter writer;
@@ -86,19 +86,19 @@ private:
        std::map<std::string, Id> function_type_ids;
        std::map<ConstantKey, Id> constant_ids;
        std::map<const VariableDeclaration *, Id> variable_load_ids;
-       Id next_id;
-       Id r_expression_result_id;
-       bool r_constant_result;
-       bool constant_expression;
-       bool spec_constant;
-       bool reachable;
-       bool composite_access;
-       Id r_composite_base_id;
-       Node *r_composite_base;
+       Id next_id = 1;
+       Id r_expression_result_id = 0;
+       bool r_constant_result = false;
+       bool constant_expression = false;
+       bool spec_constant = false;
+       bool reachable = false;
+       bool composite_access = false;
+       Id r_composite_base_id = 0;
+       Node *r_composite_base = 0;
        std::vector<unsigned> r_composite_chain;
-       Id assignment_source_id;
-       Id loop_merge_block_id;
-       Id loop_continue_target_id;
+       Id assignment_source_id = 0;
+       Id loop_merge_block_id = 0;
+       Id loop_continue_target_id = 0;
 
        static const BuiltinFunctionInfo builtin_functions[];