X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprogram.h;h=6f84cfd26436e314b6d48d02dac8e7c0e2b51154;hb=7af200475facc657a0bbffaa17520d3ec9d809af;hp=9fa757479eacf11d09ca7880bbab83daeb74c6db;hpb=c93e0613e96ec6817e26b533e90dc49d45787941;p=libs%2Fgl.git diff --git a/source/core/program.h b/source/core/program.h index 9fa75747..6f84cfd2 100644 --- a/source/core/program.h +++ b/source/core/program.h @@ -5,14 +5,14 @@ #include #include #include "bindable.h" +#include "datatype.h" #include "gl.h" +#include "module.h" #include "vertexformat.h" namespace Msp { namespace GL { -class GlslModule; -class Module; class Shader; /** @@ -64,10 +64,10 @@ public: std::string name; const UniformBlockInfo *block; unsigned location; - unsigned size; + unsigned array_size; unsigned array_stride; unsigned matrix_stride; - GLenum type; + DataType type; }; struct UniformBlockInfo @@ -83,8 +83,8 @@ public: { std::string name; unsigned location; - unsigned size; - GLenum type; + unsigned array_size; + DataType type; }; typedef std::map UniformMap; @@ -124,6 +124,7 @@ private: unsigned add_stage(GLenum); void add_glsl_stages(const GlslModule &, const std::map &); void compile_glsl_stage(unsigned); + void add_spirv_stages(const SpirVModule &, const std::map &); public: DEPRECATED void attach_shader(Shader &shader); @@ -137,10 +138,13 @@ public: void link(); private: - static void require_type(GLenum); void query_uniforms(); void query_uniform_blocks(const std::vector &); void query_attributes(); + void collect_uniforms(); + void collect_block_uniforms(UniformBlockInfo &, const SpirVModule::Structure &, const std::string &, unsigned); + void collect_attributes(); + void update_layout_hash(); static LayoutHash compute_layout_hash(const std::vector &); static bool uniform_location_compare(const UniformInfo *, const UniformInfo *); public: