yuzu-emu
/
yuzu-mainline
Archived
1
0
Fork 0

Merge pull request #2337 from lioncash/temporary

gl_shader_decompiler: Rename GenerateTemporal() to GenerateTemporary()
This commit is contained in:
bunnei 2019-04-05 23:35:31 -04:00 committed by GitHub
commit cb2209d06a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 12 deletions

View File

@ -69,10 +69,10 @@ public:
shader_source += '\n'; shader_source += '\n';
} }
std::string GenerateTemporal() { std::string GenerateTemporary() {
std::string temporal = "tmp"; std::string temporary = "tmp";
temporal += std::to_string(temporal_index++); temporary += std::to_string(temporary_index++);
return temporal; return temporary;
} }
std::string GetResult() { std::string GetResult() {
@ -87,7 +87,7 @@ private:
} }
std::string shader_source; std::string shader_source;
u32 temporal_index = 1; u32 temporary_index = 1;
}; };
/// Generates code to use for a swizzle operation. /// Generates code to use for a swizzle operation.
@ -540,7 +540,7 @@ private:
} else if (std::holds_alternative<OperationNode>(*offset)) { } else if (std::holds_alternative<OperationNode>(*offset)) {
// Indirect access // Indirect access
const std::string final_offset = code.GenerateTemporal(); const std::string final_offset = code.GenerateTemporary();
code.AddLine("uint " + final_offset + " = (ftou(" + Visit(offset) + ") / 4) & " + code.AddLine("uint " + final_offset + " = (ftou(" + Visit(offset) + ") / 4) & " +
std::to_string(MAX_CONSTBUFFER_ELEMENTS - 1) + ';'); std::to_string(MAX_CONSTBUFFER_ELEMENTS - 1) + ';');
return fmt::format("{}[{} / 4][{} % 4]", GetConstBuffer(cbuf->GetIndex()), return fmt::format("{}[{} / 4][{} % 4]", GetConstBuffer(cbuf->GetIndex()),
@ -587,9 +587,9 @@ private:
// There's a bug in NVidia's proprietary drivers that makes precise fail on fragment shaders // There's a bug in NVidia's proprietary drivers that makes precise fail on fragment shaders
const std::string precise = stage != ShaderStage::Fragment ? "precise " : ""; const std::string precise = stage != ShaderStage::Fragment ? "precise " : "";
const std::string temporal = code.GenerateTemporal(); const std::string temporary = code.GenerateTemporary();
code.AddLine(precise + "float " + temporal + " = " + value + ';'); code.AddLine(precise + "float " + temporary + " = " + value + ';');
return temporal; return temporary;
} }
std::string VisitOperand(Operation operation, std::size_t operand_index) { std::string VisitOperand(Operation operation, std::size_t operand_index) {
@ -601,9 +601,9 @@ private:
return Visit(operand); return Visit(operand);
} }
const std::string temporal = code.GenerateTemporal(); const std::string temporary = code.GenerateTemporary();
code.AddLine("float " + temporal + " = " + Visit(operand) + ';'); code.AddLine("float " + temporary + " = " + Visit(operand) + ';');
return temporal; return temporary;
} }
std::string VisitOperand(Operation operation, std::size_t operand_index, Type type) { std::string VisitOperand(Operation operation, std::size_t operand_index, Type type) {