mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-30 19:22:14 +00:00
Fix bloom with post_processing_texture_bits < 16
This commit is contained in:
parent
7354cbe463
commit
eb8beb335e
3 changed files with 27 additions and 9 deletions
|
@ -6,6 +6,7 @@
|
|||
#include "client/client.h"
|
||||
#include "client/hud.h"
|
||||
#include "IRenderTarget.h"
|
||||
#include "SColor.h"
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
|
@ -122,10 +123,19 @@ bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefini
|
|||
if (!modify)
|
||||
return false;
|
||||
|
||||
if (*texture)
|
||||
if (*texture) {
|
||||
m_driver->removeTexture(*texture);
|
||||
*texture = nullptr;
|
||||
}
|
||||
|
||||
if (definition.valid) {
|
||||
if (!m_driver->queryTextureFormat(definition.format)) {
|
||||
errorstream << "Failed to create texture \"" << definition.name
|
||||
<< "\": unsupported format " << video::ColorFormatNames[definition.format]
|
||||
<< std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (definition.clear) {
|
||||
// We're not able to clear a render target texture
|
||||
// We're not able to create a normal texture with MSAA
|
||||
|
@ -142,9 +152,12 @@ bool TextureBuffer::ensureTexture(video::ITexture **texture, const TextureDefini
|
|||
} else {
|
||||
*texture = m_driver->addRenderTargetTexture(size, definition.name.c_str(), definition.format);
|
||||
}
|
||||
}
|
||||
else {
|
||||
*texture = nullptr;
|
||||
|
||||
if (!*texture) {
|
||||
errorstream << "Failed to create texture \"" << definition.name
|
||||
<< "\"" << std::endl;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue