diff options
Diffstat (limited to 'src/shader_recompiler')
3 files changed, 48 insertions, 42 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_atomic.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_atomic.cpp index 911181c43..376a05827 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_atomic.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_atomic.cpp @@ -398,162 +398,162 @@ void EmitStorageAtomicMaxF32x2(EmitContext& ctx, IR::Inst& inst, const IR::Value } void EmitGlobalAtomicIAdd32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicSMin32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicUMin32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicSMax32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicUMax32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicInc32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicDec32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicAnd32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicOr32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicXor32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicExchange32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicIAdd64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicSMin64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicUMin64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicSMax64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicUMax64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicInc64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicDec64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicAnd64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicOr64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicXor64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicExchange64(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicIAdd32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicSMin32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicUMin32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicSMax32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicUMax32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicInc32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicDec32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicAnd32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicOr32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicXor32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicExchange32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicAddF32(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicAddF16x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicAddF32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicMinF16x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicMinF32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicMaxF16x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } void EmitGlobalAtomicMaxF32x2(EmitContext&) { - throw NotImplementedException("GLSL Instrucion"); + throw NotImplementedException("GLSL Instruction"); } } // namespace Shader::Backend::GLSL diff --git a/src/shader_recompiler/backend/glsl/glsl_emit_context.h b/src/shader_recompiler/backend/glsl/glsl_emit_context.h index dfd10ac28..7587f7bab 100644 --- a/src/shader_recompiler/backend/glsl/glsl_emit_context.h +++ b/src/shader_recompiler/backend/glsl/glsl_emit_context.h @@ -49,7 +49,7 @@ public: void Add(const char* format_str, IR::Inst& inst, Args&&... args) { const auto var_def{var_alloc.AddDefine(inst, type)}; if (var_def.empty()) { - // skip assigment. + // skip assignment. code += fmt::format(fmt::runtime(format_str + 3), std::forward<Args>(args)...); } else { code += fmt::format(fmt::runtime(format_str), var_def, std::forward<Args>(args)...); diff --git a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp index 336338e62..d1e59f22e 100644 --- a/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp +++ b/src/shader_recompiler/ir_opt/global_memory_to_storage_buffer_pass.cpp @@ -35,6 +35,7 @@ struct Bias { u32 index; u32 offset_begin; u32 offset_end; + u32 alignment; }; using boost::container::flat_set; @@ -349,7 +350,8 @@ std::optional<StorageBufferAddr> Track(const IR::Value& value, const Bias* bias) .index = index.U32(), .offset = offset.U32(), }; - if (!Common::IsAligned(storage_buffer.offset, 16)) { + const u32 alignment{bias ? bias->alignment : 8U}; + if (!Common::IsAligned(storage_buffer.offset, alignment)) { // The SSBO pointer has to be aligned return std::nullopt; } @@ -371,6 +373,7 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info) .index = 0, .offset_begin = 0x110, .offset_end = 0x610, + .alignment = 16, }; // Track the low address of the instruction const std::optional<LowAddrInfo> low_addr_info{TrackLowAddress(&inst)}; @@ -386,8 +389,11 @@ void CollectStorageBuffers(IR::Block& block, IR::Inst& inst, StorageInfo& info) storage_buffer = Track(low_addr, nullptr); if (!storage_buffer) { // If that also fails, use NVN fallbacks + LOG_WARNING(Shader, "Storage buffer failed to track, using global memory fallbacks"); return; } + LOG_WARNING(Shader, "Storage buffer tracked without bias, index {} offset {}", + storage_buffer->index, storage_buffer->offset); } // Collect storage buffer and the instruction if (IsGlobalMemoryWrite(inst)) { |