Added a check for GL_ARB_explicit_attrib_location extension.
It is enabled by default for OpenGL 3.3, but we need it for some of our shaders in render_geometry.cpp (which are OpenGL >= 3.2) and also for InstancedColorizeShader.
This commit is contained in:
parent
53f9d9d1ba
commit
41283ad408
@ -46,6 +46,7 @@ void CentralVideoSettings::init()
|
||||
hasMultiDrawIndirect = false;
|
||||
hasTextureCompression = false;
|
||||
hasUBO = false;
|
||||
hasExplicitAttribLocation = false;
|
||||
hasGS = false;
|
||||
|
||||
m_GI_has_artifact = false;
|
||||
@ -154,6 +155,11 @@ void CentralVideoSettings::init()
|
||||
hasUBO = true;
|
||||
Log::info("GLDriver", "ARB Uniform Buffer Object Present");
|
||||
}
|
||||
if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_EXPLICIT_ATTRIB_LOCATION) &&
|
||||
hasGLExtension("GL_ARB_explicit_attrib_location")) {
|
||||
hasExplicitAttribLocation = true;
|
||||
Log::info("GLDriver", "ARB Explicit Attrib Location Present");
|
||||
}
|
||||
if (!GraphicsRestrictions::isDisabled(GraphicsRestrictions::GR_GEOMETRY_SHADER) &&
|
||||
(m_gl_major_version > 3 || (m_gl_major_version == 3 && m_gl_minor_version >= 2))) {
|
||||
hasGS = true;
|
||||
@ -229,7 +235,7 @@ bool CentralVideoSettings::needsSRGBCapableVisualWorkaround() const
|
||||
return m_need_srgb_visual_workaround;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBGeometryShader4Usable() const
|
||||
bool CentralVideoSettings::isARBGeometryShadersUsable() const
|
||||
{
|
||||
return hasGS;
|
||||
}
|
||||
@ -239,6 +245,11 @@ bool CentralVideoSettings::isARBUniformBufferObjectUsable() const
|
||||
return hasUBO;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isARBExplicitAttribLocationUsable() const
|
||||
{
|
||||
return hasExplicitAttribLocation;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::isEXTTextureCompressionS3TCUsable() const
|
||||
{
|
||||
return hasTextureCompression;
|
||||
@ -311,12 +322,12 @@ bool CentralVideoSettings::isARBMultiDrawIndirectUsable() const
|
||||
|
||||
bool CentralVideoSettings::supportsShadows() const
|
||||
{
|
||||
return isARBGeometryShader4Usable() && isARBUniformBufferObjectUsable();
|
||||
return isARBGeometryShadersUsable() && isARBUniformBufferObjectUsable() && isARBExplicitAttribLocationUsable();
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::supportsGlobalIllumination() const
|
||||
{
|
||||
return isARBGeometryShader4Usable() && isARBUniformBufferObjectUsable() && !m_GI_has_artifact;
|
||||
return isARBGeometryShadersUsable() && isARBUniformBufferObjectUsable() && isARBExplicitAttribLocationUsable() && !m_GI_has_artifact;
|
||||
}
|
||||
|
||||
bool CentralVideoSettings::supportsIndirectInstancingRendering() const
|
||||
|
@ -35,6 +35,7 @@ private:
|
||||
bool hasTextureView;
|
||||
bool hasBindlessTexture;
|
||||
bool hasUBO;
|
||||
bool hasExplicitAttribLocation;
|
||||
bool hasGS;
|
||||
bool hasTextureCompression;
|
||||
bool hasAtomics;
|
||||
@ -60,7 +61,7 @@ public:
|
||||
bool isARBUniformBufferObjectUsable() const;
|
||||
bool isEXTTextureCompressionS3TCUsable() const;
|
||||
bool isARBTextureViewUsable() const;
|
||||
bool isARBGeometryShader4Usable() const;
|
||||
bool isARBGeometryShadersUsable() const;
|
||||
bool isARBTextureStorageUsable() const;
|
||||
bool isAMDVertexShaderLayerUsable() const;
|
||||
bool isARBComputeShaderUsable() const;
|
||||
@ -73,6 +74,7 @@ public:
|
||||
bool isARBShaderStorageBufferObjectUsable() const;
|
||||
bool isARBImageLoadStoreUsable() const;
|
||||
bool isARBMultiDrawIndirectUsable() const;
|
||||
bool isARBExplicitAttribLocationUsable() const;
|
||||
|
||||
|
||||
// Are all required extensions available for feature support
|
||||
|
@ -56,6 +56,7 @@ namespace GraphicsRestrictions
|
||||
"BindlessTexture",
|
||||
"TextureCompressionS3TC",
|
||||
"AMDVertexShaderLayer",
|
||||
"ExplicitAttribLocation",
|
||||
"DriverRecentEnough",
|
||||
"HighDefinitionTextures",
|
||||
"AdvancedPipeline",
|
||||
|
@ -50,6 +50,7 @@ namespace GraphicsRestrictions
|
||||
GR_BINDLESS_TEXTURE,
|
||||
GR_EXT_TEXTURE_COMPRESSION_S3TC,
|
||||
GR_AMD_VERTEX_SHADER_LAYER,
|
||||
GR_EXPLICIT_ATTRIB_LOCATION,
|
||||
GR_DRIVER_RECENT_ENOUGH,
|
||||
GR_HIGHDEFINITION_TEXTURES,
|
||||
GR_ADVANCED_PIPELINE,
|
||||
|
@ -674,7 +674,7 @@ void IrrDriver::renderGlow(std::vector<GlowData>& glows)
|
||||
node->render();
|
||||
}
|
||||
|
||||
if (CVS->supportsIndirectInstancingRendering())
|
||||
if (CVS->supportsIndirectInstancingRendering() && CVS->isARBExplicitAttribLocationUsable())
|
||||
{
|
||||
glBindBuffer(GL_DRAW_INDIRECT_BUFFER, GlowPassCmd::getInstance()->drawindirectcmd);
|
||||
InstancedColorizeShader::getInstance()->use();
|
||||
|
@ -83,6 +83,9 @@ GLuint ShaderBase::loadShader(const std::string &file, unsigned type)
|
||||
|
||||
if (CVS->isAMDVertexShaderLayerUsable())
|
||||
code << "#extension GL_AMD_vertex_shader_layer : enable\n";
|
||||
|
||||
if (CVS->isARBExplicitAttribLocationUsable())
|
||||
code << "#extension GL_ARB_explicit_attrib_location : enable\n";
|
||||
|
||||
if (CVS->isAZDOEnabled())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user