mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-14 14:10:08 +00:00
ShaderGen: Add UseGLSLInterfaceBlocks()
This commit is contained in:
parent
f273dcff18
commit
601173b01e
@ -32,11 +32,14 @@ ShaderGen::ShaderGen(RenderAPI render_api, GPUShaderLanguage shader_language, bo
|
|||||||
{
|
{
|
||||||
m_glsl_version = GetGLSLVersion(render_api);
|
m_glsl_version = GetGLSLVersion(render_api);
|
||||||
m_glsl_version_string = GetGLSLVersionString(m_render_api, m_glsl_version);
|
m_glsl_version_string = GetGLSLVersionString(m_render_api, m_glsl_version);
|
||||||
|
m_use_glsl_interface_blocks = UseGLSLInterfaceBlocks();
|
||||||
|
m_use_glsl_binding_layout = UseGLSLBindingLayout();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_use_glsl_interface_blocks = (shader_language == GPUShaderLanguage::GLSLVK);
|
||||||
|
m_use_glsl_binding_layout = (shader_language == GPUShaderLanguage::GLSLVK);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_use_glsl_interface_blocks =
|
|
||||||
(shader_language == GPUShaderLanguage::GLSLVK || GLAD_GL_ES_VERSION_3_2 || GLAD_GL_VERSION_3_2);
|
|
||||||
m_use_glsl_binding_layout = (shader_language == GPUShaderLanguage::GLSLVK || UseGLSLBindingLayout());
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (m_shader_language == GPUShaderLanguage::GLSL)
|
if (m_shader_language == GPUShaderLanguage::GLSL)
|
||||||
@ -80,6 +83,15 @@ GPUShaderLanguage ShaderGen::GetShaderLanguageForAPI(RenderAPI api)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ShaderGen::UseGLSLInterfaceBlocks()
|
||||||
|
{
|
||||||
|
#ifdef ENABLE_OPENGL
|
||||||
|
return (GLAD_GL_ES_VERSION_3_2 || GLAD_GL_VERSION_3_2);
|
||||||
|
#else
|
||||||
|
return true;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool ShaderGen::UseGLSLBindingLayout()
|
bool ShaderGen::UseGLSLBindingLayout()
|
||||||
{
|
{
|
||||||
#ifdef ENABLE_OPENGL
|
#ifdef ENABLE_OPENGL
|
||||||
|
@ -18,6 +18,7 @@ public:
|
|||||||
~ShaderGen();
|
~ShaderGen();
|
||||||
|
|
||||||
static GPUShaderLanguage GetShaderLanguageForAPI(RenderAPI api);
|
static GPUShaderLanguage GetShaderLanguageForAPI(RenderAPI api);
|
||||||
|
static bool UseGLSLInterfaceBlocks();
|
||||||
static bool UseGLSLBindingLayout();
|
static bool UseGLSLBindingLayout();
|
||||||
|
|
||||||
static u32 GetGLSLVersion(RenderAPI render_api);
|
static u32 GetGLSLVersion(RenderAPI render_api);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user