diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index 39b2652c8a..7ff1c477f7 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -468,23 +468,18 @@ void FramebufferManagerCommon::DestroyFramebuf(VirtualFramebuffer *v) { } void FramebufferManagerCommon::BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst) { - bool matchingDepthBuffer = src->z_address == dst->z_address && src->z_stride != 0 && dst->z_stride != 0; - bool matchingSize = src->width == dst->width && src->height == dst->height; + int w = std::min(src->renderWidth, dst->renderWidth); + int h = std::min(src->renderHeight, dst->renderHeight); - // Note: we don't use CopyFramebufferImage here, because it would copy depth AND stencil. See #9740. - if (matchingDepthBuffer && matchingSize) { - int w = std::min(src->renderWidth, dst->renderWidth); - int h = std::min(src->renderHeight, dst->renderHeight); - // Let's only do this if not clearing depth. - if (gstate_c.Supports(GPU_SUPPORTS_FRAMEBUFFER_BLIT)) { - draw_->BlitFramebuffer(src->fbo, 0, 0, w, h, dst->fbo, 0, 0, w, h, Draw::FB_DEPTH_BIT, Draw::FB_BLIT_NEAREST, "BlitFramebufferDepth"); - RebindFramebuffer("BlitFramebufferDepth"); - } else if (gstate_c.Supports(GPU_SUPPORTS_COPY_IMAGE)) { - draw_->CopyFramebufferImage(src->fbo, 0, 0, 0, 0, dst->fbo, 0, 0, 0, 0, w, h, 1, Draw::FB_DEPTH_BIT, "BlitFramebufferDepth"); - RebindFramebuffer("BlitFramebufferDepth"); - } - dst->last_frame_depth_updated = gpuStats.numFlips; + // Note: We prefer Blit ahead of Copy here, since at least on GL, Copy will always also copy stencil which we don't want. See #9740. + if (gstate_c.Supports(GPU_SUPPORTS_FRAMEBUFFER_BLIT)) { + draw_->BlitFramebuffer(src->fbo, 0, 0, w, h, dst->fbo, 0, 0, w, h, Draw::FB_DEPTH_BIT, Draw::FB_BLIT_NEAREST, "BlitFramebufferDepth"); + RebindFramebuffer("BlitFramebufferDepth"); + } else if (gstate_c.Supports(GPU_SUPPORTS_COPY_IMAGE)) { + draw_->CopyFramebufferImage(src->fbo, 0, 0, 0, 0, dst->fbo, 0, 0, 0, 0, w, h, 1, Draw::FB_DEPTH_BIT, "BlitFramebufferDepth"); + RebindFramebuffer("BlitFramebufferDepth"); } + dst->last_frame_depth_updated = gpuStats.numFlips; } void FramebufferManagerCommon::NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb) { @@ -545,7 +540,11 @@ void FramebufferManagerCommon::NotifyRenderFramebufferSwitched(VirtualFramebuffe // If depth wasn't updated, then we're at least "two degrees" away from the data. // This is an optimization: it probably doesn't need to be copied in this case. } else { - BlitFramebufferDepth(prevVfb, vfb); + bool matchingDepthBuffer = prevVfb->z_address == vfb->z_address && prevVfb->z_stride != 0 && vfb->z_stride != 0; + bool matchingSize = prevVfb->width == vfb->width && prevVfb->height == vfb->height; + if (matchingDepthBuffer && matchingSize) { + BlitFramebufferDepth(prevVfb, vfb); + } } } if (vfb->drawnFormat != vfb->format) { @@ -704,7 +703,7 @@ void FramebufferManagerCommon::DrawPixels(VirtualFramebuffer *vfb, int dstX, int pixelsTex->Release(); draw_->InvalidateCachedState(); - gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE); + gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); } } @@ -1796,7 +1795,6 @@ Draw::Framebuffer *FramebufferManagerCommon::GetTempFBO(TempFBO reason, u16 w, u return it->second.fbo; } - textureCache_->ForgetLastTexture(); bool z_stencil = reason == TempFBO::STENCIL; char name[128]; snprintf(name, sizeof(name), "temp_fbo_%dx%d%s", w, h, z_stencil ? "_depth" : ""); diff --git a/GPU/Common/TextureCacheCommon.cpp b/GPU/Common/TextureCacheCommon.cpp index 13913b21f3..35b15f97db 100644 --- a/GPU/Common/TextureCacheCommon.cpp +++ b/GPU/Common/TextureCacheCommon.cpp @@ -338,13 +338,11 @@ TexCacheEntry *TextureCacheCommon::SetTexture() { GETextureFormat format = gstate.getTextureFormat(); if (format >= 11) { - ERROR_LOG_REPORT(G3D, "Unknown texture format %i", format); - // TODO: Better assumption? + // TODO: Better assumption? Doesn't really matter, these are invalid. format = GE_TFMT_5650; } - bool hasClut = gstate.isTextureFormatIndexed(); - // Ignore uncached/kernel when caching. + bool hasClut = gstate.isTextureFormatIndexed(); u32 cluthash; if (hasClut) { if (clutLastFormat_ != gstate.clutformat) { @@ -446,7 +444,6 @@ TexCacheEntry *TextureCacheCommon::SetTexture() { } if (match) { - // TODO: Mark the entry reliable if it's been safe for long enough? // got one! gstate_c.curTextureWidth = w; gstate_c.curTextureHeight = h; @@ -1589,9 +1586,10 @@ void TextureCacheCommon::ApplyTexture() { TexCacheEntry *entry = nextTexture_; if (!entry) { // Maybe we bound a framebuffer? + InvalidateLastTexture(); if (nextFramebufferTexture_) { bool depth = Memory::IsDepthTexVRAMAddress(gstate.getTextureAddress(0)); - InvalidateLastTexture(); + // ApplyTextureFrameBuffer is responsible for setting SetTextureFullAlpha. ApplyTextureFramebuffer(nextFramebufferTexture_, gstate.getTextureFormat(), depth ? NOTIFY_FB_DEPTH : NOTIFY_FB_COLOR); nextFramebufferTexture_ = nullptr; } @@ -1644,6 +1642,7 @@ void TextureCacheCommon::ApplyTexture() { if (nextNeedsRebuild_) { _assert_(!entry->texturePtr); BuildTexture(entry); + InvalidateLastTexture(); } entry->lastFrame = gpuStats.numFlips; diff --git a/GPU/D3D11/DrawEngineD3D11.cpp b/GPU/D3D11/DrawEngineD3D11.cpp index 0c08c49ae0..fbfd4f820f 100644 --- a/GPU/D3D11/DrawEngineD3D11.cpp +++ b/GPU/D3D11/DrawEngineD3D11.cpp @@ -330,7 +330,7 @@ void DrawEngineD3D11::DoFlush() { int curRenderStepId = draw_->GetCurrentStepId(); if (lastRenderStepId_ != curRenderStepId) { // Dirty everything that has dynamic state that will need re-recording. - gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE); + gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); lastRenderStepId_ = curRenderStepId; } diff --git a/GPU/D3D11/StencilBufferD3D11.cpp b/GPU/D3D11/StencilBufferD3D11.cpp index d4b6dc164e..5c988d7e61 100644 --- a/GPU/D3D11/StencilBufferD3D11.cpp +++ b/GPU/D3D11/StencilBufferD3D11.cpp @@ -199,7 +199,6 @@ bool FramebufferManagerD3D11::NotifyStencilUpload(u32 addr, int size, StencilUpl context_->IASetVertexBuffers(0, 1, &quadBuffer_, &quadStride_, &quadOffset_); context_->PSSetSamplers(0, 1, &stockD3D11.samplerPoint2DClamp); context_->OMSetDepthStencilState(stockD3D11.depthDisabledStencilWrite, 0xFF); - gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE); for (int i = 1; i < values; i += i) { if (!(usedBits & i)) { @@ -244,5 +243,6 @@ bool FramebufferManagerD3D11::NotifyStencilUpload(u32 addr, int size, StencilUpl tex->Release(); RebindFramebuffer("RebindFramebuffer stencil"); + gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); return true; } diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index 3a9dbda64a..ffbf31b6e1 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -144,7 +144,6 @@ void TextureCacheD3D11::ReleaseTexture(TexCacheEntry *entry, bool delete_them) { void TextureCacheD3D11::ForgetLastTexture() { InvalidateLastTexture(); - gstate_c.Dirty(DIRTY_TEXTURE_PARAMS); ID3D11ShaderResourceView *nullTex[2]{}; context_->PSSetShaderResources(0, 2, nullTex); diff --git a/GPU/Directx9/DrawEngineDX9.cpp b/GPU/Directx9/DrawEngineDX9.cpp index 9c59f01f20..a0f4a8c743 100644 --- a/GPU/Directx9/DrawEngineDX9.cpp +++ b/GPU/Directx9/DrawEngineDX9.cpp @@ -315,7 +315,7 @@ void DrawEngineDX9::DoFlush() { int curRenderStepId = draw_->GetCurrentStepId(); if (lastRenderStepId_ != curRenderStepId) { // Dirty everything that has dynamic state that will need re-recording. - gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE); + gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); lastRenderStepId_ = curRenderStepId; } diff --git a/GPU/Directx9/StencilBufferDX9.cpp b/GPU/Directx9/StencilBufferDX9.cpp index 4310a1654e..baa173adeb 100644 --- a/GPU/Directx9/StencilBufferDX9.cpp +++ b/GPU/Directx9/StencilBufferDX9.cpp @@ -185,7 +185,6 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa dxstate.colorMask.set(false, false, false, true); dxstate.stencilTest.enable(); dxstate.stencilOp.set(D3DSTENCILOP_REPLACE, D3DSTENCILOP_REPLACE, D3DSTENCILOP_REPLACE); - gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE); u16 w = dstBuffer->renderWidth; u16 h = dstBuffer->renderHeight; @@ -197,7 +196,6 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa } D3DVIEWPORT9 vp{ 0, 0, w, h, 0.0f, 1.0f }; device_->SetViewport(&vp); - gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE); float u1 = 1.0f; float v1 = 1.0f; @@ -255,6 +253,7 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa dxstate.stencilMask.set(0xFF); dxstate.viewport.restore(); RebindFramebuffer("RebindFramebuffer stencil"); + gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); return true; } diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 56bd153bef..49b87913a6 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -92,11 +92,6 @@ void TextureCacheDX9::ReleaseTexture(TexCacheEntry *entry, bool delete_them) { } } -void TextureCacheDX9::ForgetLastTexture() { - InvalidateLastTexture(); - gstate_c.Dirty(DIRTY_TEXTURE_PARAMS); -} - void TextureCacheDX9::InvalidateLastTexture() { lastBoundTexture = INVALID_TEX; } diff --git a/GPU/Directx9/TextureCacheDX9.h b/GPU/Directx9/TextureCacheDX9.h index 1ebf3bb5fc..aa57dcba4b 100644 --- a/GPU/Directx9/TextureCacheDX9.h +++ b/GPU/Directx9/TextureCacheDX9.h @@ -49,7 +49,9 @@ public: shaderManager_ = sm; } - void ForgetLastTexture() override; + void ForgetLastTexture() override { + InvalidateLastTexture(); + } void InvalidateLastTexture() override; bool GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) override; diff --git a/GPU/GLES/DepthBufferGLES.cpp b/GPU/GLES/DepthBufferGLES.cpp index 13ec48128c..66a83b972f 100644 --- a/GPU/GLES/DepthBufferGLES.cpp +++ b/GPU/GLES/DepthBufferGLES.cpp @@ -129,7 +129,6 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int auto *blitFBO = GetTempFBO(TempFBO::COPY, vfb->renderWidth, vfb->renderHeight, Draw::FBO_8888); draw_->BindFramebufferAsRenderTarget(blitFBO, { Draw::RPAction::CLEAR, Draw::RPAction::DONT_CARE, Draw::RPAction::DONT_CARE }, "PackDepthbuffer"); render_->SetViewport({ 0, 0, (float)vfb->renderWidth, (float)vfb->renderHeight, 0.0f, 1.0f }); - textureCacheGL_->ForgetLastTexture(); // We must bind the program after starting the render pass, and set the color mask after clearing. render_->SetScissor({ 0, 0, vfb->renderWidth, vfb->renderHeight }); @@ -156,6 +155,8 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int DrawActiveTexture(x, y, w, h, vfb->renderWidth, vfb->renderHeight, 0.0f, 0.0f, u1, v1, ROTATION_LOCKED_HORIZONTAL, DRAWTEX_NEAREST); draw_->CopyFramebufferToMemorySync(blitFBO, Draw::FB_COLOR_BIT, 0, y, packWidth, h, Draw::DataFormat::R8G8B8A8_UNORM, convBuf_, vfb->z_stride, "PackDepthbuffer"); + + textureCacheGL_->ForgetLastTexture(); // TODO: Use 4444 so we can copy lines directly? format16Bit = true; } else { @@ -197,5 +198,5 @@ void FramebufferManagerGLES::PackDepthbuffer(VirtualFramebuffer *vfb, int x, int } } - gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE); + gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); } diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index c97bf558de..438bef2638 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -315,7 +315,7 @@ void DrawEngineGLES::DoFlush() { int curRenderStepId = render_->GetCurrentStepId(); if (lastRenderStepId_ != curRenderStepId) { // Dirty everything that has dynamic state that will need re-recording. - gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_BLEND_STATE | DIRTY_RASTER_STATE); + gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); textureCache_->ForgetLastTexture(); lastRenderStepId_ = curRenderStepId; } diff --git a/GPU/GLES/StencilBufferGLES.cpp b/GPU/GLES/StencilBufferGLES.cpp index d9e7fadbf1..dce997ae81 100644 --- a/GPU/GLES/StencilBufferGLES.cpp +++ b/GPU/GLES/StencilBufferGLES.cpp @@ -218,7 +218,7 @@ bool FramebufferManagerGLES::NotifyStencilUpload(u32 addr, int size, StencilUplo } tex->Release(); - gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE); RebindFramebuffer("RebindFramebuffer - Stencil"); + gstate_c.Dirty(DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); return true; } diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index ba953676d4..e3bb89094e 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -47,7 +47,6 @@ TextureCacheGLES::TextureCacheGLES(Draw::DrawContext *draw) : TextureCacheCommon(draw) { timesInvalidatedAllThisFrame_ = 0; - lastBoundTexture = nullptr; render_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER); SetupTextureDecoder(); @@ -537,8 +536,6 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) { texelsScaledThisFrame_ += w * h; } } - - lastBoundTexture = entry->textureName; // GLES2 doesn't have support for a "Max lod" which is critical as PSP games often // don't specify mips all the way down. As a result, we either need to manually generate @@ -595,13 +592,6 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) { } render_->FinalizeTexture(entry->textureName, texMaxLevel, genMips); - - // This will rebind it, but that's okay. - // Need to actually bind it now - it might only have gotten bound in the init phase. - render_->BindTexture(TEX_SLOT_PSP_TEXTURE, entry->textureName); - - SamplerCacheKey samplerKey = GetSamplingParams(entry->maxLevel, entry->addr); - ApplySamplingParams(samplerKey); } Draw::DataFormat TextureCacheGLES::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const { diff --git a/GPU/GLES/TextureCacheGLES.h b/GPU/GLES/TextureCacheGLES.h index e196a358dc..f148fd3f68 100644 --- a/GPU/GLES/TextureCacheGLES.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -55,7 +55,6 @@ public: void ForgetLastTexture() override { lastBoundTexture = nullptr; - gstate_c.Dirty(DIRTY_TEXTURE_PARAMS); } void InvalidateLastTexture() override { lastBoundTexture = nullptr; @@ -86,7 +85,7 @@ private: TextureScalerGLES scaler; - GLRTexture *lastBoundTexture; + GLRTexture *lastBoundTexture = nullptr; FramebufferManagerGLES *framebufferManagerGL_; DepalShaderCacheGLES *depalShaderCache_; diff --git a/GPU/Vulkan/DrawEngineVulkan.cpp b/GPU/Vulkan/DrawEngineVulkan.cpp index f6c07886b3..8123b1275b 100644 --- a/GPU/Vulkan/DrawEngineVulkan.cpp +++ b/GPU/Vulkan/DrawEngineVulkan.cpp @@ -603,7 +603,8 @@ void DrawEngineVulkan::DoFlush() { int curRenderStepId = renderManager->GetCurrentStepId(); if (lastRenderStepId_ != curRenderStepId) { // Dirty everything that has dynamic state that will need re-recording. - gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_BLEND_STATE); + gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_BLEND_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); + textureCache_->ForgetLastTexture(); lastRenderStepId_ = curRenderStepId; } diff --git a/GPU/Vulkan/StencilBufferVulkan.cpp b/GPU/Vulkan/StencilBufferVulkan.cpp index 5862ece18f..613401545f 100644 --- a/GPU/Vulkan/StencilBufferVulkan.cpp +++ b/GPU/Vulkan/StencilBufferVulkan.cpp @@ -183,7 +183,6 @@ bool FramebufferManagerVulkan::NotifyStencilUpload(u32 addr, int size, StencilUp renderManager->BindPipeline(pipeline); renderManager->SetViewport({ 0.0f, 0.0f, (float)w, (float)h, 0.0f, 1.0f }); renderManager->SetScissor({ { 0, 0, },{ (uint32_t)w, (uint32_t)h } }); - gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE); draw_->BindTextures(0, 1, &tex); VkImageView drawPixelsImageView = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_TEXTURE0_IMAGEVIEW); @@ -225,5 +224,6 @@ bool FramebufferManagerVulkan::NotifyStencilUpload(u32 addr, int size, StencilUp tex->Release(); RebindFramebuffer("RebindFramebuffer - NotifyStencilUpload"); + gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_RASTER_STATE | DIRTY_DEPTHSTENCIL_STATE | DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); return true; } diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index c33e6c73c4..90c08512f5 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -872,7 +872,6 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { entry->vkTex = nullptr; } } - lastBoundTexture = entry->vkTex; ReplacedTextureDecodeInfo replacedInfo; if (replacer_.Enabled() && !replaced.Valid()) { @@ -997,8 +996,6 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { } entry->vkTex->EndCreate(cmdInit, false, computeUpload ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL); } - - gstate_c.SetTextureFullAlpha(entry->GetAlphaStatus() == TexCacheEntry::STATUS_ALPHA_FULL); } VkFormat TextureCacheVulkan::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const { diff --git a/GPU/Vulkan/TextureCacheVulkan.h b/GPU/Vulkan/TextureCacheVulkan.h index 8622b5d974..d0d9014508 100644 --- a/GPU/Vulkan/TextureCacheVulkan.h +++ b/GPU/Vulkan/TextureCacheVulkan.h @@ -83,14 +83,8 @@ public: push_ = push; } - void ForgetLastTexture() override { - lastBoundTexture = nullptr; - gstate_c.Dirty(DIRTY_TEXTURE_PARAMS); - } - - void InvalidateLastTexture() override { - lastBoundTexture = nullptr; - } + void ForgetLastTexture() override {} + void InvalidateLastTexture() override {} void NotifyConfigChanged() override; @@ -134,8 +128,6 @@ private: TextureScalerVulkan scaler; - VulkanTexture *lastBoundTexture = nullptr; - int decimationCounter_ = 0; int texelsScaledThisFrame_ = 0; int timesInvalidatedAllThisFrame_ = 0;