rsx/vk: Improve robustness when encountering corrupted shaders
This commit is contained in:
@@ -868,8 +868,11 @@ std::string FragmentProgramDecompiler::BuildCode()
|
|||||||
if (!m_is_valid_ucode)
|
if (!m_is_valid_ucode)
|
||||||
{
|
{
|
||||||
// If the code is broken, do not compile. Simply NOP main and write empty outputs
|
// If the code is broken, do not compile. Simply NOP main and write empty outputs
|
||||||
|
m_parr.params[PF_PARAM_UNIFORM].clear();
|
||||||
insertHeader(OS);
|
insertHeader(OS);
|
||||||
OS << "\n";
|
OS << "\n";
|
||||||
|
insertConstants(OS);
|
||||||
|
OS << "\n";
|
||||||
OS << "void main()\n";
|
OS << "void main()\n";
|
||||||
OS << "{\n";
|
OS << "{\n";
|
||||||
OS << "#if 0\n";
|
OS << "#if 0\n";
|
||||||
|
|||||||
@@ -635,9 +635,16 @@ bool VKGSRender::bind_texture_env()
|
|||||||
{
|
{
|
||||||
if (!(textures_ref & 1))
|
if (!(textures_ref & 1))
|
||||||
{
|
{
|
||||||
|
// Unused TIU
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_fs_binding_table->ftex_location[i] == umax)
|
||||||
|
{
|
||||||
|
// Corrupt shader table
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
vk::image_view* view = nullptr;
|
vk::image_view* view = nullptr;
|
||||||
auto sampler_state = static_cast<vk::texture_cache::sampled_image_descriptor*>(fs_sampler_state[i].get());
|
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))
|
if (!(textures_ref & 1))
|
||||||
{
|
{
|
||||||
|
// Unused TIU
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_vs_binding_table->vtex_location[i] == umax)
|
||||||
|
{
|
||||||
|
// Corrupt shader
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!rsx::method_registers.vertex_textures[i].enabled())
|
if (!rsx::method_registers.vertex_textures[i].enabled())
|
||||||
{
|
{
|
||||||
const auto view_type = vk::get_view_type(current_vertex_program.get_texture_dimension(i));
|
const auto view_type = vk::get_view_type(current_vertex_program.get_texture_dimension(i));
|
||||||
|
|||||||
Reference in New Issue
Block a user