gl/vk: Enable vertex texture fetch (#2127)

* gl: Enable vertex textures

* rsx: use textureLod instead of generic texture sample

* rsx: handle uploading of W32_X32_Y32_Z32

* gl: Re-enable proper shader logging

remove old logging method that overwrites single file

* gl: Declare texture_coord_scale for vertex samplers

* gl: texture remap fixes; enable remap for vertex textures

* gl: offset texture indices to base layer 16

* rsx: Fix W32_Z32_Y32_X32_FLOAT subresource layout

* vk: Enable vertex textures

* rsx: define special calls for vertex texture fetch

* gl: improved vertex texture fetch setup

* vk: Fix texture formats and component mapping

* vk: Implement vertex texture fetch functions properly

* vk/gl: proper fix for primitive restart index

revert inadvertent decompiler update

* gl: Disable filtering for vertex textures
This commit is contained in:
kd-11 2016-09-20 17:23:56 +03:00 committed by raven02
parent 77f8ce503d
commit 867e9210d7
16 changed files with 216 additions and 80 deletions

View file

@ -90,7 +90,18 @@ void GLVertexDecompilerThread::insertConstants(std::stringstream & OS, const std
OS << "layout(std140, binding = 1) uniform VertexConstantsBuffer" << std::endl;
OS << "{" << std::endl;
OS << " vec4 vc[468];" << std::endl;
OS << "};" << std::endl;
OS << "};" << std::endl << std::endl;
for (const ParamType &PT: constants)
{
for (const ParamItem &PI : PT.items)
{
if (PI.name == "vc[468]")
continue;
OS << "uniform " << PT.type << " " << PI.name << ";" << std::endl;
}
}
}
struct reg_info
@ -201,6 +212,17 @@ void GLVertexDecompilerThread::insertMainStart(std::stringstream & OS)
for (const ParamItem &PI : PT.items)
add_input(OS, PI, rsx_vertex_program.rsx_vertex_inputs);
}
for (const ParamType &PT : m_parr.params[PF_PARAM_UNIFORM])
{
if (PT.type == "sampler2D")
{
for (const ParamItem &PI : PT.items)
{
OS << " vec2 " << PI.name << "_coord_scale = vec2(1.);" << std::endl;
}
}
}
}
void GLVertexDecompilerThread::insertMainEnd(std::stringstream & OS)
@ -247,6 +269,9 @@ void GLVertexProgram::Compile()
const char* str = shader.c_str();
const int strlen = ::narrow<int>(shader.length());
fs::create_path(fs::get_config_dir() + "/shaderlog");
fs::file(fs::get_config_dir() + "shaderlog/VertexProgram" + std::to_string(id) + ".glsl", fs::rewrite).write(str);
glShaderSource(id, 1, &str, &strlen);
glCompileShader(id);