mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-11 06:40:39 +00:00
gl: Use const and ref for loops in GLFragmentProgram.cpp
This commit is contained in:
parent
c86cfef58e
commit
399478c2cd
@ -33,9 +33,9 @@ void GLFragmentDecompilerThread::insertHeader(std::stringstream & OS)
|
|||||||
|
|
||||||
void GLFragmentDecompilerThread::insertIntputs(std::stringstream & OS)
|
void GLFragmentDecompilerThread::insertIntputs(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
for (ParamType PT : m_parr.params[PF_PARAM_IN])
|
for (const ParamType& PT : m_parr.params[PF_PARAM_IN])
|
||||||
{
|
{
|
||||||
for (ParamItem PI : PT.items)
|
for (const ParamItem& PI : PT.items)
|
||||||
OS << "in " << PT.type << " " << PI.name << ";" << std::endl;
|
OS << "in " << PT.type << " " << PI.name << ";" << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -59,22 +59,22 @@ void GLFragmentDecompilerThread::insertOutputs(std::stringstream & OS)
|
|||||||
|
|
||||||
void GLFragmentDecompilerThread::insertConstants(std::stringstream & OS)
|
void GLFragmentDecompilerThread::insertConstants(std::stringstream & OS)
|
||||||
{
|
{
|
||||||
for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM])
|
for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM])
|
||||||
{
|
{
|
||||||
if (PT.type != "sampler2D")
|
if (PT.type != "sampler2D")
|
||||||
continue;
|
continue;
|
||||||
for (ParamItem PI : PT.items)
|
for (const ParamItem& PI : PT.items)
|
||||||
OS << "uniform " << PT.type << " " << PI.name << ";" << std::endl;
|
OS << "uniform " << PT.type << " " << PI.name << ";" << std::endl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
OS << "layout(std140, binding = 2) uniform FragmentConstantsBuffer" << std::endl;
|
OS << "layout(std140, binding = 2) uniform FragmentConstantsBuffer" << std::endl;
|
||||||
OS << "{" << std::endl;
|
OS << "{" << std::endl;
|
||||||
for (ParamType PT : m_parr.params[PF_PARAM_UNIFORM])
|
for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM])
|
||||||
{
|
{
|
||||||
if (PT.type == "sampler2D")
|
if (PT.type == "sampler2D")
|
||||||
continue;
|
continue;
|
||||||
for (ParamItem PI : PT.items)
|
for (const ParamItem& PI : PT.items)
|
||||||
OS << " " << PT.type << " " << PI.name << ";" << std::endl;
|
OS << " " << PT.type << " " << PI.name << ";" << std::endl;
|
||||||
}
|
}
|
||||||
// A dummy value otherwise it's invalid to create an empty uniform buffer
|
// A dummy value otherwise it's invalid to create an empty uniform buffer
|
||||||
@ -87,9 +87,9 @@ void GLFragmentDecompilerThread::insertMainStart(std::stringstream & OS)
|
|||||||
OS << "void main ()" << std::endl;
|
OS << "void main ()" << std::endl;
|
||||||
OS << "{" << std::endl;
|
OS << "{" << std::endl;
|
||||||
|
|
||||||
for (ParamType PT : m_parr.params[PF_PARAM_NONE])
|
for (const ParamType& PT : m_parr.params[PF_PARAM_NONE])
|
||||||
{
|
{
|
||||||
for (ParamItem PI : PT.items)
|
for (const ParamItem& PI : PT.items)
|
||||||
{
|
{
|
||||||
OS << " " << PT.type << " " << PI.name;
|
OS << " " << PT.type << " " << PI.name;
|
||||||
if (!PI.value.empty())
|
if (!PI.value.empty())
|
||||||
@ -158,7 +158,7 @@ void GLFragmentProgram::Decompile(RSXFragmentProgram& prog)
|
|||||||
decompiler.Task();
|
decompiler.Task();
|
||||||
for (const ParamType& PT : decompiler.m_parr.params[PF_PARAM_UNIFORM])
|
for (const ParamType& PT : decompiler.m_parr.params[PF_PARAM_UNIFORM])
|
||||||
{
|
{
|
||||||
for (const ParamItem PI : PT.items)
|
for (const ParamItem& PI : PT.items)
|
||||||
{
|
{
|
||||||
if (PT.type == "sampler2D")
|
if (PT.type == "sampler2D")
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user