aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorxbzk <xbzk@noreply.localhost>2025-06-05 19:00:24 +0000
committercrueter <crueter@noreply.localhost>2025-06-05 19:00:24 +0000
commit1240cd43d70a502508115c9abb12f7ef27e1ca4e (patch)
tree0ab055c78436949879669892daa07d4d4ff4e04f
parent76fa5255926da8f6339e7be5bf106646acedf78a (diff)
patch: mock return for textures not found by Track method (#150)
as discussed in #dev-chat, the goal is to feed untracked bindless textures requests with last valid bindless textures for now, so that most games keep running despite possible visual artifacts. as Track evolves, this mock shall be dropped eventually. Co-authored-by: Allison Cunha <allisonbzk@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/150 Co-authored-by: xbzk <xbzk@noreply.localhost> Co-committed-by: xbzk <xbzk@noreply.localhost>
-rw-r--r--src/shader_recompiler/ir_opt/texture_pass.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/src/shader_recompiler/ir_opt/texture_pass.cpp b/src/shader_recompiler/ir_opt/texture_pass.cpp
index 100437f0e5..ef1ef63500 100644
--- a/src/shader_recompiler/ir_opt/texture_pass.cpp
+++ b/src/shader_recompiler/ir_opt/texture_pass.cpp
@@ -327,14 +327,31 @@ std::optional<ConstBufferAddr> TryGetConstBuffer(const IR::Inst* inst, Environme
};
}
+// TODO:xbzk: shall be dropped when Track method cover all bindless stuff
+static ConstBufferAddr last_valid_addr = ConstBufferAddr{
+ .index = 0,
+ .offset = 0,
+ .shift_left = 0,
+ .secondary_index = 0,
+ .secondary_offset = 0,
+ .secondary_shift_left = 0,
+ .dynamic_offset = {},
+ .count = 1,
+ .has_secondary = false,
+};
+
TextureInst MakeInst(Environment& env, IR::Block* block, IR::Inst& inst) {
ConstBufferAddr addr;
if (IsBindless(inst)) {
const std::optional<ConstBufferAddr> track_addr{Track(inst.Arg(0), env)};
+
if (!track_addr) {
- throw NotImplementedException("Failed to track bindless texture constant buffer");
+ //throw NotImplementedException("Failed to track bindless texture constant buffer");
+ addr = last_valid_addr; // TODO:xbzk: shall be dropped when Track method cover all bindless stuff
+ } else {
+ addr = *track_addr;
+ last_valid_addr = addr; // TODO:xbzk: shall be dropped when Track method cover all bindless stuff
}
- addr = *track_addr;
} else {
addr = ConstBufferAddr{
.index = env.TextureBoundBuffer(),