mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-29 01:25:38 +00:00
Fixed a texture corruption issue caused by too aggressive optimizations.
This commit is contained in:
parent
796951bf44
commit
fa993a0489
|
@ -58,8 +58,8 @@ bool TextureData::initSVGFromMemory(const std::string& fileData)
|
|||
{
|
||||
std::unique_lock<std::mutex> lock{mMutex};
|
||||
|
||||
// If already initialized then don't process it again.
|
||||
if (!mDataRGBA.empty())
|
||||
// If already initialized then don't process it again unless it needs to be rasterized.
|
||||
if (!mDataRGBA.empty() && !mPendingRasterization)
|
||||
return true;
|
||||
|
||||
NSVGimage* svgImage{nsvgParse(const_cast<char*>(fileData.c_str()), "px", DPI)};
|
||||
|
@ -282,7 +282,7 @@ float TextureData::sourceHeight()
|
|||
void TextureData::setSourceSize(float width, float height)
|
||||
{
|
||||
if (mScalable) {
|
||||
if ((mSourceWidth != width) || (mSourceHeight != height)) {
|
||||
if (mSourceWidth != width || mSourceHeight != height) {
|
||||
mSourceWidth = width;
|
||||
mSourceHeight = height;
|
||||
releaseVRAM();
|
||||
|
|
|
@ -197,7 +197,8 @@ void TextureResource::rasterizeAt(float width, float height)
|
|||
{
|
||||
if (mTextureData != nullptr) {
|
||||
glm::vec2 textureSize = mTextureData.get()->getSize();
|
||||
if (textureSize.x == width && textureSize.y == height)
|
||||
if (textureSize.x == width && textureSize.y == height &&
|
||||
!mTextureData.get()->getPendingRasterization())
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue