mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-18 20:04:31 +01:00
D3D: disbale gpu scaling filters (and forced nearest sampling) when the
source is a render to texture framebuffer.
This commit is contained in:
1 parent
34691700e4
commit
229b77dec5
3 files changed
+7
-2
No files matched your search
@@ -194,7 +194,8 @@ void TextureCacheCommon::GetSamplingParams(int &minFilt, int &magFilt, bool &sCl
|
||||
forceNearest = true;
|
||||
}
|
||||
}
|
||||
if (g_Config.bRealtimeTexScaling && g_Config.iTexScalingLevel != 1) {
|
||||
// addr is set to nullptr for framebuffers
|
||||
if (addr && g_Config.bRealtimeTexScaling && g_Config.iTexScalingLevel != 1) {
|
||||
forceNearest = true;
|
||||
}
|
||||
if (forceNearest) {
|
||||
@@ -1533,8 +1534,10 @@ void TextureCacheCommon::ApplyTexture() {
|
||||
|
||||
entry->lastFrame = gpuStats.numFlips;
|
||||
if (entry->framebuffer) {
|
||||
gstate_c.curTextureIsRT = true;
|
||||
ApplyTextureFramebuffer(entry, entry->framebuffer);
|
||||
} else {
|
||||
gstate_c.curTextureIsRT = false;
|
||||
BindTexture(entry);
|
||||
gstate_c.SetTextureFullAlpha(entry->GetAlphaStatus() == TexCacheEntry::STATUS_ALPHA_FULL);
|
||||
}
|
||||
|
||||
@@ -388,6 +388,7 @@ bool GenerateFragmentShaderHLSL(const FShaderID &id, char *buffer, ShaderLanguag
|
||||
GEComparison alphaTestFunc = (GEComparison)id.Bits(FS_BIT_ALPHA_TEST_FUNC, 3);
|
||||
GEComparison colorTestFunc = (GEComparison)id.Bits(FS_BIT_COLOR_TEST_FUNC, 2);
|
||||
bool needShaderTexClamp = id.Bit(FS_BIT_SHADER_TEX_CLAMP);
|
||||
bool needScaleFilter = g_Config.bRealtimeTexScaling && g_Config.iTexScalingLevel != 1 && !gstate_c.curTextureIsRT;
|
||||
|
||||
ReplaceBlendType replaceBlend = static_cast<ReplaceBlendType>(id.Bits(FS_BIT_REPLACE_BLEND, 3));
|
||||
ReplaceAlphaType stencilToAlpha = static_cast<ReplaceAlphaType>(id.Bits(FS_BIT_STENCIL_TO_ALPHA, 2));
|
||||
@@ -491,7 +492,7 @@ bool GenerateFragmentShaderHLSL(const FShaderID &id, char *buffer, ShaderLanguag
|
||||
}
|
||||
WRITE(p, "};\n");
|
||||
|
||||
if (g_Config.bRealtimeTexScaling && g_Config.iTexScalingLevel != 1) {
|
||||
if (needScaleFilter) {
|
||||
switch (g_Config.iTexScalingType) {
|
||||
case TextureScalerCommon::XBRZ:
|
||||
WRITE(p, sampler_xbrz);
|
||||
|
||||
@@ -560,6 +560,7 @@ struct GPUStateCache {
|
||||
// Only applied when needShaderTexClamp = true.
|
||||
u32 curTextureXOffset;
|
||||
u32 curTextureYOffset;
|
||||
bool curTextureIsRT;
|
||||
|
||||
float vpWidth;
|
||||
float vpHeight;
|
||||
|
||||
Reference in new issue
Block a user