Permalink
Browse files

D3D11: Show FBO-as-texture in GE debugger.

  • Loading branch information...
unknownbrackets committed Nov 6, 2017
1 parent 1f33907 commit cd6249d0803f25f7e9db869355f9360a828a2745
Showing with 17 additions and 1 deletion.
  1. +14 −0 GPU/D3D11/TextureCacheD3D11.cpp
  2. +3 −1 GPU/GPU.vcxproj.filters
@@ -819,6 +819,20 @@ bool TextureCacheD3D11::GetCurrentTextureDebug(GPUDebugBuffer &buffer, int level
if (!nextTexture_)
return false;
// TODO: Centralize.
if (nextTexture_->framebuffer) {
VirtualFramebuffer *vfb = nextTexture_->framebuffer;
bool flipY = g_Config.iGPUBackend == GPU_BACKEND_OPENGL && g_Config.iRenderingMode != FB_NON_BUFFERED_MODE;
buffer.Allocate(vfb->bufferWidth, vfb->bufferHeight, GPU_DBG_FORMAT_8888, flipY);
bool retval = draw_->CopyFramebufferToMemorySync(vfb->fbo, Draw::FB_COLOR_BIT, 0, 0, vfb->bufferWidth, vfb->bufferHeight, Draw::DataFormat::R8G8B8A8_UNORM, buffer.GetData(), vfb->bufferWidth);
// 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);
// We may have blitted to a temp FBO.
framebufferManager_->RebindFramebuffer();
return retval;
}
ID3D11Texture2D *texture = (ID3D11Texture2D *)nextTexture_->texturePtr;
if (!texture)
return false;
View
@@ -255,7 +255,6 @@
<ClInclude Include="D3D11\D3D11Util.h">
<Filter>D3D11</Filter>
</ClInclude>
<ClInclude Include="D3D11\StateMappingD3D11.h" />
<ClInclude Include="Common\ShaderTranslation.h">
<Filter>Common</Filter>
</ClInclude>
@@ -268,6 +267,9 @@
<ClInclude Include="Common\StencilCommon.h">
<Filter>Common</Filter>
</ClInclude>
<ClInclude Include="D3D11\StateMappingD3D11.h">
<Filter>D3D11</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Math3D.cpp">

0 comments on commit cd6249d

Please sign in to comment.