summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv/emit_context.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-05-23 08:58:11 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:29 +0200
commit48a17298d76cd8ed3bf2b53aca1e1ac097693976 (patch)
treef0395bbe074b21c96d8a8bbe2ad9115dcbff92cf /src/shader_recompiler/backend/spirv/emit_context.h
parentspirv: Desambiguate descriptor names (diff)
downloadyuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.tar
yuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.tar.gz
yuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.tar.bz2
yuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.tar.lz
yuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.tar.xz
yuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.tar.zst
yuzu-48a17298d76cd8ed3bf2b53aca1e1ac097693976.zip
Diffstat (limited to '')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_context.h15
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 c52544fb7..baf12c217 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;