summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-07-04 06:34:53 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:40 +0200
commit11f04f1022d0820a1fdba38221ecd38f19d86d9e (patch)
treec30e87d0a66b0100cb3f7b3ad2fb3bd769654a7a /src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp
parentvulkan_device: Add missing include algorithm (diff)
downloadyuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.tar
yuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.tar.gz
yuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.tar.bz2
yuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.tar.lz
yuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.tar.xz
yuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.tar.zst
yuzu-11f04f1022d0820a1fdba38221ecd38f19d86d9e.zip
Diffstat (limited to 'src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp')
-rw-r--r--src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp b/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp
index ccebf170d..679ee2684 100644
--- a/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp
+++ b/src/shader_recompiler/backend/spirv/emit_spirv_memory.cpp
@@ -84,15 +84,27 @@ void EmitLoadGlobalS16(EmitContext&) {
}
Id EmitLoadGlobal32(EmitContext& ctx, Id address) {
- return ctx.OpFunctionCall(ctx.U32[1], ctx.load_global_func_u32, address);
+ if (ctx.profile.support_int64) {
+ return ctx.OpFunctionCall(ctx.U32[1], ctx.load_global_func_u32, address);
+ }
+ LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation");
+ return ctx.Const(0u);
}
Id EmitLoadGlobal64(EmitContext& ctx, Id address) {
- return ctx.OpFunctionCall(ctx.U32[2], ctx.load_global_func_u32x2, address);
+ if (ctx.profile.support_int64) {
+ return ctx.OpFunctionCall(ctx.U32[2], ctx.load_global_func_u32x2, address);
+ }
+ LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation");
+ return ctx.Const(0u, 0u);
}
Id EmitLoadGlobal128(EmitContext& ctx, Id address) {
- return ctx.OpFunctionCall(ctx.U32[4], ctx.load_global_func_u32x4, address);
+ if (ctx.profile.support_int64) {
+ return ctx.OpFunctionCall(ctx.U32[4], ctx.load_global_func_u32x4, address);
+ }
+ LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation");
+ return ctx.Const(0u, 0u, 0u, 0u);
}
void EmitWriteGlobalU8(EmitContext&) {
@@ -112,15 +124,27 @@ void EmitWriteGlobalS16(EmitContext&) {
}
void EmitWriteGlobal32(EmitContext& ctx, Id address, Id value) {
- ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32, address, value);
+ if (ctx.profile.support_int64) {
+ ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32, address, value);
+ return;
+ }
+ LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation");
}
void EmitWriteGlobal64(EmitContext& ctx, Id address, Id value) {
- ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32x2, address, value);
+ if (ctx.profile.support_int64) {
+ ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32x2, address, value);
+ return;
+ }
+ LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation");
}
void EmitWriteGlobal128(EmitContext& ctx, Id address, Id value) {
- ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32x4, address, value);
+ if (ctx.profile.support_int64) {
+ ctx.OpFunctionCall(ctx.void_id, ctx.write_global_func_u32x4, address, value);
+ return;
+ }
+ LOG_WARNING(Shader_SPIRV, "Int64 not supported, ignoring memory operation");
}
Id EmitLoadStorageU8(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset) {