Implemented Control Codes

This commit is contained in:
FernandoS27 2018-09-08 21:54:11 -04:00
parent a94b623dfb
commit aac77bbd18
2 changed files with 51 additions and 0 deletions

View file

@ -351,6 +351,15 @@ public:
shader.AddLine(dest + " = " + src + ';');
}
std::string GetControlCode(const Tegra::Shader::ControlCode cc) {
u32 code = static_cast<u32>(cc);
return "controlCode_" + std::to_string(code);
}
void SetControlCode(const Tegra::Shader::ControlCode cc, const std::string& value) {
shader.AddLine(GetControlCode(cc) + " = " + value + ';');
}
/**
* Writes code that does a output attribute assignment to register operation. Output attributes
* are stored as floats, so this may require conversion.
@ -414,6 +423,12 @@ public:
}
declarations.AddNewLine();
for (u32 cc = 0; cc < 32; cc++) {
Tegra::Shader::ControlCode code = static_cast<Tegra::Shader::ControlCode>(cc);
declarations.AddLine("bool " + GetControlCode(code) + " = false;");
}
declarations.AddNewLine();
for (const auto element : declr_input_attribute) {
// TODO(bunnei): Use proper number of elements for these
u32 idx =