mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-03-10 07:24:54 +01:00
rsx/vk: Improve robustness when encountering corrupted shaders
This commit is contained in:
parent
77cbdd82ab
commit
302e87c920
|
|
@ -868,8 +868,11 @@ std::string FragmentProgramDecompiler::BuildCode()
|
|||
if (!m_is_valid_ucode)
|
||||
{
|
||||
// If the code is broken, do not compile. Simply NOP main and write empty outputs
|
||||
m_parr.params[PF_PARAM_UNIFORM].clear();
|
||||
insertHeader(OS);
|
||||
OS << "\n";
|
||||
insertConstants(OS);
|
||||
OS << "\n";
|
||||
OS << "void main()\n";
|
||||
OS << "{\n";
|
||||
OS << "#if 0\n";
|
||||
|
|
|
|||
|
|
@ -635,9 +635,16 @@ bool VKGSRender::bind_texture_env()
|
|||
{
|
||||
if (!(textures_ref & 1))
|
||||
{
|
||||
// Unused TIU
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_fs_binding_table->ftex_location[i] == umax)
|
||||
{
|
||||
// Corrupt shader table
|
||||
break;
|
||||
}
|
||||
|
||||
vk::image_view* view = nullptr;
|
||||
auto sampler_state = static_cast<vk::texture_cache::sampled_image_descriptor*>(fs_sampler_state[i].get());
|
||||
|
||||
|
|
@ -707,9 +714,16 @@ bool VKGSRender::bind_texture_env()
|
|||
{
|
||||
if (!(textures_ref & 1))
|
||||
{
|
||||
// Unused TIU
|
||||
continue;
|
||||
}
|
||||
|
||||
if (m_vs_binding_table->vtex_location[i] == umax)
|
||||
{
|
||||
// Corrupt shader
|
||||
break;
|
||||
}
|
||||
|
||||
if (!rsx::method_registers.vertex_textures[i].enabled())
|
||||
{
|
||||
const auto view_type = vk::get_view_type(current_vertex_program.get_texture_dimension(i));
|
||||
|
|
|
|||
Loading…
Reference in a new issue