shader: keep derived frontend metadata with its owner

This commit is contained in:
nmzik
2026-09-11 19:18:35 +04:00
parent 20e57994cf
commit 5a31de7955
5 changed files with 18 additions and 44 deletions
@@ -111,11 +111,6 @@ IR::MemoryInfo MemoryInfoFromDecoded(const Decoder::Instruction& decoded) {
memory.image_sample_flags = decoded.image_sample_flags;
memory.image_dimension = decoded.image_dimension;
memory.image_address_components = decoded.image_address_components;
memory.image_nsa_dwords = decoded.image_nsa_dwords;
for (uint32_t index = 0; index < Decoder::MaxImageNsaAddressComponents; index++) {
memory.image_nsa_addr[index] = decoded.image_nsa_addr[index];
}
memory.memory_segment = decoded.memory_segment;
memory.address_is_full =
memory.kind == ResourceKind::Flat ||
(memory.kind == ResourceKind::Global && decoded.src1.kind == Decoder::OperandKind::Vgpr);
@@ -125,8 +120,6 @@ IR::MemoryInfo MemoryInfoFromDecoded(const Decoder::Instruction& decoded) {
memory.image_has_mip = decoded.opcode == Decoder::Opcode::IMAGE_LOAD_MIP ||
decoded.opcode == Decoder::Opcode::IMAGE_STORE_MIP;
memory.image_r128 = decoded.image_r128;
memory.glc = decoded.glc;
memory.slc = decoded.slc;
memory.idxen = decoded.idxen;
memory.offen = decoded.offen;
memory.resource = ResourceIndexFromOperand(decoded.src1);
@@ -954,9 +954,9 @@ IR::Program TranslateProgram(const Decoder::Program& decoded, const CFG::Graph&
break;
default: break; // ValidateTranslateOptions rejects unsupported stages.
}
result.dispatcher_fallback = options.dispatcher_fallback;
result.cfg_failure_kind = options.cfg_failure_kind;
result.fallback_reason = options.fallback_reason;
result.dispatcher_fallback = cfg.irreducible || cfg.unsupported;
result.cfg_failure_kind = cfg.failure_kind;
result.fallback_reason = cfg.unsupported_reason;
if (options.embedded_fetch != nullptr) {
result.info.vertex_offset_sgpr = options.embedded_fetch->vertex_offset_sgpr;
result.info.instance_offset_sgpr = options.embedded_fetch->instance_offset_sgpr;
@@ -5,7 +5,6 @@
#include "graphics/shader/recompiler/ir/ShaderIR.h"
#include <cstdint>
#include <string_view>
#include <vector>
namespace Libs::Graphics::ShaderRecompiler::Frontend {
@@ -29,9 +28,6 @@ struct TranslateOptions {
uint64_t shader_hash = 0;
uint32_t user_data_base = 0;
uint32_t user_data_count = 64;
bool dispatcher_fallback = false;
CFG::FailureKind cfg_failure_kind = CFG::FailureKind::None;
std::string_view fallback_reason;
ShaderStageInputInfo input_info;
const EmbeddedFetchPlan* embedded_fetch = nullptr;
};