From 737688a22aff80b911ba8ee754b0ca1ed1bb5f2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 2 Jun 2020 09:51:38 +0200 Subject: [PATCH] Annotate calls to RebindFramebuffer with their cause. --- GPU/Common/FramebufferCommon.cpp | 28 +++++++++++------------ GPU/Common/FramebufferCommon.h | 2 +- GPU/D3D11/FramebufferManagerD3D11.cpp | 4 ++-- GPU/D3D11/StencilBufferD3D11.cpp | 2 +- GPU/D3D11/TextureCacheD3D11.cpp | 6 ++--- GPU/Directx9/FramebufferDX9.cpp | 2 +- GPU/Directx9/StencilBufferDX9.cpp | 2 +- GPU/Directx9/TextureCacheDX9.cpp | 2 +- GPU/GLES/GPU_GLES.cpp | 2 +- GPU/GLES/StateMappingGLES.cpp | 2 +- GPU/GLES/StencilBufferGLES.cpp | 2 +- GPU/GLES/TextureCacheGLES.cpp | 8 +++---- GPU/Vulkan/FramebufferVulkan.cpp | 2 +- GPU/Vulkan/StencilBufferVulkan.cpp | 2 +- GPU/Vulkan/TextureCacheVulkan.cpp | 7 +++--- ext/native/thin3d/VulkanRenderManager.cpp | 1 - 16 files changed, 36 insertions(+), 38 deletions(-) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 548d82faef..b6578a4737 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -635,7 +635,7 @@ void FramebufferManagerCommon::UpdateFromMemory(u32 addr, int size, bool safe) { } } - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - UpdateFromMemory"); } // TODO: Necessary? gstate_c.Dirty(DIRTY_FRAGMENTSHADER_STATE); @@ -1167,7 +1167,7 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size, // Just do the blit! BlitFramebuffer(dstBuffer, 0, dstY, srcBuffer, 0, srcY, srcBuffer->width, srcH, 0); SetColorUpdated(dstBuffer, skipDrawReason); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - Inter-buffer memcpy"); } return false; } else if (dstBuffer) { @@ -1179,7 +1179,7 @@ bool FramebufferManagerCommon::NotifyFramebufferCopy(u32 src, u32 dst, int size, const u8 *srcBase = Memory::GetPointerUnchecked(src); DrawPixels(dstBuffer, 0, dstY, srcBase, dstBuffer->format, dstBuffer->fb_stride, dstBuffer->width, dstH); SetColorUpdated(dstBuffer, skipDrawReason); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - Memcpy fbo upload"); // This is a memcpy, let's still copy just in case. return false; } else if (srcBuffer) { @@ -1556,7 +1556,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst WARN_LOG_ONCE(dstsrc, G3D, "Intra-buffer block transfer %08x -> %08x", srcBasePtr, dstBasePtr); FlushBeforeCopy(); BlitFramebuffer(dstBuffer, dstX, dstY, srcBuffer, srcX, srcY, dstWidth, dstHeight, bpp); - RebindFramebuffer(); + RebindFramebuffer("rebind after intra block transfer"); SetColorUpdated(dstBuffer, skipDrawReason); return true; } else { @@ -1568,7 +1568,7 @@ bool FramebufferManagerCommon::NotifyBlockTransferBefore(u32 dstBasePtr, int dst // Just do the blit! FlushBeforeCopy(); BlitFramebuffer(dstBuffer, dstX, dstY, srcBuffer, srcX, srcY, dstWidth, dstHeight, bpp); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - Inter-buffer block transfer"); SetColorUpdated(dstBuffer, skipDrawReason); return true; // No need to actually do the memory copy behind, probably. } @@ -1645,7 +1645,7 @@ void FramebufferManagerCommon::NotifyBlockTransferAfter(u32 dstBasePtr, int dstS } DrawPixels(dstBuffer, static_cast(dstX * dstXFactor), dstY, srcBase, dstBuffer->format, static_cast(srcStride * dstXFactor), static_cast(dstWidth * dstXFactor), dstHeight); SetColorUpdated(dstBuffer, skipDrawReason); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - NotifyBlockTransferAfter"); } } } @@ -1845,7 +1845,7 @@ bool FramebufferManagerCommon::GetFramebuffer(u32 fb_address, int fb_stride, GEB // After a readback we'll have flushed and started over, need to dirty a bunch of things to be safe. gstate_c.Dirty(DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); // We may have blitted to a temp FBO. - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - GetFramebuffer"); return retval; } @@ -1880,7 +1880,7 @@ bool FramebufferManagerCommon::GetDepthbuffer(u32 fb_address, int fb_stride, u32 // After a readback we'll have flushed and started over, need to dirty a bunch of things to be safe. gstate_c.Dirty(DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); // That may have unbound the framebuffer, rebind to avoid crashes when debugging. - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - GetDepthbuffer"); return retval; } @@ -1910,7 +1910,7 @@ bool FramebufferManagerCommon::GetStencilbuffer(u32 fb_address, int fb_stride, G buffer.Allocate(w, h, GPU_DBG_FORMAT_8BIT, flipY); bool retval = draw_->CopyFramebufferToMemorySync(vfb->fbo, Draw::FB_STENCIL_BIT, 0, 0, w,h, Draw::DataFormat::S8, buffer.GetData(), w, "GetStencilbuffer"); // That may have unbound the framebuffer, rebind to avoid crashes when debugging. - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - GetStencilbuffer"); return retval; } @@ -1924,7 +1924,7 @@ bool FramebufferManagerCommon::GetOutputFramebuffer(GPUDebugBuffer &buffer) { buffer.Allocate(w, h, fmt == Draw::DataFormat::R8G8B8A8_UNORM ? GPU_DBG_FORMAT_8888 : GPU_DBG_FORMAT_8888_BGRA, false); bool retval = draw_->CopyFramebufferToMemorySync(nullptr, Draw::FB_COLOR_BIT, 0, 0, w, h, fmt, buffer.GetData(), w, "GetOutputFramebuffer"); // That may have unbound the framebuffer, rebind to avoid crashes when debugging. - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - GetOutputFramebuffer"); return retval; } @@ -1992,7 +1992,7 @@ void FramebufferManagerCommon::ReadFramebufferToMemory(VirtualFramebuffer *vfb, } textureCache_->ForgetLastTexture(); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - ReadFramebufferToMemory"); } } @@ -2038,15 +2038,15 @@ void FramebufferManagerCommon::DownloadFramebufferForClut(u32 fb_address, u32 lo } textureCache_->ForgetLastTexture(); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - DownloadFramebufferForClut"); } } } -void FramebufferManagerCommon::RebindFramebuffer() { +void FramebufferManagerCommon::RebindFramebuffer(const char *tag) { shaderManager_->DirtyLastShader(); if (currentRenderVfb_ && currentRenderVfb_->fbo) { - draw_->BindFramebufferAsRenderTarget(currentRenderVfb_->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "RebindFramebuffer"); + draw_->BindFramebufferAsRenderTarget(currentRenderVfb_->fbo, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, tag); } else { // Should this even happen? It could while debugging, but maybe we can just skip binding at all. draw_->BindFramebufferAsRenderTarget(nullptr, { Draw::RPAction::KEEP, Draw::RPAction::KEEP, Draw::RPAction::KEEP }, "RebindFramebuffer_Bad"); diff --git a/GPU/Common/FramebufferCommon.h b/GPU/Common/FramebufferCommon.h index 93d2418417..7f5eb26bdc 100644 --- a/GPU/Common/FramebufferCommon.h +++ b/GPU/Common/FramebufferCommon.h @@ -215,7 +215,7 @@ public: return vfb; } } - void RebindFramebuffer(); + void RebindFramebuffer(const char *tag); std::vector GetFramebufferList(); void CopyDisplayToOutput(bool reallyDirty); diff --git a/GPU/D3D11/FramebufferManagerD3D11.cpp b/GPU/D3D11/FramebufferManagerD3D11.cpp index 3ea5b73e55..1ec5128cdb 100644 --- a/GPU/D3D11/FramebufferManagerD3D11.cpp +++ b/GPU/D3D11/FramebufferManagerD3D11.cpp @@ -322,7 +322,7 @@ void FramebufferManagerD3D11::BlitFramebufferDepth(VirtualFramebuffer *src, Virt if (matchingDepthBuffer && matchingSize && matchingRenderSize) { // TODO: Currently, this copies depth AND stencil, which is a problem. See #9740. draw_->CopyFramebufferImage(src->fbo, 0, 0, 0, 0, dst->fbo, 0, 0, 0, 0, src->renderWidth, src->renderHeight, 1, Draw::FB_DEPTH_BIT, "BlitFramebufferDepth"); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - BlitFramebufferDepth"); dst->last_frame_depth_updated = gpuStats.numFlips; } } @@ -349,7 +349,7 @@ void FramebufferManagerD3D11::BindFramebufferAsColorTexture(int stage, VirtualFr VirtualFramebuffer copyInfo = *framebuffer; copyInfo.fbo = renderCopy; CopyFramebufferForColorTexture(©Info, framebuffer, flags); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - BindFramebufferAsColorTexture"); draw_->BindFramebufferAsTexture(renderCopy, stage, Draw::FB_COLOR_BIT, 0); } else { draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0); diff --git a/GPU/D3D11/StencilBufferD3D11.cpp b/GPU/D3D11/StencilBufferD3D11.cpp index 28b2a52fd6..7c47806c74 100644 --- a/GPU/D3D11/StencilBufferD3D11.cpp +++ b/GPU/D3D11/StencilBufferD3D11.cpp @@ -243,6 +243,6 @@ bool FramebufferManagerD3D11::NotifyStencilUpload(u32 addr, int size, StencilUpl } tex->Release(); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer stencil"); return true; } diff --git a/GPU/D3D11/TextureCacheD3D11.cpp b/GPU/D3D11/TextureCacheD3D11.cpp index a938376352..def69c626a 100644 --- a/GPU/D3D11/TextureCacheD3D11.cpp +++ b/GPU/D3D11/TextureCacheD3D11.cpp @@ -408,7 +408,7 @@ void TextureCacheD3D11::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFra context_->PSSetSamplers(0, 1, &stockD3D11.samplerPoint2DWrap); shaderApply.Shade(); - framebufferManagerD3D11_->RebindFramebuffer(); + framebufferManagerD3D11_->RebindFramebuffer("RebindFramebuffer - ApplyTextureFramebuffer"); draw_->BindFramebufferAsTexture(depalFBO, 0, Draw::FB_COLOR_BIT, 0); const u32 bytesPerColor = clutFormat == GE_CMODE_32BIT_ABGR8888 ? sizeof(u32) : sizeof(u16); @@ -422,7 +422,7 @@ void TextureCacheD3D11::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFra framebufferManagerD3D11_->BindFramebufferAsColorTexture(0, framebuffer, BINDFBCOLOR_MAY_COPY_WITH_UV | BINDFBCOLOR_APPLY_TEX_OFFSET); gstate_c.SetTextureFullAlpha(gstate.getTextureFormat() == GE_TFMT_5650); - framebufferManagerD3D11_->RebindFramebuffer(); // Probably not necessary. + framebufferManagerD3D11_->RebindFramebuffer("RebindFramebuffer - ApplyTextureFramebuffer"); // Probably not necessary. } SamplerCacheKey samplerKey{}; SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, samplerKey); @@ -784,7 +784,7 @@ bool TextureCacheD3D11::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level // So let's dirty the things that are involved in Vulkan dynamic state. Readbacks are not frequent so this won't hurt other backends. gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE); // We may have blitted to a temp FBO. - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); return retval; } diff --git a/GPU/Directx9/FramebufferDX9.cpp b/GPU/Directx9/FramebufferDX9.cpp index 0d90960ebd..c3cb5ff1dd 100644 --- a/GPU/Directx9/FramebufferDX9.cpp +++ b/GPU/Directx9/FramebufferDX9.cpp @@ -369,7 +369,7 @@ static const D3DVERTEXELEMENT9 g_FramebufferVertexElements[] = { copyInfo.fbo = renderCopy; CopyFramebufferForColorTexture(©Info, framebuffer, flags); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - BindFramebufferAsColorTexture"); draw_->BindFramebufferAsTexture(renderCopy, stage, Draw::FB_COLOR_BIT, 0); } else { draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0); diff --git a/GPU/Directx9/StencilBufferDX9.cpp b/GPU/Directx9/StencilBufferDX9.cpp index 972bcfd88f..707f63b9d6 100644 --- a/GPU/Directx9/StencilBufferDX9.cpp +++ b/GPU/Directx9/StencilBufferDX9.cpp @@ -256,7 +256,7 @@ bool FramebufferManagerDX9::NotifyStencilUpload(u32 addr, int size, StencilUploa tex->Release(); dxstate.stencilMask.set(0xFF); dxstate.viewport.restore(); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer stencil"); return true; } diff --git a/GPU/Directx9/TextureCacheDX9.cpp b/GPU/Directx9/TextureCacheDX9.cpp index 4afe6baa26..e10aff8cc2 100644 --- a/GPU/Directx9/TextureCacheDX9.cpp +++ b/GPU/Directx9/TextureCacheDX9.cpp @@ -466,7 +466,7 @@ void TextureCacheDX9::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFrame gstate_c.SetTextureFullAlpha(gstate.getTextureFormat() == GE_TFMT_5650); } - framebufferManagerDX9_->RebindFramebuffer(); + framebufferManagerDX9_->RebindFramebuffer("RebindFramebuffer - ApplyTextureFromFramebuffer"); SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight); InvalidateLastTexture(); diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index ceefecbcb3..a38334dace 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -398,7 +398,7 @@ void GPU_GLES::SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat fo void GPU_GLES::CopyDisplayToOutput(bool reallyDirty) { // Flush anything left over. - framebufferManagerGL_->RebindFramebuffer(); + framebufferManagerGL_->RebindFramebuffer("RebindFramebuffer - CopyDisplayToOutput"); drawEngine_.Flush(); shaderManagerGL_->DirtyLastShader(); diff --git a/GPU/GLES/StateMappingGLES.cpp b/GPU/GLES/StateMappingGLES.cpp index 4e2f7f36f1..ce958e0403 100644 --- a/GPU/GLES/StateMappingGLES.cpp +++ b/GPU/GLES/StateMappingGLES.cpp @@ -184,7 +184,7 @@ void DrawEngineGLES::ApplyDrawState(int prim) { fboTexBound_ = true; fboTexNeedBind_ = false; - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - ApplyDrawState"); // Must dirty blend state here so we re-copy next time. Example: Lunar's spell effects. gstate_c.Dirty(DIRTY_BLEND_STATE); } diff --git a/GPU/GLES/StencilBufferGLES.cpp b/GPU/GLES/StencilBufferGLES.cpp index f18b2f90d6..ab843c5059 100644 --- a/GPU/GLES/StencilBufferGLES.cpp +++ b/GPU/GLES/StencilBufferGLES.cpp @@ -217,6 +217,6 @@ 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("RebindFramebuffer - Stencil"); return true; } diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 781aee4f56..48c4a3eda8 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -505,7 +505,7 @@ void TextureCacheGLES::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFram gstate_c.SetTextureFullAlpha(gstate.getTextureFormat() == GE_TFMT_5650); } - framebufferManagerGL_->RebindFramebuffer(); + framebufferManagerGL_->RebindFramebuffer("ApplyTextureFramebuffer"); SetFramebufferSamplingParams(framebuffer->bufferWidth, framebuffer->bufferHeight, false); InvalidateLastTexture(); @@ -833,7 +833,7 @@ bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) // Apply texture may need to rebuild the texture if we're about to render, or bind a framebuffer. TexCacheEntry *entry = nextTexture_; // We might need a render pass to set the sampling params, unfortunately. Otherwise BuildTexture may crash. - framebufferManagerGL_->RebindFramebuffer(); + framebufferManagerGL_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); ApplyTexture(); // TODO: Centralize? @@ -845,7 +845,7 @@ bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) // So let's dirty the things that are involved in Vulkan dynamic state. Readbacks are not frequent so this won't hurt other backends. gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE); // We may have blitted to a temp FBO. - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); return retval; } @@ -863,7 +863,7 @@ bool TextureCacheGLES::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level) buffer.Allocate(w, h, GE_FORMAT_8888, false); renderManager->CopyImageToMemorySync(entry->textureName, level, 0, 0, w, h, Draw::DataFormat::R8G8B8A8_UNORM, (uint8_t *)buffer.GetData(), w, "GetCurrentTextureDebug"); gstate_c.Dirty(DIRTY_TEXTURE_IMAGE | DIRTY_TEXTURE_PARAMS); - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); return true; #else diff --git a/GPU/Vulkan/FramebufferVulkan.cpp b/GPU/Vulkan/FramebufferVulkan.cpp index 8eead37278..fe328bbd1a 100644 --- a/GPU/Vulkan/FramebufferVulkan.cpp +++ b/GPU/Vulkan/FramebufferVulkan.cpp @@ -314,7 +314,7 @@ VkImageView FramebufferManagerVulkan::BindFramebufferAsColorTexture(int stage, V VirtualFramebuffer copyInfo = *framebuffer; copyInfo.fbo = renderCopy; CopyFramebufferForColorTexture(©Info, framebuffer, flags); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - BindFramebufferAsColorTexture"); draw_->BindFramebufferAsTexture(renderCopy, stage, Draw::FB_COLOR_BIT, 0); } else { draw_->BindFramebufferAsTexture(framebuffer->fbo, stage, Draw::FB_COLOR_BIT, 0); diff --git a/GPU/Vulkan/StencilBufferVulkan.cpp b/GPU/Vulkan/StencilBufferVulkan.cpp index 6587069149..1384d957c1 100644 --- a/GPU/Vulkan/StencilBufferVulkan.cpp +++ b/GPU/Vulkan/StencilBufferVulkan.cpp @@ -222,6 +222,6 @@ bool FramebufferManagerVulkan::NotifyStencilUpload(u32 addr, int size, StencilUp } tex->Release(); - RebindFramebuffer(); + RebindFramebuffer("RebindFramebuffer - NotifyStencilUpload"); return true; } diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index 427672234c..f729c75224 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -917,7 +917,7 @@ void TextureCacheVulkan::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFr TexCacheEntry::TexStatus alphaStatus = CheckAlpha(clutBuf_, getClutDestFormatVulkan(clutFormat), clutTotalColors, clutTotalColors, 1); gstate_c.SetTextureFullAlpha(alphaStatus == TexCacheEntry::STATUS_ALPHA_FULL); - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - ApplyTextureFramebuffer"); draw_->BindFramebufferAsTexture(depalFBO, 0, Draw::FB_COLOR_BIT, 0); imageView_ = (VkImageView)draw_->GetNativeObject(Draw::NativeObject::BOUND_TEXTURE0_IMAGEVIEW); @@ -928,7 +928,6 @@ void TextureCacheVulkan::ApplyTextureFramebuffer(TexCacheEntry *entry, VirtualFr } else { entry->status &= ~TexCacheEntry::STATUS_DEPALETTIZE; - framebufferManager_->RebindFramebuffer(); // TODO: This line should usually not be needed. imageView_ = framebufferManagerVulkan_->BindFramebufferAsColorTexture(0, framebuffer, BINDFBCOLOR_MAY_COPY_WITH_UV | BINDFBCOLOR_APPLY_TEX_OFFSET); drawEngine_->SetDepalTexture(VK_NULL_HANDLE); gstate_c.SetUseShaderDepal(false); @@ -1393,7 +1392,7 @@ bool TextureCacheVulkan::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int leve // So let's dirty the things that are involved in Vulkan dynamic state. Readbacks are not frequent so this won't hurt other backends. gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE); // We may have blitted to a temp FBO. - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); return retval; } @@ -1433,7 +1432,7 @@ bool TextureCacheVulkan::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int leve // Vulkan requires us to re-apply all dynamic state for each command buffer, and the above will cause us to start a new cmdbuf. // So let's dirty the things that are involved in Vulkan dynamic state. Readbacks are not frequent so this won't hurt other backends. gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE | DIRTY_BLEND_STATE | DIRTY_DEPTHSTENCIL_STATE); - framebufferManager_->RebindFramebuffer(); + framebufferManager_->RebindFramebuffer("RebindFramebuffer - GetCurrentTextureDebug"); return true; } diff --git a/ext/native/thin3d/VulkanRenderManager.cpp b/ext/native/thin3d/VulkanRenderManager.cpp index 474ed3a2f0..9e047d00be 100644 --- a/ext/native/thin3d/VulkanRenderManager.cpp +++ b/ext/native/thin3d/VulkanRenderManager.cpp @@ -1200,7 +1200,6 @@ void VulkanRenderManager::EndSyncFrame(int frame) { } void VulkanRenderManager::FlushSync() { - // TODO: Reset curRenderStep_? renderStepOffset_ += (int)steps_.size(); int curFrame = vulkan_->GetCurFrame();