mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
OpenGL: use shader 420pack if available to staticly bind ubo location
Bindung locations after compiling a shader stalls the driver. So if we manage not to bind anything after compilation, the lag would be reduced much.
This commit is contained in:
@ -96,7 +96,7 @@ void SHADER::SetProgramVariables()
|
||||
Bind();
|
||||
|
||||
// Bind UBO
|
||||
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO)
|
||||
if (g_ActiveConfig.backend_info.bSupportsGLSLUBO && !g_ActiveConfig.backend_info.bSupportShadingLanguage420pack)
|
||||
{
|
||||
GLint PSBlock_id = glGetUniformBlockIndex(glprogid, "PSBlock");
|
||||
GLint VSBlock_id = glGetUniformBlockIndex(glprogid, "VSBlock");
|
||||
@ -135,7 +135,6 @@ void SHADER::SetProgramVariables()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Bind Texture Sampler
|
||||
for (int a = 0; a <= 9; ++a)
|
||||
{
|
||||
@ -569,6 +568,7 @@ void ProgramShaderCache::CreateHeader ( void )
|
||||
"%s\n"
|
||||
"%s\n" // ubo
|
||||
"%s\n" // early-z
|
||||
"%s\n" // 420pack
|
||||
|
||||
// Precision defines for GLSLES3
|
||||
"%s\n"
|
||||
@ -597,6 +597,7 @@ void ProgramShaderCache::CreateHeader ( void )
|
||||
, v==GLSLES3 ? "#version 300 es" : v==GLSL_130 ? "#version 130" : v==GLSL_140 ? "#version 140" : "#version 150"
|
||||
, g_ActiveConfig.backend_info.bSupportsGLSLUBO && v<GLSL_140 ? "#extension GL_ARB_uniform_buffer_object : enable" : ""
|
||||
, g_ActiveConfig.backend_info.bSupportsEarlyZ ? "#extension GL_ARB_shader_image_load_store : enable" : ""
|
||||
, g_ActiveConfig.backend_info.bSupportShadingLanguage420pack ? "#extension GL_ARB_shading_language_420pack : enable" : ""
|
||||
|
||||
, v==GLSLES3 ? "precision highp float;" : ""
|
||||
|
||||
|
@ -371,6 +371,7 @@ Renderer::Renderer()
|
||||
g_Config.backend_info.bSupportsGLSLUBO = !DriverDetails::HasBug(DriverDetails::BUG_ANNIHILATEDUBOS);
|
||||
g_Config.backend_info.bSupportsPrimitiveRestart = true;
|
||||
g_Config.backend_info.bSupportsEarlyZ = false;
|
||||
g_Config.backend_info.bSupportShadingLanguage420pack = false;
|
||||
|
||||
g_ogl_config.bSupportsGLSLCache = true;
|
||||
g_ogl_config.bSupportsGLPinnedMemory = false;
|
||||
@ -482,6 +483,7 @@ Renderer::Renderer()
|
||||
g_Config.backend_info.bSupportsPrimitiveRestart = !DriverDetails::HasBug(DriverDetails::BUG_PRIMITIVERESTART) &&
|
||||
(TO_BOOL(GLEW_VERSION_3_1) || TO_BOOL(GLEW_NV_primitive_restart));
|
||||
g_Config.backend_info.bSupportsEarlyZ = TO_BOOL(GLEW_ARB_shader_image_load_store);
|
||||
g_Config.backend_info.bSupportShadingLanguage420pack = TO_BOOL(GLEW_ARB_shading_language_420pack);
|
||||
|
||||
g_ogl_config.bSupportsGLSLCache = TO_BOOL(GLEW_ARB_get_program_binary);
|
||||
g_ogl_config.bSupportsGLPinnedMemory = TO_BOOL(GLEW_AMD_pinned_memory);
|
||||
|
Reference in New Issue
Block a user