diff --git a/irr/src/COpenGLDriver.cpp b/irr/src/COpenGLDriver.cpp index 06348cb36c..ac0386b66f 100644 --- a/irr/src/COpenGLDriver.cpp +++ b/irr/src/COpenGLDriver.cpp @@ -2672,7 +2672,8 @@ bool COpenGLDriver::setRenderTargetEx(IRenderTarget *target, u16 clearFlag, SCol // Update mip-map of the generated texture, if enabled. auto textures = CurrentRenderTarget->getTexture(); for (size_t i = 0; i < textures.size(); ++i) - textures[i]->regenerateMipMapLevels(); + if (textures[i]) + textures[i]->regenerateMipMapLevels(); } bool supportForFBO = (Feature.ColorAttachment > 0); diff --git a/irr/src/OpenGL/Driver.cpp b/irr/src/OpenGL/Driver.cpp index 025eeb269e..1aaaf9ddc1 100644 --- a/irr/src/OpenGL/Driver.cpp +++ b/irr/src/OpenGL/Driver.cpp @@ -1704,8 +1704,10 @@ bool COpenGL3DriverBase::setRenderTargetEx(IRenderTarget *target, u16 clearFlag, if (CurrentRenderTarget) { // Update mip-map of the generated texture, if enabled. auto textures = CurrentRenderTarget->getTexture(); - for (size_t i = 0; i < textures.size(); ++i) - textures[i]->regenerateMipMapLevels(); + for (size_t i = 0; i < textures.size(); ++i) { + if (textures[i]) + textures[i]->regenerateMipMapLevels(); + } } core::dimension2d destRenderTargetSize(0, 0); diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp index 9812c4476c..cb791fef05 100644 --- a/src/client/render/pipeline.cpp +++ b/src/client/render/pipeline.cpp @@ -5,6 +5,7 @@ #include "pipeline.h" #include "client/client.h" #include "client/hud.h" +#include "gettext.h" #include "IRenderTarget.h" #include "SColor.h" @@ -85,7 +86,12 @@ void TextureBuffer::reset(PipelineContext &context) for (u32 i = 0; i < m_definitions.size(); i++) { video::ITexture **ptr = &m_textures[i]; - ensureTexture(ptr, m_definitions[i], context); + if (!ensureTexture(ptr, m_definitions[i], context)) { + throw ShaderException( + fmtgettext("Failed to create the texture \"%s\" for the rendering pipeline.", + m_definitions[i].name.c_str()) + + strgettext("\nCheck debug.txt for details.")); + } m_definitions[i].dirty = false; }