1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-06-30 08:24:05 +00:00

Revert "Check that texture fit TMEM before load."

This reverts commit 7417144f64.
This commit is contained in:
Sergey Lipskiy 2022-02-12 12:57:58 +07:00
parent 7417144f64
commit 1e0699bf73

View File

@ -20,7 +20,6 @@
#include "Graphics/Context.h"
#include "Graphics/Parameters.h"
#include "DisplayWindow.h"
#include "Log.h"
using namespace std;
using namespace graphics;
@ -1151,19 +1150,6 @@ void doubleTexture(T* pTex, u32 width, u32 height)
}
}
static
bool checkTextureSize(CachedTexture *_pTexture)
{
// Sanity check: size of texture in bytes must not exceed TMEM size.
auto sizeInBytes = ((_pTexture->width * _pTexture->height) << _pTexture->size >> 1);
if (sizeInBytes <= 0x1000)
return true;;
LOG(LOG_ERROR, "%s wrong texture size. width: %d, height: %d, size: %d, bytes: %d",
RSP.romname, _pTexture->width, _pTexture->height, _pTexture->size, sizeInBytes);
return false;
}
void TextureCache::_loadFast(u32 _tile, CachedTexture *_pTexture)
{
u64 ricecrc = 0;
@ -1202,9 +1188,6 @@ void TextureCache::_loadFast(u32 _tile, CachedTexture *_pTexture)
}
_pTexture->textureBytes = (_pTexture->width * _pTexture->height) << sizeShift;
if (!checkTextureSize(_pTexture))
return;
unsigned int totalTexSize = std::max(static_cast<u32>(_pTexture->textureBytes/sizeof(u32) + 8), MIPMAP_TILE_WIDTH)
* (_pTexture->max_level + 1);
@ -1391,9 +1374,6 @@ void TextureCache::_loadAccurate(u32 _tile, CachedTexture *_pTexture)
}
_pTexture->textureBytes = (_pTexture->width * _pTexture->height) << sizeShift;
if (!checkTextureSize(_pTexture))
return;
unsigned int totalTexSize = std::max(static_cast<u32>(_pTexture->textureBytes/sizeof(u32) + 8), MIPMAP_TILE_WIDTH)
* (_pTexture->max_level + 1);