From d4e85e2bb5cd9678eb648c414e30adaad58e1fad Mon Sep 17 00:00:00 2001 From: SachinVin <26602104+SachinVin@users.noreply.github.com> Date: Sun, 3 Oct 2021 18:57:34 +0530 Subject: [PATCH] video_core: Disable disk shader cache when GL_ARB_get_program_binary is unsupported (#5785) --- src/video_core/renderer_opengl/gl_shader_disk_cache.cpp | 4 ---- src/video_core/renderer_opengl/gl_shader_manager.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp index a44fc299d..974fede66 100644 --- a/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp +++ b/src/video_core/renderer_opengl/gl_shader_disk_cache.cpp @@ -365,10 +365,6 @@ void ShaderDiskCache::SaveDecompiled(u64 unique_identifier, void ShaderDiskCache::SaveDump(u64 unique_identifier, GLuint program) { if (!IsUsable()) return; - if (!GLAD_GL_ARB_get_program_binary) { - LOG_WARNING(Render_OpenGL, "ARB_get_program_binary is not supported. Problems may occur if " - "use_disk_shader_cache is ON."); - } GLint binary_length{}; glGetProgramiv(program, GL_PROGRAM_BINARY_LENGTH, &binary_length); diff --git a/src/video_core/renderer_opengl/gl_shader_manager.cpp b/src/video_core/renderer_opengl/gl_shader_manager.cpp index 8a878b65a..1452c84d7 100644 --- a/src/video_core/renderer_opengl/gl_shader_manager.cpp +++ b/src/video_core/renderer_opengl/gl_shader_manager.cpp @@ -442,6 +442,12 @@ void ShaderProgramManager::LoadDiskCache(const std::atomic_bool& stop_loading, "Cannot load disk cache as separate shader programs are unsupported!"); return; } + if (!GLAD_GL_ARB_get_program_binary) { + LOG_ERROR(Render_OpenGL, + "Cannot load disk cache as ARB_get_program_binary is not supported!"); + return; + } + auto& disk_cache = impl->disk_cache; const auto transferable = disk_cache.LoadTransferable(); if (!transferable) {