mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-27 09:44:24 +01:00
shader_ir: Add setters
This commit is contained in:
parent
12a95ff453
commit
6b9eea3fe5
@ -121,6 +121,22 @@ Node ShaderIR::GetLocalMemory(Node address) {
|
|||||||
return StoreNode(LmemNode(address));
|
return StoreNode(LmemNode(address));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ShaderIR::SetRegister(BasicBlock& bb, Register dest, Node src) {
|
||||||
|
bb.push_back(Operation(OperationCode::Assign, GetRegister(dest), src));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShaderIR::SetPredicate(BasicBlock& bb, u64 dest, Node src) {
|
||||||
|
bb.push_back(Operation(OperationCode::LogicalAssign, GetPredicate(dest), src));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShaderIR::SetInternalFlag(BasicBlock& bb, InternalFlag flag, Node value) {
|
||||||
|
bb.push_back(Operation(OperationCode::LogicalAssign, GetInternalFlag(flag), value));
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShaderIR::SetLocalMemory(BasicBlock& bb, Node address, Node value) {
|
||||||
|
bb.push_back(Operation(OperationCode::Assign, GetLocalMemory(address), value));
|
||||||
|
}
|
||||||
|
|
||||||
/*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code,
|
/*static*/ OperationCode ShaderIR::SignedToUnsignedCode(OperationCode operation_code,
|
||||||
bool is_signed) {
|
bool is_signed) {
|
||||||
if (is_signed) {
|
if (is_signed) {
|
||||||
|
@ -634,6 +634,14 @@ private:
|
|||||||
/// Generates a node representing a local memory address
|
/// Generates a node representing a local memory address
|
||||||
Node GetLocalMemory(Node address);
|
Node GetLocalMemory(Node address);
|
||||||
|
|
||||||
|
/// Sets a register. src value must be a number-evaluated node.
|
||||||
|
void SetRegister(BasicBlock& bb, Tegra::Shader::Register dest, Node src);
|
||||||
|
/// Sets a predicate. src value must be a bool-evaluated node
|
||||||
|
void SetPredicate(BasicBlock& bb, u64 dest, Node src);
|
||||||
|
/// Sets an internal flag. src value must be a bool-evaluated node
|
||||||
|
void SetInternalFlag(BasicBlock& bb, InternalFlag flag, Node value);
|
||||||
|
/// Sets a local memory address. address and value must be a number-evaluated node
|
||||||
|
void SetLocalMemory(BasicBlock& bb, Node address, Node value);
|
||||||
|
|
||||||
template <typename... T>
|
template <typename... T>
|
||||||
inline Node Operation(OperationCode code, const T*... operands) {
|
inline Node Operation(OperationCode code, const T*... operands) {
|
||||||
|
Loading…
Reference in New Issue
Block a user