shadPS4/src/shader_recompiler/ir/compute_value/compute.h
2025-04-08 02:34:26 +02:00

22 lines
759 B
C++

// SPDX-FileCopyrightText: Copyright 2024 shadPS4 Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <unordered_set>
#include <boost/container/flat_map.hpp>
#include "shader_recompiler/ir/compute_value/imm_value.h"
#include "shader_recompiler/ir/value.h"
// Given a value (inmediate or not), compute all the possible inmediate values
// that can represent. If the value can't be computed statically, the list will
// be empty.
namespace Shader::IR::ComputeValue {
using ImmValueList = std::unordered_set<ImmValue>;
using ComputeImmValuesCache = boost::container::flat_map<Inst*, ImmValueList>;
void Compute(const Value& value, ImmValueList& values, ComputeImmValuesCache& cache);
} // namespace Shader::IR::ComputeValue