mirror of https://github.com/RPCS3/rpcs3.git
gl: Properly emulate signed normalized wide integers
Another fix for signed normalized formats; single component vectors are swizzled
This commit is contained in:
parent
98cf72e0fb
commit
30f276a49b
|
@ -186,6 +186,24 @@ void GLVertexDecompilerThread::insertOutputs(std::stringstream & OS, const std::
|
|||
OS << "out vec4 front_spec_color;" << std::endl;
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
std::string expand_to_vec4(std::string value, u8 vector_size)
|
||||
{
|
||||
switch (vector_size)
|
||||
{
|
||||
case 2:
|
||||
return "vec4(" + value + ", " + value + ", 1., 1.)";
|
||||
case 3:
|
||||
return "vec4(" + value + ", " + value + ", " + value + ", 1.)";
|
||||
case 1:
|
||||
case 4:
|
||||
//Expand not required
|
||||
//In case its one component, read is swizzled as .xxxx (GOW1 loading screen)
|
||||
return value;
|
||||
}
|
||||
}
|
||||
|
||||
void add_input(std::stringstream & OS, const ParamItem &PI, const std::vector<rsx_vertex_input> &inputs)
|
||||
{
|
||||
for (const auto &real_input : inputs)
|
||||
|
@ -201,9 +219,9 @@ void add_input(std::stringstream & OS, const ParamItem &PI, const std::vector<rs
|
|||
if (real_input.flags & GL_VP_SINT_MASK)
|
||||
{
|
||||
if (real_input.flags & GL_VP_ATTRIB_S16_INT)
|
||||
scale = " / 32767.";
|
||||
scale = " / " + expand_to_vec4("32767.", real_input.size);
|
||||
else
|
||||
scale = " / 2147483647.";
|
||||
scale = " / " + expand_to_vec4("2147483647.", real_input.size);
|
||||
}
|
||||
|
||||
if (!real_input.is_array)
|
||||
|
@ -232,6 +250,7 @@ void add_input(std::stringstream & OS, const ParamItem &PI, const std::vector<rs
|
|||
|
||||
OS << " vec4 " << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID);" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
void GLVertexDecompilerThread::insertMainStart(std::stringstream & OS)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue