From 2bed338ef7a6c1ee1b10619fa24ba3e0b1508d09 Mon Sep 17 00:00:00 2001 From: x2048 Date: Thu, 16 Mar 2023 14:56:27 +0100 Subject: [PATCH] Fix occasional black screen on startup --- src/client/render/pipeline.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/render/pipeline.cpp b/src/client/render/pipeline.cpp index c6dec2542..3e5347e37 100644 --- a/src/client/render/pipeline.cpp +++ b/src/client/render/pipeline.cpp @@ -140,7 +140,8 @@ bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefini if (definition.valid) { if (definition.clear) { video::IImage *image = m_driver->createImage(definition.format, size); - image->fill(0u); + // Cannot use image->fill because it's not implemented for all formats. + std::memset(image->getData(), 0, image->getDataSizeFromFormat(definition.format, size.Width, size.Height)); *texture = m_driver->addTexture(definition.name.c_str(), image); image->drop(); }