mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +00:00
Make the hybrid texture filter optional through configuration
This commit is contained in:
parent
0692abea4a
commit
0a5216f8e1
|
@ -43,6 +43,7 @@ void Config::resetToDefaults()
|
||||||
generalEmulation.enableCustomSettings = 1;
|
generalEmulation.enableCustomSettings = 1;
|
||||||
generalEmulation.enableShadersStorage = 1;
|
generalEmulation.enableShadersStorage = 1;
|
||||||
generalEmulation.enableLegacyBlending = 0;
|
generalEmulation.enableLegacyBlending = 0;
|
||||||
|
generalEmulation.enableHybridFilter = 1;
|
||||||
generalEmulation.hacks = 0;
|
generalEmulation.hacks = 0;
|
||||||
#if defined(OS_ANDROID) || defined(OS_IOS)
|
#if defined(OS_ANDROID) || defined(OS_IOS)
|
||||||
generalEmulation.enableFragmentDepthWrite = 0;
|
generalEmulation.enableFragmentDepthWrite = 0;
|
||||||
|
|
|
@ -53,6 +53,7 @@ struct Config
|
||||||
u32 enableCustomSettings;
|
u32 enableCustomSettings;
|
||||||
u32 enableShadersStorage;
|
u32 enableShadersStorage;
|
||||||
u32 enableLegacyBlending;
|
u32 enableLegacyBlending;
|
||||||
|
u32 enableHybridFilter;
|
||||||
u32 enableFragmentDepthWrite;
|
u32 enableFragmentDepthWrite;
|
||||||
u32 enableBlitScreenWorkaround;
|
u32 enableBlitScreenWorkaround;
|
||||||
u32 hacks;
|
u32 hacks;
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include <Graphics/ObjectHandle.h>
|
#include <Graphics/ObjectHandle.h>
|
||||||
#include <Graphics/ShaderProgram.h>
|
#include <Graphics/ShaderProgram.h>
|
||||||
#include <Graphics/OpenGLContext/opengl_CachedFunctions.h>
|
#include <Graphics/OpenGLContext/opengl_CachedFunctions.h>
|
||||||
|
#include <Config.h>
|
||||||
#include "glsl_SpecialShadersFactory.h"
|
#include "glsl_SpecialShadersFactory.h"
|
||||||
#include "glsl_ShaderPart.h"
|
#include "glsl_ShaderPart.h"
|
||||||
#include "glsl_FXAA.h"
|
#include "glsl_FXAA.h"
|
||||||
|
@ -448,17 +449,7 @@ namespace glsl {
|
||||||
public:
|
public:
|
||||||
TexrectCopy(const opengl::GLInfo & _glinfo)
|
TexrectCopy(const opengl::GLInfo & _glinfo)
|
||||||
{
|
{
|
||||||
if (_glinfo.isGLES2) {
|
if (config.generalEmulation.enableHybridFilter) {
|
||||||
m_part =
|
|
||||||
"IN mediump vec2 vTexCoord0; \n"
|
|
||||||
"uniform sampler2D uTex0; \n"
|
|
||||||
"OUT lowp vec4 fragColor; \n"
|
|
||||||
" \n"
|
|
||||||
"void main() \n"
|
|
||||||
"{ \n"
|
|
||||||
" fragColor = texture2D(uTex0, vTexCoord0); \n"
|
|
||||||
;
|
|
||||||
} else {
|
|
||||||
m_part = getHybridTextureFilter();
|
m_part = getHybridTextureFilter();
|
||||||
m_part +=
|
m_part +=
|
||||||
"IN mediump vec2 vTexCoord0; \n"
|
"IN mediump vec2 vTexCoord0; \n"
|
||||||
|
@ -468,6 +459,16 @@ namespace glsl {
|
||||||
"{ \n"
|
"{ \n"
|
||||||
" fragColor = hybridFilter(vTexCoord0); \n"
|
" fragColor = hybridFilter(vTexCoord0); \n"
|
||||||
;
|
;
|
||||||
|
} else {
|
||||||
|
m_part =
|
||||||
|
"IN mediump vec2 vTexCoord0; \n"
|
||||||
|
"uniform sampler2D uTex0; \n"
|
||||||
|
"OUT lowp vec4 fragColor; \n"
|
||||||
|
" \n"
|
||||||
|
"void main() \n"
|
||||||
|
"{ \n"
|
||||||
|
" fragColor = texture2D(uTex0, vTexCoord0); \n"
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -479,19 +480,7 @@ namespace glsl {
|
||||||
public:
|
public:
|
||||||
TexrectColorAndDepthCopy(const opengl::GLInfo & _glinfo)
|
TexrectColorAndDepthCopy(const opengl::GLInfo & _glinfo)
|
||||||
{
|
{
|
||||||
if (_glinfo.isGLES2) {
|
if (config.generalEmulation.enableHybridFilter) {
|
||||||
m_part =
|
|
||||||
"IN mediump vec2 vTexCoord0; \n"
|
|
||||||
"uniform sampler2D uTex0; \n"
|
|
||||||
"uniform sampler2D uTex1; \n"
|
|
||||||
"OUT lowp vec4 fragColor; \n"
|
|
||||||
" \n"
|
|
||||||
"void main() \n"
|
|
||||||
"{ \n"
|
|
||||||
" fragColor = texture2D(uTex0, vTexCoord0); \n"
|
|
||||||
" gl_FragDepth = texture2D(uTex1, vTexCoord0).r; \n"
|
|
||||||
;
|
|
||||||
} else {
|
|
||||||
m_part = getHybridTextureFilter();
|
m_part = getHybridTextureFilter();
|
||||||
m_part +=
|
m_part +=
|
||||||
"IN mediump vec2 vTexCoord0; \n"
|
"IN mediump vec2 vTexCoord0; \n"
|
||||||
|
@ -503,6 +492,18 @@ namespace glsl {
|
||||||
" fragColor = hybridFilter(vTexCoord0); \n"
|
" fragColor = hybridFilter(vTexCoord0); \n"
|
||||||
" gl_FragDepth = texture2D(uTex1, vTexCoord0).r; \n"
|
" gl_FragDepth = texture2D(uTex1, vTexCoord0).r; \n"
|
||||||
;
|
;
|
||||||
|
} else {
|
||||||
|
m_part =
|
||||||
|
"IN mediump vec2 vTexCoord0; \n"
|
||||||
|
"uniform sampler2D uTex0; \n"
|
||||||
|
"uniform sampler2D uTex1; \n"
|
||||||
|
"OUT lowp vec4 fragColor; \n"
|
||||||
|
" \n"
|
||||||
|
"void main() \n"
|
||||||
|
"{ \n"
|
||||||
|
" fragColor = texture2D(uTex0, vTexCoord0); \n"
|
||||||
|
" gl_FragDepth = texture2D(uTex1, vTexCoord0).r; \n"
|
||||||
|
;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -95,8 +95,10 @@ void GLInfo::init() {
|
||||||
|
|
||||||
const bool imageTexturesInterlock = imageTextures && (fragment_interlock || fragment_interlockNV || fragment_ordering);
|
const bool imageTexturesInterlock = imageTextures && (fragment_interlock || fragment_interlockNV || fragment_ordering);
|
||||||
|
|
||||||
if (isGLES2)
|
if (isGLES2) {
|
||||||
config.generalEmulation.enableFragmentDepthWrite = 0;
|
config.generalEmulation.enableFragmentDepthWrite = 0;
|
||||||
|
config.generalEmulation.enableHybridFilter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
bufferStorage = (!isGLESX && (numericVersion >= 44)) || Utils::isExtensionSupported(*this, "GL_ARB_buffer_storage") ||
|
bufferStorage = (!isGLESX && (numericVersion >= 44)) || Utils::isExtensionSupported(*this, "GL_ARB_buffer_storage") ||
|
||||||
Utils::isExtensionSupported(*this, "GL_EXT_buffer_storage");
|
Utils::isExtensionSupported(*this, "GL_EXT_buffer_storage");
|
||||||
|
|
|
@ -77,6 +77,8 @@ bool Config_SetDefault()
|
||||||
assert(res == M64ERR_SUCCESS);
|
assert(res == M64ERR_SUCCESS);
|
||||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableLegacyBlending", config.generalEmulation.enableLegacyBlending, "Do not use shaders to emulate N64 blending modes. Works faster on slow GPU. Can cause glitches.");
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableLegacyBlending", config.generalEmulation.enableLegacyBlending, "Do not use shaders to emulate N64 blending modes. Works faster on slow GPU. Can cause glitches.");
|
||||||
assert(res == M64ERR_SUCCESS);
|
assert(res == M64ERR_SUCCESS);
|
||||||
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableHybridFilter", config.generalEmulation.enableHybridFilter, "Enable hybrid integer scaling filter, this can be slow with low-end GPUs");
|
||||||
|
assert(res == M64ERR_SUCCESS);
|
||||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFragmentDepthWrite", config.generalEmulation.enableFragmentDepthWrite, "Enable writing of fragment depth. Some mobile GPUs do not support it, thus it made optional. Leave enabled.");
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableFragmentDepthWrite", config.generalEmulation.enableFragmentDepthWrite, "Enable writing of fragment depth. Some mobile GPUs do not support it, thus it made optional. Leave enabled.");
|
||||||
assert(res == M64ERR_SUCCESS);
|
assert(res == M64ERR_SUCCESS);
|
||||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableCustomSettings", config.generalEmulation.enableCustomSettings, "Use GLideN64 per-game settings.");
|
res = ConfigSetDefaultBool(g_configVideoGliden64, "EnableCustomSettings", config.generalEmulation.enableCustomSettings, "Use GLideN64 per-game settings.");
|
||||||
|
@ -397,6 +399,7 @@ void Config_LoadConfig()
|
||||||
config.generalEmulation.enableHWLighting = ConfigGetParamBool(g_configVideoGliden64, "EnableHWLighting");
|
config.generalEmulation.enableHWLighting = ConfigGetParamBool(g_configVideoGliden64, "EnableHWLighting");
|
||||||
config.generalEmulation.enableShadersStorage = ConfigGetParamBool(g_configVideoGliden64, "EnableShadersStorage");
|
config.generalEmulation.enableShadersStorage = ConfigGetParamBool(g_configVideoGliden64, "EnableShadersStorage");
|
||||||
config.generalEmulation.enableLegacyBlending = ConfigGetParamBool(g_configVideoGliden64, "EnableLegacyBlending");
|
config.generalEmulation.enableLegacyBlending = ConfigGetParamBool(g_configVideoGliden64, "EnableLegacyBlending");
|
||||||
|
config.generalEmulation.enableHybridFilter = ConfigGetParamBool(g_configVideoGliden64, "EnableHybridFilter");
|
||||||
config.generalEmulation.enableFragmentDepthWrite = ConfigGetParamBool(g_configVideoGliden64, "EnableFragmentDepthWrite");
|
config.generalEmulation.enableFragmentDepthWrite = ConfigGetParamBool(g_configVideoGliden64, "EnableFragmentDepthWrite");
|
||||||
config.generalEmulation.enableCustomSettings = ConfigGetParamBool(g_configVideoGliden64, "EnableCustomSettings");
|
config.generalEmulation.enableCustomSettings = ConfigGetParamBool(g_configVideoGliden64, "EnableCustomSettings");
|
||||||
#if defined(OS_ANDROID) || defined(OS_IOS)
|
#if defined(OS_ANDROID) || defined(OS_IOS)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user