mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-18 04:45:39 +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};
|
std::unique_lock<std::mutex> lock{mMutex};
|
||||||
|
|
||||||
// If already initialized then don't process it again.
|
// If already initialized then don't process it again unless it needs to be rasterized.
|
||||||
if (!mDataRGBA.empty())
|
if (!mDataRGBA.empty() && !mPendingRasterization)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
NSVGimage* svgImage{nsvgParse(const_cast<char*>(fileData.c_str()), "px", DPI)};
|
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)
|
void TextureData::setSourceSize(float width, float height)
|
||||||
{
|
{
|
||||||
if (mScalable) {
|
if (mScalable) {
|
||||||
if ((mSourceWidth != width) || (mSourceHeight != height)) {
|
if (mSourceWidth != width || mSourceHeight != height) {
|
||||||
mSourceWidth = width;
|
mSourceWidth = width;
|
||||||
mSourceHeight = height;
|
mSourceHeight = height;
|
||||||
releaseVRAM();
|
releaseVRAM();
|
||||||
|
|
|
@ -197,7 +197,8 @@ void TextureResource::rasterizeAt(float width, float height)
|
||||||
{
|
{
|
||||||
if (mTextureData != nullptr) {
|
if (mTextureData != nullptr) {
|
||||||
glm::vec2 textureSize = mTextureData.get()->getSize();
|
glm::vec2 textureSize = mTextureData.get()->getSize();
|
||||||
if (textureSize.x == width && textureSize.y == height)
|
if (textureSize.x == width && textureSize.y == height &&
|
||||||
|
!mTextureData.get()->getPendingRasterization())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue