aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glasm/emit_glasm.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-10 22:35:16 -0400
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-22 21:51:31 -0400
commit7ff5851608031baca2adceb9f72e7c75eda9b3a9 (patch)
tree79951738906a2c2a76bf1a3354d52234f03285db /src/shader_recompiler/backend/glasm/emit_glasm.cpp
parent8c81a20ace8c65d0a9d58b9cf333049a2bc0383a (diff)
glasm: Implement Storage atomics
StorageAtomicExchangeU64 is failing test seemingly due to failure storing 64-bit result into the register
Diffstat (limited to 'src/shader_recompiler/backend/glasm/emit_glasm.cpp')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm.cpp b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
index 047b2f89cc..056d8cbf8d 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm.cpp
@@ -193,6 +193,9 @@ void SetupOptions(std::string& header, Info info) {
if (info.uses_subgroup_shuffles) {
header += "OPTION NV_shader_thread_shuffle;";
}
+ // TODO: Track the shared atomic ops
+ header +=
+ "OPTION NV_shader_storage_buffer;OPTION NV_gpu_program_fp64;OPTION NV_bindless_texture;";
}
} // Anonymous namespace
@@ -214,6 +217,10 @@ std::string EmitGLASM(const Profile&, IR::Program& program, Bindings&) {
default:
break;
}
+ if (program.shared_memory_size > 0) {
+ header += fmt::format("SHARED_MEMORY {};", program.shared_memory_size);
+ header += fmt::format("SHARED shared_mem[]={{program.sharedmem}};");
+ }
header += "TEMP ";
for (size_t index = 0; index < ctx.reg_alloc.NumUsedRegisters(); ++index) {
header += fmt::format("R{},", index);