1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

Drop fixed pipeline support code (#15421)

OpenGL 2.0 is now mandatory.
This commit is contained in:
sfan5
2024-11-13 14:24:01 +01:00
committed by GitHub
parent 0fde9ab7e8
commit 794aea8e92
35 changed files with 117 additions and 411 deletions

View File

@@ -107,25 +107,13 @@ void ShadowRenderer::disable()
void ShadowRenderer::preInit(IWritableShaderSource *shsrc)
{
if (g_settings->getBool("enable_shaders") &&
g_settings->getBool("enable_dynamic_shadows")) {
if (g_settings->getBool("enable_dynamic_shadows")) {
shsrc->addShaderConstantSetterFactory(new ShadowConstantSetterFactory());
}
}
void ShadowRenderer::initialize()
{
auto *gpu = m_driver->getGPUProgrammingServices();
// we need glsl
if (!m_shadows_supported || !gpu || !m_driver->queryFeature(video::EVDF_ARB_GLSL)) {
m_shadows_supported = false;
warningstream << "Shadows: GLSL Shader not supported on this system."
<< std::endl;
return;
}
createShaders();
@@ -533,7 +521,7 @@ void ShadowRenderer::mixShadowsQuad()
void ShadowRenderer::createShaders()
{
video::IGPUProgrammingServices *gpu = m_driver->getGPUProgrammingServices();
auto *gpu = m_driver->getGPUProgrammingServices();
if (depth_shader == -1) {
std::string depth_shader_vs = getShaderPath("shadow_shaders", "pass1_vertex.glsl");
@@ -706,14 +694,12 @@ std::string ShadowRenderer::readShaderFile(const std::string &path)
ShadowRenderer *createShadowRenderer(IrrlichtDevice *device, Client *client)
{
// disable if unsupported
if (g_settings->getBool("enable_dynamic_shadows") && (
device->getVideoDriver()->getDriverType() != video::EDT_OPENGL ||
!g_settings->getBool("enable_shaders"))) {
if (g_settings->getBool("enable_dynamic_shadows") &&
device->getVideoDriver()->getDriverType() != video::EDT_OPENGL) {
g_settings->setBool("enable_dynamic_shadows", false);
}
if (g_settings->getBool("enable_shaders") &&
g_settings->getBool("enable_dynamic_shadows")) {
if (g_settings->getBool("enable_dynamic_shadows")) {
ShadowRenderer *shadow_renderer = new ShadowRenderer(device, client);
shadow_renderer->initialize();
return shadow_renderer;