mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-07 23:41:26 +12:00
gl: Fix unnormalized coord sampling.
This commit is contained in:
parent
f712b8aca4
commit
17c4b2387e
3 changed files with 25 additions and 7 deletions
|
@ -85,9 +85,6 @@ void GLFragmentDecompilerThread::insertConstants(std::stringstream & OS)
|
|||
std::string samplerType = PT.type;
|
||||
int index = atoi(&PI.name.data()[3]);
|
||||
|
||||
if (m_prog.unnormalized_coords & (1 << index))
|
||||
samplerType = "sampler2DRect";
|
||||
|
||||
OS << "uniform " << samplerType << " " << PI.name << ";" << std::endl;
|
||||
}
|
||||
}
|
||||
|
@ -163,6 +160,27 @@ void GLFragmentDecompilerThread::insertMainStart(std::stringstream & OS)
|
|||
|
||||
OS << " vec4 ssa = gl_FrontFacing ? vec4(1.) : vec4(-1.);\n";
|
||||
|
||||
for (const ParamType& PT : m_parr.params[PF_PARAM_UNIFORM])
|
||||
{
|
||||
if (PT.type != "sampler2D")
|
||||
continue;
|
||||
|
||||
for (const ParamItem& PI : PT.items)
|
||||
{
|
||||
std::string samplerType = PT.type;
|
||||
int index = atoi(&PI.name.data()[3]);
|
||||
|
||||
if (m_prog.unnormalized_coords & (1 << index))
|
||||
{
|
||||
OS << "vec2 tex" << index << "_coord_scale = 1. / textureSize(" << PI.name << ", 0);\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
OS << "vec2 tex" << index << "_coord_scale = vec2(1.);\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// search if there is fogc in inputs
|
||||
for (const ParamType& PT : m_parr.params[PF_PARAM_IN])
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue