Make the signature of all the SetFramebufferSamplingParams the same

This commit is contained in:
Henrik Rydgård committed 2020-09-14 00:04:39 +02:00
1 parent 46b3fb0821
commit d8263d50f4
5 files changed
+19 -16

No files matched your search

+1
View File
@@ -421,6 +421,7 @@ void TextureCacheD3D11::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer,
gstate_c.SetTextureFullAlpha(gstate.getTextureFormat() == GE_TFMT_5650);
framebufferManagerD3D11_->RebindFramebuffer("RebindFramebuffer - ApplyTextureFramebuffer"); // Probably not necessary.
}
SamplerCacheKey samplerKey{};
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, samplerKey);
ID3D11SamplerState *state = samplerCache_.GetOrCreateSampler(device_, samplerKey);
+5 -5
View File
@@ -119,8 +119,7 @@ D3DFORMAT getClutDestFormat(GEPaletteFormat format) {
return D3DFMT_A8R8G8B8;
}
void TextureCacheDX9::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight) {
SamplerCacheKey key;
void TextureCacheDX9::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight, SamplerCacheKey &key) {
UpdateSamplingParams(0, 0, key);
key.mipEnable = false;
@@ -135,8 +134,6 @@ void TextureCacheDX9::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHe
key.sClamp = true;
key.tClamp = true;
}
ApplySamplingParams(key);
}
void TextureCacheDX9::ApplySamplingParams(const SamplerCacheKey &key) {
@@ -412,7 +409,10 @@ void TextureCacheDX9::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer, G
}
framebufferManagerDX9_->RebindFramebuffer("RebindFramebuffer - ApplyTextureFromFramebuffer");
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight);
SamplerCacheKey key;
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, key);
ApplySamplingParams(key);
}
void TextureCacheDX9::BuildTexture(TexCacheEntry *const entry) {
+1 -1
View File
@@ -52,7 +52,7 @@ public:
void ForgetLastTexture() override;
void InvalidateLastTexture(TexCacheEntry *entry = nullptr) override;
void SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight);
void SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight, SamplerCacheKey &key);
bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) override;
+11 -9
View File
@@ -130,14 +130,9 @@ void TextureCacheGLES::ApplySamplingParams(const SamplerCacheKey &key) {
MagFiltGL[magKey], key.minFilt ? GL_LINEAR : GL_NEAREST, aniso);
}
void TextureCacheGLES::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight, bool forcePoint) {
SamplerCacheKey key;
void TextureCacheGLES::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight, SamplerCacheKey &key) {
UpdateSamplingParams(0, 0, key);
key.mipEnable = false; // framebuffers can't mipmap.
if (forcePoint) {
key.magFilt = false;
key.minFilt = false;
}
// Often the framebuffer will not match the texture size. We'll wrap/clamp in the shader in that case.
// This happens whether we have OES_texture_npot or not.
int w = gstate.getTextureWidth(0);
@@ -147,7 +142,6 @@ void TextureCacheGLES::SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferH
key.tClamp = true;
}
key.aniso = 0.0f;
ApplySamplingParams(key);
}
static void ConvertColors(void *dstBuf, const void *srcBuf, Draw::DataFormat dstFmt, int numPixels) {
@@ -380,7 +374,12 @@ void TextureCacheGLES::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer,
render_->BindTexture(TEX_SLOT_CLUT, clutTexture);
render_->SetTextureSampler(TEX_SLOT_CLUT, GL_REPEAT, GL_CLAMP_TO_EDGE, GL_NEAREST, GL_NEAREST, 0.0f);
framebufferManagerGL_->BindFramebufferAsColorTexture(0, framebuffer, BINDFBCOLOR_MAY_COPY_WITH_UV | BINDFBCOLOR_APPLY_TEX_OFFSET);
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, true);
SamplerCacheKey key;
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, key);
key.magFilt = false;
key.minFilt = false;
key.mipEnable = false;
ApplySamplingParams(key);
InvalidateLastTexture();
// Since we started/ended render passes, might need these.
@@ -430,7 +429,10 @@ void TextureCacheGLES::ApplyTextureFramebuffer(VirtualFramebuffer *framebuffer,
}
framebufferManagerGL_->RebindFramebuffer("ApplyTextureFramebuffer");
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, false);
SamplerCacheKey key;
SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, key);
ApplySamplingParams(key);
// Since we started/ended render passes, might need these.
gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_RASTER_STATE | DIRTY_VIEWPORTSCISSOR_STATE);
+1 -1
View File
@@ -63,7 +63,7 @@ public:
}
}
void SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight, bool forcePoint);
void SetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight, SamplerCacheKey &key);
bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) override;
void DeviceLost();