diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-23 03:58:11 -0300 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-22 21:51:29 -0400 |
commit | 48a17298d76cd8ed3bf2b53aca1e1ac097693976 (patch) | |
tree | f0395bbe074b21c96d8a8bbe2ad9115dcbff92cf /src/shader_recompiler/backend/spirv/emit_context.h | |
parent | d5d6778ba53b218a7f19c0ab0873404a24ac015b (diff) |
spirv: Support OpenGL uniform buffers and change bindings
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_context.h')
-rw-r--r-- | src/shader_recompiler/backend/spirv/emit_context.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_context.h b/src/shader_recompiler/backend/spirv/emit_context.h index c52544fb7b..baf12c2170 100644 --- a/src/shader_recompiler/backend/spirv/emit_context.h +++ b/src/shader_recompiler/backend/spirv/emit_context.h @@ -17,6 +17,14 @@ namespace Shader::Backend::SPIRV { using Sirit::Id; +struct Bindings { + u32 unified{}; + u32 uniform_buffer{}; + u32 storage_buffer{}; + u32 texture{}; + u32 image{}; +}; + class VectorTypes { public: void Define(Sirit::Module& sirit_ctx, Id base_type, std::string_view name); @@ -62,6 +70,7 @@ struct UniformDefinitions { Id U32{}; Id F32{}; Id U32x2{}; + Id U32x4{}; }; struct StorageTypeDefinition { @@ -101,11 +110,14 @@ struct GenericElementInfo { class EmitContext final : public Sirit::Module { public: - explicit EmitContext(const Profile& profile, IR::Program& program, u32& binding); + explicit EmitContext(const Profile& profile, IR::Program& program, Bindings& binding); ~EmitContext(); [[nodiscard]] Id Def(const IR::Value& value); + [[nodiscard]] Id BitOffset8(const IR::Value& offset); + [[nodiscard]] Id BitOffset16(const IR::Value& offset); + Id Const(u32 value) { return Constant(U32[1], value); } @@ -139,6 +151,7 @@ public: Id U64{}; VectorTypes F32; VectorTypes U32; + VectorTypes S32; VectorTypes F16; VectorTypes F64; |