Shader_IR: Correct Custom Variable assignment.

This commit is contained in:
Fernando Sahmkow 2020-01-07 18:56:03 -04:00 committed by FernandoS27
parent 7c530e0666
commit 37b8504faa
2 changed files with 4 additions and 0 deletions

View file

@ -1336,6 +1336,8 @@ private:
const std::string final_offset = fmt::format("({} - {}) >> 2", real, base);
target = {fmt::format("{}[{}]", GetGlobalMemory(gmem->GetDescriptor()), final_offset),
Type::Uint};
} else if (const auto cv = std::get_if<CustomVarNode>(&*dest)) {
target = {GetCustomVariable(cv->GetIndex()), Type::Float};
} else {
UNREACHABLE_MSG("Assign called without a proper target");
}

View file

@ -1361,6 +1361,8 @@ private:
target = {OpAccessChain(t_gmem_float, gmem_buffer, Constant(t_uint, 0), offset),
Type::Float};
} else if (const auto cv = std::get_if<CustomVarNode>(&*dest)) {
target = {custom_variables.at(cv->GetIndex()), Type::Float};
} else {
UNIMPLEMENTED();
}