Add flag to disable seperable shaders for osx Intel GPUs. Default is false

This commit is contained in:
B3n30 2020-04-18 13:37:58 +02:00
parent 79a0cbbba8
commit 1e54f27cde
10 changed files with 49 additions and 12 deletions

View file

@ -43,6 +43,10 @@ static bool IsVendorAmd() {
std::string gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
return gpu_vendor == "ATI Technologies Inc." || gpu_vendor == "Advanced Micro Devices, Inc.";
}
static bool IsVendorIntel() {
std::string gpu_vendor{reinterpret_cast<char const*>(glGetString(GL_VENDOR))};
return gpu_vendor == "Intel Inc.";
}
RasterizerOpenGL::RasterizerOpenGL(Frontend::EmuWindow& window)
: is_amd(IsVendorAmd()), shader_dirty(true),
@ -161,8 +165,19 @@ RasterizerOpenGL::RasterizerOpenGL(Frontend::EmuWindow& window)
state.Apply();
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, index_buffer.GetHandle());
#ifdef __APPLE__
if (IsVendorIntel()) {
shader_program_manager = std::make_unique<ShaderProgramManager>(
VideoCore::g_seperable_shader_enabled ? GLAD_GL_ARB_separate_shader_objects : false,
is_amd);
} else {
shader_program_manager =
std::make_unique<ShaderProgramManager>(GLAD_GL_ARB_separate_shader_objects, is_amd);
}
#else
shader_program_manager =
std::make_unique<ShaderProgramManager>(GLAD_GL_ARB_separate_shader_objects, is_amd);
#endif
glEnable(GL_BLEND);