mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 17:15:21 +02:00
Driver: Handle errors during texture creation (#16565)
The OpenGL drivers do accept 'nullptr' textures, however the recent Mip-Mapping change did not respect that. Furthermore, errors during texture creation for the pipeline are now properly handled and shown as an error to the user.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user