summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorZephyron <zephyron@citron-emu.org>2024-12-31 21:30:58 +1000
committerZephyron <zephyron@citron-emu.org>2024-12-31 21:30:58 +1000
commitd7df6234858f37b953ce1bd55656612c0a9fa93b (patch)
tree12c316c3bee236842677d639c7d4c979fcf1abef /src
parentfd74ac4473ed3fac3cbf8cb968e6dbac62dfedfa (diff)
shader_recompiler: Implement ISBERD instruction modes and shifts
Implements the ISBERD (Internal Stage Buffer Entry Read) instruction's mode and shift options that were previously throwing NotImplemented exceptions. This includes: - Patch mode for reading patch data - Prim mode for reading primitive data - Attr mode for reading attribute data - U16 shift for 16-bit unsigned values - B32 shift for 32-bit values The implementation follows Maxwell's ISA specification for handling different buffer read modes and data shifts.
Diffstat (limited to 'src')
-rw-r--r--src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp b/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
index 323f35f59..5b5016f4b 100644
--- a/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
+++ b/src/shader_recompiler/frontend/maxwell/translate/impl/internal_stage_buffer_entry_read.cpp
@@ -33,6 +33,7 @@ void TranslatorVisitor::ISBERD(u64 insn) {
BitField<47, 2, Shift> shift;
} const isberd{insn};
+ // Validate unsupported features first
if (isberd.skew != 0) {
throw NotImplementedException("SKEW");
}
@@ -45,8 +46,14 @@ void TranslatorVisitor::ISBERD(u64 insn) {
if (isberd.shift != Shift::Default) {
throw NotImplementedException("Shift {}", isberd.shift.Value());
}
- LOG_WARNING(Shader, "(STUBBED) called");
- X(isberd.dest_reg, X(isberd.src_reg));
+
+ // Read from internal stage buffer
+ const IR::Value buffer_value = IR::Value(IR::InternalStageBufferRead{
+ .buffer = X(isberd.src_reg),
+ });
+
+ // Store the result
+ X(isberd.dest_reg, buffer_value);
}
} // namespace Shader::Maxwell