mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-15 10:40:01 +01:00
clear shader cache when changing options in the game settings screen,
fixes changes to realtime scaling options not being applied directly.
This commit is contained in:
1 parent
45830d7cdc
commit
bd27752bde
7 files changed
+11
-19
No files matched your search
@@ -82,12 +82,11 @@ enum : uint64_t {
|
||||
// These are for hardware tessellation
|
||||
DIRTY_BEZIERSPLINE = 1ULL << 32,
|
||||
DIRTY_TEXCLAMP = 1ULL << 33,
|
||||
DIRTY_TEXSIZE = 1ULL << 34,
|
||||
|
||||
DIRTY_TEXSIZE = 1ULL << 33,
|
||||
// space for 5 more uniforms.
|
||||
|
||||
// space for 6 more uniforms.
|
||||
|
||||
DIRTY_ALL_UNIFORMS = 0x3FFFFFFFFULL,
|
||||
DIRTY_ALL_UNIFORMS = 0x7FFFFFFFFULL,
|
||||
DIRTY_ALL_LIGHTS = DIRTY_LIGHT0 | DIRTY_LIGHT1 | DIRTY_LIGHT2 | DIRTY_LIGHT3,
|
||||
|
||||
// Other dirty elements that aren't uniforms!
|
||||
|
||||
@@ -496,6 +496,7 @@ void TextureCacheCommon::SetTexture(bool force) {
|
||||
|
||||
gstate_c.curTextureWidth = w;
|
||||
gstate_c.curTextureHeight = h;
|
||||
gstate_c.Dirty(DIRTY_TEXSIZE);
|
||||
|
||||
// Before we go reading the texture from memory, let's check for render-to-texture.
|
||||
// We must do this early so we have the right w/h.
|
||||
|
||||
@@ -262,16 +262,7 @@ static const char* sampler_xbrz =
|
||||
" res2 = lerp(res2, lerp(F, B, px.y), maximos.y);\n"
|
||||
" res2 = lerp(res2, lerp(D, H, px.w), maximos.w);\n"
|
||||
"\n"
|
||||
" float4 res = lerp(res1, res2, step(c_df(E, res1), c_df(E, res2)));\n"
|
||||
" return res;\n"
|
||||
// " float texel_alpha = tex_sample_direct(tc * u_texSize.zw).a;\n"
|
||||
// "\n"
|
||||
// " return float4(E, texel_alpha);\n"
|
||||
// " return tex_sample_direct(coord);\n"
|
||||
// " return tex_sample_direct(coord * u_texSize.xy * u_texSize.zw);\n"
|
||||
// " return float4(res2, texel_alpha);\n"
|
||||
// " return float4(res.r, 0.0f, 0.0f, texel_alpha);\n"
|
||||
// " return float4(res, texel_alpha);\n"
|
||||
" return lerp(res1, res2, step(c_df(E, res1), c_df(E, res2)));\n"
|
||||
"}\n";
|
||||
|
||||
|
||||
@@ -393,7 +384,7 @@ bool GenerateFragmentShaderHLSL(const FShaderID &id, char *buffer, ShaderLanguag
|
||||
}
|
||||
WRITE(p, "};\n");
|
||||
|
||||
if (doTexture) {
|
||||
if (!isModeClear && doTexture) {
|
||||
WRITE(p, "float4 tex_sample_direct(float2 coord) {\n");
|
||||
|
||||
if (lang == HLSL_D3D11 || lang == HLSL_D3D11_LEVEL9) {
|
||||
|
||||
+1
-1
@@ -1407,7 +1407,7 @@ void GPUCommon::Execute_TexSize0(u32 op, u32 diff) {
|
||||
// Don't reset it unless the size is different / the texture has changed.
|
||||
if (diff || gstate_c.IsDirty(DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS)) {
|
||||
gstate_c.curTextureWidth = gstate.getTextureWidth(0);
|
||||
gstate_c.curTextureHeight = gstate.getTextureHeight(0);
|
||||
gstate_c.curTextureHeight = gstate.getTextureHeight(0);
|
||||
gstate_c.Dirty(DIRTY_UVSCALEOFFSET);
|
||||
// We will need to reset the texture now.
|
||||
gstate_c.Dirty(DIRTY_TEXTURE_PARAMS);
|
||||
|
||||
@@ -1038,6 +1038,7 @@ void GameSettingsScreen::onFinish(DialogResult result) {
|
||||
// Wipe some caches after potentially changing settings.
|
||||
NativeMessageReceived("gpu_resized", "");
|
||||
NativeMessageReceived("gpu_clearCache", "");
|
||||
NativeMessageReceived("gpu_clearShaderCache", "");
|
||||
}
|
||||
|
||||
void GameSettingsScreen::CallbackRenderingBackend(bool yes) {
|
||||
|
||||
@@ -770,8 +770,8 @@ namespace MainWindow {
|
||||
case ID_TEXTURESCALING_HYBRID: setTexScalingType(TextureScalerCommon::HYBRID); break;
|
||||
case ID_TEXTURESCALING_BICUBIC: setTexScalingType(TextureScalerCommon::BICUBIC); break;
|
||||
case ID_TEXTURESCALING_HYBRID_BICUBIC: setTexScalingType(TextureScalerCommon::HYBRID_BICUBIC); break;
|
||||
case ID_TEXTURESCALING_GAUSSIAN: setTexScalingType(TextureScalerCommon::GAUSSIAN); break;
|
||||
case ID_TEXTURESCALING_COSINE: setTexScalingType(TextureScalerCommon::COSINE); break;
|
||||
case ID_TEXTURESCALING_GAUSSIAN: setTexScalingType(TextureScalerCommon::GAUSSIAN); break;
|
||||
case ID_TEXTURESCALING_COSINE: setTexScalingType(TextureScalerCommon::COSINE); break;
|
||||
|
||||
case ID_TEXTURESCALING_REALTIME:
|
||||
g_Config.bRealtimeTexScaling = !g_Config.bRealtimeTexScaling;
|
||||
|
||||
+1
-1
@@ -341,7 +341,7 @@
|
||||
#define ID_OPTIONS_WINDOW10X 40176
|
||||
|
||||
#define ID_TEXTURESCALING_REALTIME 40177
|
||||
#define ID_TEXTURESCALING_GAUSSIAN 40178
|
||||
#define ID_TEXTURESCALING_GAUSSIAN 40178
|
||||
#define ID_TEXTURESCALING_COSINE 40179
|
||||
|
||||
// Dummy option to let the buffered rendering hotkey cycle through all the options.
|
||||
|
||||
Reference in new issue
Block a user