mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-25 22:09:35 +00:00
Remove 'Video RAM usage limit' config option.
This commit is contained in:
parent
a2ac255710
commit
4e36fa07a2
|
@ -29,7 +29,6 @@ void Config::resetToDefaults()
|
|||
|
||||
texture.maxAnisotropy = 0;
|
||||
texture.bilinearMode = BILINEAR_STANDARD;
|
||||
texture.maxBytes = 500 * gc_uMegabyte;
|
||||
texture.screenShotFormat = 0;
|
||||
|
||||
generalEmulation.enableLOD = 1;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <string>
|
||||
#include "Types.h"
|
||||
|
||||
#define CONFIG_VERSION_CURRENT 18U
|
||||
#define CONFIG_VERSION_CURRENT 19U
|
||||
|
||||
#define BILINEAR_3POINT 0
|
||||
#define BILINEAR_STANDARD 1
|
||||
|
@ -40,7 +40,6 @@ struct Config
|
|||
u32 maxAnisotropy;
|
||||
f32 maxAnisotropyF;
|
||||
u32 bilinearMode;
|
||||
u32 maxBytes;
|
||||
u32 screenShotFormat;
|
||||
} texture;
|
||||
|
||||
|
|
|
@ -106,7 +106,6 @@ void ConfigDialog::_init()
|
|||
ui->aliasingSlider->setValue(powof(config.video.multisampling));
|
||||
ui->aliasingLabelVal->setText(QString::number(config.video.multisampling));
|
||||
ui->anisotropicSlider->setValue(config.texture.maxAnisotropy);
|
||||
ui->cacheSizeSpinBox->setValue(config.texture.maxBytes / gc_uMegabyte);
|
||||
ui->vSyncCheckBox->setChecked(config.video.verticalSync != 0);
|
||||
|
||||
switch (config.texture.bilinearMode) {
|
||||
|
@ -362,7 +361,6 @@ void ConfigDialog::accept()
|
|||
|
||||
config.video.multisampling = ui->n64DepthCompareCheckBox->isChecked() ? 0 : pow2(ui->aliasingSlider->value());
|
||||
config.texture.maxAnisotropy = ui->anisotropicSlider->value();
|
||||
config.texture.maxBytes = ui->cacheSizeSpinBox->value() * gc_uMegabyte;
|
||||
|
||||
if (ui->blnrStandardRadioButton->isChecked())
|
||||
config.texture.bilinearMode = BILINEAR_STANDARD;
|
||||
|
|
|
@ -35,7 +35,6 @@ void _loadSettings(QSettings & settings)
|
|||
settings.beginGroup("texture");
|
||||
config.texture.maxAnisotropy = settings.value("maxAnisotropy", config.texture.maxAnisotropy).toInt();
|
||||
config.texture.bilinearMode = settings.value("bilinearMode", config.texture.bilinearMode).toInt();
|
||||
config.texture.maxBytes = settings.value("maxBytes", config.texture.maxBytes).toInt();
|
||||
config.texture.screenShotFormat = settings.value("screenShotFormat", config.texture.screenShotFormat).toInt();
|
||||
settings.endGroup();
|
||||
|
||||
|
@ -158,7 +157,6 @@ void writeSettings(const QString & _strIniFolder)
|
|||
settings.beginGroup("texture");
|
||||
settings.setValue("maxAnisotropy", config.texture.maxAnisotropy);
|
||||
settings.setValue("bilinearMode", config.texture.bilinearMode);
|
||||
settings.setValue("maxBytes", config.texture.maxBytes);
|
||||
settings.setValue("screenShotFormat", config.texture.screenShotFormat);
|
||||
settings.endGroup();
|
||||
|
||||
|
|
|
@ -837,32 +837,6 @@
|
|||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="cacheSizeLabel">
|
||||
<property name="text">
|
||||
<string comment="video/cacheSizeLabel" extracomment=""Video RAM usage limit" in MB. "MB" is referenced in the control.">VRAM usage limit:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="cacheSizeSpinBox">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="suffix">
|
||||
<string extracomment="Megabytes"> MB</string>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>999</number>
|
||||
</property>
|
||||
<property name="singleStep">
|
||||
<number>50</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -3918,11 +3892,10 @@
|
|||
</connection>
|
||||
</connections>
|
||||
<buttongroups>
|
||||
<buttongroup name="osdButtonGroup"/>
|
||||
<buttongroup name="factorButtonGroup"/>
|
||||
<buttongroup name="bloomBlendModeButtonGroup"/>
|
||||
<buttongroup name="screenshotButtonGroup"/>
|
||||
<buttongroup name="aspectButtonGroup"/>
|
||||
<buttongroup name="osdButtonGroup"/>
|
||||
<buttongroup name="fixTexrectCoordsButtonGroup"/>
|
||||
<buttongroup name="screenshotButtonGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
|
@ -104,12 +104,12 @@ void fillFullscreenResolutionsList(QStringList & _listResolutions, int & _resolu
|
|||
|
||||
fullscreen.resolution[fullscreen.numResolutions].width = deviceMode.dmPelsWidth;
|
||||
fullscreen.resolution[fullscreen.numResolutions].height = deviceMode.dmPelsHeight;
|
||||
sprintf(text, "%i x %i", deviceMode.dmPelsWidth, deviceMode.dmPelsHeight);
|
||||
snprintf(text, 128, "%i x %i", deviceMode.dmPelsWidth, deviceMode.dmPelsHeight);
|
||||
|
||||
for (int j = 0; j < numRatios; ++j)
|
||||
if (fabs((float)deviceMode.dmPelsWidth / (float)deviceMode.dmPelsHeight
|
||||
- (float)ratios[j].x / (float)ratios[j].y) < 0.005f) {
|
||||
sprintf(text, "%s (%s)", text, ratios[j].description);
|
||||
snprintf(text, 128, "%s (%s)", text, ratios[j].description);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -475,7 +475,6 @@ void TextureCache::_initDummyTexture(CachedTexture * _pDummy)
|
|||
|
||||
void TextureCache::init()
|
||||
{
|
||||
m_maxBytes = config.texture.maxBytes;
|
||||
m_curUnpackAlignment = 0;
|
||||
|
||||
u32 dummyTexture[16] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
@ -542,27 +541,13 @@ void TextureCache::destroy()
|
|||
|
||||
void TextureCache::_checkCacheSize()
|
||||
{
|
||||
const size_t maxCacheSize = 8000;
|
||||
if (m_textures.size() >= maxCacheSize) {
|
||||
if (m_textures.size() >= m_maxCacheSize) {
|
||||
CachedTexture& clsTex = m_textures.back();
|
||||
m_cachedBytes -= clsTex.textureBytes;
|
||||
gfxContext.deleteTexture(clsTex.name);
|
||||
m_lruTextureLocations.erase(clsTex.crc);
|
||||
m_textures.pop_back();
|
||||
}
|
||||
|
||||
if (m_cachedBytes <= m_maxBytes)
|
||||
return;
|
||||
|
||||
Textures::iterator iter = m_textures.end();
|
||||
do {
|
||||
--iter;
|
||||
CachedTexture& tex = *iter;
|
||||
m_cachedBytes -= tex.textureBytes;
|
||||
gfxContext.deleteTexture(tex.name);
|
||||
m_lruTextureLocations.erase(tex.crc);
|
||||
} while (m_cachedBytes > m_maxBytes && iter != m_textures.cbegin());
|
||||
m_textures.erase(iter, m_textures.end());
|
||||
}
|
||||
|
||||
CachedTexture * TextureCache::_addTexture(u32 _crc32)
|
||||
|
|
|
@ -64,7 +64,7 @@ struct TextureCache
|
|||
static TextureCache & get();
|
||||
|
||||
private:
|
||||
TextureCache() : m_pDummy(nullptr), m_hits(0), m_misses(0), m_maxBytes(0), m_cachedBytes(0), m_curUnpackAlignment(4), m_toggleDumpTex(false)
|
||||
TextureCache() : m_pDummy(nullptr), m_hits(0), m_misses(0), m_cachedBytes(0), m_curUnpackAlignment(4), m_toggleDumpTex(false)
|
||||
{
|
||||
current[0] = nullptr;
|
||||
current[1] = nullptr;
|
||||
|
@ -97,6 +97,7 @@ private:
|
|||
u32 m_cachedBytes;
|
||||
s32 m_curUnpackAlignment;
|
||||
bool m_toggleDumpTex;
|
||||
const size_t m_maxCacheSize = 8000;
|
||||
};
|
||||
|
||||
void getTextureShiftScale(u32 tile, const TextureCache & cache, f32 & shiftScaleS, f32 & shiftScaleT);
|
||||
|
|
|
@ -15,9 +15,6 @@
|
|||
|
||||
Config config;
|
||||
|
||||
static
|
||||
const u32 uMegabyte = 1024U*1024U;
|
||||
|
||||
m64p_handle g_configVideoGeneral = nullptr;
|
||||
m64p_handle g_configVideoGliden64 = nullptr;
|
||||
|
||||
|
@ -69,8 +66,6 @@ bool Config_SetDefault()
|
|||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "MaxAnisotropy", config.texture.maxAnisotropy, "Max level of Anisotropic Filtering, 0 for off");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultInt(g_configVideoGliden64, "CacheSize", config.texture.maxBytes / uMegabyte, "Size of texture cache in megabytes. Good value is VRAM*3/4");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
//#Emulation Settings
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableNoise", config.generalEmulation.enableNoise, "Enable color noise emulation.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
|
@ -128,7 +123,7 @@ bool Config_SetDefault()
|
|||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txFilterIgnoreBG", config.textureFilter.txFilterIgnoreBG, "Don't filter background textures.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultInt(g_configVideoGliden64, "txCacheSize", config.textureFilter.txCacheSize/uMegabyte, "Size of filtered textures cache in megabytes.");
|
||||
res = ConfigSetDefaultInt(g_configVideoGliden64, "txCacheSize", config.textureFilter.txCacheSize/ gc_uMegabyte, "Size of filtered textures cache in megabytes.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txHiresEnable", config.textureFilter.txHiresEnable, "Use high-resolution texture packs if available.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
|
@ -226,8 +221,6 @@ void Config_LoadCustomConfig()
|
|||
if (result == M64ERR_SUCCESS) config.texture.maxAnisotropy = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "texture\\bilinearMode", value, sizeof(value));
|
||||
if (result == M64ERR_SUCCESS) config.texture.bilinearMode = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "texture\\maxBytes", value, sizeof(value));
|
||||
if (result == M64ERR_SUCCESS) config.texture.maxBytes = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "texture\\screenShotFormat", value, sizeof(value));
|
||||
if (result == M64ERR_SUCCESS) config.texture.screenShotFormat = atoi(value);
|
||||
|
||||
|
@ -322,7 +315,6 @@ void Config_LoadConfig()
|
|||
//#Texture Settings
|
||||
config.texture.bilinearMode = ConfigGetParamBool(g_configVideoGliden64, "bilinearMode");
|
||||
config.texture.maxAnisotropy = ConfigGetParamInt(g_configVideoGliden64, "MaxAnisotropy");
|
||||
config.texture.maxBytes = ConfigGetParamInt(g_configVideoGliden64, "CacheSize") * uMegabyte;
|
||||
//#Emulation Settings
|
||||
config.generalEmulation.enableNoise = ConfigGetParamBool(g_configVideoGliden64, "EnableNoise");
|
||||
config.generalEmulation.enableLOD = ConfigGetParamBool(g_configVideoGliden64, "EnableLOD");
|
||||
|
@ -354,7 +346,7 @@ void Config_LoadConfig()
|
|||
config.textureFilter.txEnhancementMode = ConfigGetParamInt(g_configVideoGliden64, "txEnhancementMode");
|
||||
config.textureFilter.txDeposterize = ConfigGetParamInt(g_configVideoGliden64, "txDeposterize");
|
||||
config.textureFilter.txFilterIgnoreBG = ConfigGetParamBool(g_configVideoGliden64, "txFilterIgnoreBG");
|
||||
config.textureFilter.txCacheSize = ConfigGetParamInt(g_configVideoGliden64, "txCacheSize") * uMegabyte;
|
||||
config.textureFilter.txCacheSize = ConfigGetParamInt(g_configVideoGliden64, "txCacheSize") * gc_uMegabyte;
|
||||
config.textureFilter.txHiresEnable = ConfigGetParamBool(g_configVideoGliden64, "txHiresEnable");
|
||||
config.textureFilter.txHiresFullAlphaChannel = ConfigGetParamBool(g_configVideoGliden64, "txHiresFullAlphaChannel");
|
||||
config.textureFilter.txHresAltCRC = ConfigGetParamBool(g_configVideoGliden64, "txHresAltCRC");
|
||||
|
|
Loading…
Reference in New Issue
Block a user