gl/vk: Bug fixes and improvements (#2206)

* gl: Only bind attrib textures on thread startup

* gl: Persistent mapped buffers

* gl: Fix emulated primitives in an inlined array

* gl: Do not re-update program information every draw call

* gl/vk: s1 type is signed normalized not unsigned normalized

* gl/rsx: Allow disabling of persistent buffers for debugging

gl: Large heap size is more practical

gl: Fix a bug with legacy opengl buffers

* gl/rsx: Allow emulation of unsupported attribute formats

* gl: Fix typos and remove dprints

gl: cleanup debug prints

* ui: Move the GL legacy buffer toggle to the left pane

* vk/gl: Fix cmp type, its range is [-1,1] not [0,1] SNORM_INT
This commit is contained in:
kd-11 2016-10-18 10:57:28 +03:00 committed by raven02
parent 8454949eea
commit 2c803dbe66
11 changed files with 378 additions and 143 deletions

View file

@ -122,7 +122,7 @@ void GLVertexDecompilerThread::insertInputs(std::stringstream & OS, const std::v
{
if (attrib.location == std::get<0>(item))
{
if (attrib.int_type) is_int = true;
if (attrib.int_type || attrib.flags & GL_VP_SINT_MASK) is_int = true;
break;
}
}
@ -247,9 +247,18 @@ void add_input(std::stringstream & OS, const ParamItem &PI, const std::vector<rs
if (real_input.int_type)
vecType = " ivec4 ";
std::string scale = "";
if (real_input.flags & GL_VP_SINT_MASK)
{
if (real_input.flags & GL_VP_ATTRIB_S16_INT)
scale = " / 32767.";
else
scale = " / 2147483647.";
}
if (!real_input.is_array)
{
OS << vecType << PI.name << " = texelFetch(" << PI.name << "_buffer, 0);" << std::endl;
OS << vecType << PI.name << " = texelFetch(" << PI.name << "_buffer, 0)" << scale << ";" << std::endl;
return;
}
@ -257,19 +266,21 @@ void add_input(std::stringstream & OS, const ParamItem &PI, const std::vector<rs
{
if (real_input.is_modulo)
{
OS << vecType << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID %" << real_input.frequency << ");" << std::endl;
OS << vecType << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID %" << real_input.frequency << ")" << scale << ";" << std::endl;
return;
}
OS << vecType << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID /" << real_input.frequency << ");" << std::endl;
OS << vecType << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID /" << real_input.frequency << ")" << scale << ";" << std::endl;
return;
}
OS << vecType << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID).rgba;" << std::endl;
OS << vecType << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID)" << scale << ";" << std::endl;
return;
}
OS << " vec4 " << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID).rgba;" << std::endl;
LOG_WARNING(RSX, "Vertex input %s does not have a matching vertex_input declaration", PI.name.c_str());
OS << " vec4 " << PI.name << "= texelFetch(" << PI.name << "_buffer, gl_VertexID);" << std::endl;
}
void GLVertexDecompilerThread::insertMainStart(std::stringstream & OS)