Shader_IR: Correct Custom Variable assignment.
This commit is contained in:
parent
7c530e0666
commit
37b8504faa
|
@ -1336,6 +1336,8 @@ private:
|
||||||
const std::string final_offset = fmt::format("({} - {}) >> 2", real, base);
|
const std::string final_offset = fmt::format("({} - {}) >> 2", real, base);
|
||||||
target = {fmt::format("{}[{}]", GetGlobalMemory(gmem->GetDescriptor()), final_offset),
|
target = {fmt::format("{}[{}]", GetGlobalMemory(gmem->GetDescriptor()), final_offset),
|
||||||
Type::Uint};
|
Type::Uint};
|
||||||
|
} else if (const auto cv = std::get_if<CustomVarNode>(&*dest)) {
|
||||||
|
target = {GetCustomVariable(cv->GetIndex()), Type::Float};
|
||||||
} else {
|
} else {
|
||||||
UNREACHABLE_MSG("Assign called without a proper target");
|
UNREACHABLE_MSG("Assign called without a proper target");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1361,6 +1361,8 @@ private:
|
||||||
target = {OpAccessChain(t_gmem_float, gmem_buffer, Constant(t_uint, 0), offset),
|
target = {OpAccessChain(t_gmem_float, gmem_buffer, Constant(t_uint, 0), offset),
|
||||||
Type::Float};
|
Type::Float};
|
||||||
|
|
||||||
|
} else if (const auto cv = std::get_if<CustomVarNode>(&*dest)) {
|
||||||
|
target = {custom_variables.at(cv->GetIndex()), Type::Float};
|
||||||
} else {
|
} else {
|
||||||
UNIMPLEMENTED();
|
UNIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue