1
0
forked from mirrors/0ad

Removes ARBShader capability

This commit is contained in:
Vladislav Belov
2025-10-14 12:44:44 +02:00
parent e2ed4afe00
commit f2752f7230
7 changed files with 8 additions and 23 deletions
+1 -1
View File
@@ -222,7 +222,7 @@ bool CShaderManager::LoadTechnique(CShaderTechniquePtr& tech)
XMBElement root = XeroFile.GetRoot();
PS::StaticVector<std::string_view, 3> supportedShaders;
if (m_Device->GetBackend() == Renderer::Backend::Backend::GL_ARB && m_Device->GetCapabilities().ARBShaders)
if (m_Device->GetBackend() == Renderer::Backend::Backend::GL_ARB)
supportedShaders.emplace_back("arb");
if (m_Device->GetBackend() == Renderer::Backend::Backend::GL)
supportedShaders.emplace_back("glsl");
+1 -18
View File
@@ -431,25 +431,8 @@ void CRenderer::SetRenderPath(RenderPath rp)
}
// Renderer has been opened, so validate the selected renderpath
const bool hasShadersSupport =
m->device->GetCapabilities().ARBShaders ||
m->device->GetBackend() != Renderer::Backend::Backend::GL_ARB;
if (rp == RenderPath::DEFAULT)
{
if (hasShadersSupport)
rp = RenderPath::SHADER;
else
rp = RenderPath::FIXED;
}
if (rp == RenderPath::SHADER)
{
if (!hasShadersSupport)
{
LOGWARNING("Falling back to fixed function\n");
rp = RenderPath::FIXED;
}
}
rp = RenderPath::SHADER;
// TODO: remove this once capabilities have been properly extracted and the above checks have been moved elsewhere.
g_RenderingOptions.m_RenderPath = rp;
-1
View File
@@ -62,7 +62,6 @@ public:
struct Capabilities
{
bool S3TC;
bool ARBShaders;
bool computeShaders;
bool debugLabels;
bool debugScopedLabels;
-1
View File
@@ -52,7 +52,6 @@ CDevice::CDevice()
m_Backbuffer = CFramebuffer::Create(this);
m_Capabilities.S3TC = true;
m_Capabilities.ARBShaders = false;
m_Capabilities.computeShaders = true;
m_Capabilities.debugLabels = true;
m_Capabilities.debugScopedLabels = true;
+4 -1
View File
@@ -324,6 +324,10 @@ std::unique_ptr<IDevice> CDevice::Create(SDL_Window* window, const bool arb)
if (!arb && !ogl_HaveVersion(2, 0))
return nullptr;
// We can't render without ARB shaders.
if (arb && ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", nullptr))
return nullptr;
if ((ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", nullptr) // ARB
&& !ogl_HaveVersion(2, 0)) // GLSL
|| !ogl_HaveExtension("GL_ARB_vertex_buffer_object") // VBO
@@ -375,7 +379,6 @@ std::unique_ptr<IDevice> CDevice::Create(SDL_Window* window, const bool arb)
}
Capabilities& capabilities = device->m_Capabilities;
capabilities.ARBShaders = !ogl_HaveExtensions(0, "GL_ARB_vertex_program", "GL_ARB_fragment_program", nullptr);
capabilities.computeShaders = !device->m_ARB && ogl_HaveVersion(4, 3);
#if CONFIG2_GLES
// Some GLES implementations have GL_EXT_texture_compression_dxt1
@@ -578,7 +578,6 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window)
capabilities.debugLabels = enableDebugLabels;
capabilities.debugScopedLabels = enableDebugScopedLabels;
capabilities.S3TC = choosenDevice.features.textureCompressionBC;
capabilities.ARBShaders = false;
capabilities.computeShaders = true;
capabilities.storage = choosenDevice.properties.limits.maxStorageBufferRange >= GiB;
capabilities.instancing = true;
@@ -63,3 +63,5 @@ unknownMacro:source/lib/sysdep/os/win/wposix/wutsname.cpp
unknownMacro:source/ps/CStr.cpp
uninitvar:source/graphics/MapReader.cpp
danglingLifetime:source/renderer/backend/gl/Device.cpp