Fix black bed texture if svg file (#11166)
Some checks failed
Build all / Build Linux (push) Has been cancelled
Build all / Build Non-Linux (push) Has been cancelled
Build all / Flatpak (push) Has been cancelled
Build all / Unit Tests (push) Has been cancelled

* Fix blank bed texture if svg file

* Refresh scene once the texture compression is completed
This commit is contained in:
Noisyfox 2025-10-31 16:53:08 +08:00 committed by GitHub
parent 99863163b2
commit 05533a7fd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 19 additions and 5 deletions

View file

@ -101,6 +101,8 @@ void GLTexture::Compressor::send_compressed_data_to_gpu()
this->reset();
}
std::atomic<bool> GLTexture::Compressor::m_dirty = false;
void GLTexture::Compressor::compress()
{
// reference: https://github.com/Cyan4973/RygsDXTc
@ -123,6 +125,11 @@ void GLTexture::Compressor::compress()
level.src_data.clear();
++ m_num_levels_compressed;
}
// Trigger an idle event to refresh the scene once the texture data is ready
// This fixes the issue that the bed texture is black after switching printer model until mouse moves to the 3d scene
m_dirty = true;
wxWakeUpIdle();
}
GLTexture::Quad_UVs GLTexture::FullTextureUVs = { { 0.0f, 1.0f }, { 1.0f, 1.0f }, { 1.0f, 0.0f }, { 0.0f, 0.0f } };