Clean up GetFramebufferSamplingParams

This commit is contained in:
Henrik Rydgård committed 2026-07-16 15:03:20 +02:00
1 parent c278fdf5a3
commit ea95eb420d
4 files changed
+35 -14

No files matched your search

+29 -8
View File
@@ -338,18 +338,39 @@ SamplerCacheKey TextureCacheCommon::GetSamplingParams(int maxLevel, const TexCac
}
SamplerCacheKey TextureCacheCommon::GetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight) {
// TODO: This call is pretty pointless, we overwrite most of it.
SamplerCacheKey key = GetSamplingParams(0, nullptr, true);
SamplerCacheKey key{};
// In case auto max quality was on, restore min filt. Another fix for water in Outrun.
if (g_Config.iTexFiltering == TEX_FILTER_AUTO_MAX_QUALITY) {
int minFilt = gstate.texfilter & 0x7;
key.minFilt = minFilt & 1;
key.magFilt = gstate.isMagnifyFilteringEnabled();
int minFilt = gstate.texfilter & 0x7;
key.minFilt = minFilt & 1;
key.mipEnable = false;
key.mipFilt = false;
key.mipFilt = false;
key.sClamp = gstate.isTexCoordClampedS();
key.tClamp = gstate.isTexCoordClampedT();
key.aniso = false;
key.texture3d = false;
// Filtering overrides from replacements or settings.
switch ((TextureFiltering)g_Config.iTexFiltering) {
case TEX_FILTER_AUTO:
case TEX_FILTER_AUTO_MAX_QUALITY:
if (gstate_c.pixelMapped) {
key.magFilt = false;
key.minFilt = false;
}
break;
case TEX_FILTER_FORCE_LINEAR:
key.magFilt = true;
key.minFilt = true;
break;
case TEX_FILTER_FORCE_NEAREST:
key.magFilt = false;
key.minFilt = false;
break;
}
// Kill any mipmapping settings.
key.mipEnable = false;
key.mipFilt = false;
key.aniso = 0.0f;
key.maxLevel = 0.0f;
key.lodBias = 0.0f;
+2 -2
View File
@@ -433,9 +433,9 @@ void DrawEngineD3D11::Flush() {
params.clipInfoFlags = clipInfoFlags_;
const SoftwareTransformAction action = RunSoftwareTransform(params, prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result);
if (result.setSafeSize)
if (result.setSafeSize) {
framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight);
}
// TODO: This should be after BuildDrawingParams!
if (textureNeedsApply) {
+2 -2
View File
@@ -387,9 +387,9 @@ void DrawEngineGLES::Flush() {
params.clipInfoFlags = clipInfoFlags_;
const SoftwareTransformAction action = RunSoftwareTransform(params, prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result);
if (result.setSafeSize)
if (result.setSafeSize) {
framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight);
}
if (textureNeedsApply) {
gstate_c.pixelMapped = result.pixelMapped;
+2 -2
View File
@@ -427,9 +427,9 @@ void DrawEngineVulkan::Flush() {
params.clipInfoFlags = clipInfoFlags_;
const SoftwareTransformAction action = RunSoftwareTransform(params, prim, swDec->VertexType(), swDec->GetDecVtxFmt(), numDecodedVerts_, VERTEX_BUFFER_MAX, vertexCount, inds, RemainingIndices(inds), &result);
if (result.setSafeSize)
if (result.setSafeSize) {
framebufferManager_->SetSafeSize(result.safeWidth, result.safeHeight);
}
// Only here, where we know whether to clear or to draw primitives, should we actually set the current framebuffer! Because that gives use the opportunity
// to use a "pre-clear" render pass, for high efficiency on tilers.