mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Clean up GetFramebufferSamplingParams
This commit is contained in:
1 parent
c278fdf5a3
commit
ea95eb420d
4 files changed
+35
-14
No files matched your search
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in new issue
Block a user