mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
When rendering overlays, clear to transparent black
* This might cause some fringing artifacts when at low scales due to non-PMA colors but it means there are no false-positive green pixels.
This commit is contained in:
@@ -394,7 +394,7 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
|
||||
}
|
||||
}
|
||||
|
||||
float clearColour[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float clearColour[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
m_pImmediateContext->ClearRenderTargetView(rtv, clearColour);
|
||||
|
||||
float overlayConsts[] = {1.0f, 0.0f, 0.0f, 1.0f};
|
||||
@@ -1294,7 +1294,7 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
|
||||
|
||||
m_pImmediateContext->OMSetBlendState(NULL, NULL, 0xffffffff);
|
||||
|
||||
float clearColour[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float clearColour[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
m_pImmediateContext->ClearRenderTargetView(rtv, clearColour);
|
||||
|
||||
float redConsts[] = {255.0f / 255.0f, 0.0f / 255.0f, 0.0f / 255.0f, 255.0f / 255.0f};
|
||||
@@ -1411,7 +1411,7 @@ ResourceId D3D11Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
|
||||
}
|
||||
}
|
||||
|
||||
float clearColour[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float clearColour[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
m_pImmediateContext->ClearRenderTargetView(rtv, clearColour);
|
||||
|
||||
float redConsts[] = {1.0f, 0.0f, 0.0f, 1.0f};
|
||||
|
||||
@@ -668,7 +668,7 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
|
||||
psoDesc.RasterizerState.MultisampleEnable = FALSE;
|
||||
psoDesc.RasterizerState.AntialiasedLineEnable = FALSE;
|
||||
|
||||
float clearColour[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float clearColour[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
list->ClearRenderTargetView(rtv, clearColour, 0, NULL);
|
||||
|
||||
list->Close();
|
||||
@@ -1506,7 +1506,7 @@ ResourceId D3D12Replay::RenderOverlay(ResourceId texid, FloatVector clearCol, De
|
||||
psoDesc.RasterizerState.MultisampleEnable = FALSE;
|
||||
psoDesc.RasterizerState.AntialiasedLineEnable = FALSE;
|
||||
|
||||
float clearColour[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float clearColour[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
list->ClearRenderTargetView(rtv, clearColour, 0, NULL);
|
||||
|
||||
list->Close();
|
||||
|
||||
@@ -942,7 +942,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug
|
||||
else
|
||||
drv.glDisable(eGL_SCISSOR_TEST);
|
||||
|
||||
float backCol[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float backCol[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
drv.glClearBufferfv(eGL_COLOR, 0, backCol);
|
||||
|
||||
if(HasExt[ARB_viewport_array])
|
||||
@@ -1233,7 +1233,7 @@ ResourceId GLReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, Debug
|
||||
else
|
||||
drv.glDisable(eGL_SCISSOR_TEST);
|
||||
|
||||
float col[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float col[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
drv.glClearBufferfv(eGL_COLOR, 0, col);
|
||||
|
||||
if(HasExt[ARB_viewport_array])
|
||||
|
||||
@@ -1358,7 +1358,7 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
|
||||
}
|
||||
else if(overlay == DebugOverlay::BackfaceCull)
|
||||
{
|
||||
float highlightCol[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float highlightCol[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
VkImageMemoryBarrier barrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
|
||||
NULL,
|
||||
@@ -1532,7 +1532,7 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
|
||||
}
|
||||
else if(overlay == DebugOverlay::Depth || overlay == DebugOverlay::Stencil)
|
||||
{
|
||||
float highlightCol[] = {0.0f, 1.0f, 0.0f, 0.0f};
|
||||
float highlightCol[] = {0.0f, 0.0f, 0.0f, 0.0f};
|
||||
|
||||
VkImageMemoryBarrier barrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER,
|
||||
NULL,
|
||||
|
||||
@@ -153,10 +153,10 @@ class Overlay_Test(rdtest.TestCase):
|
||||
self.check_pixel_value(overlay_id, 150, 160, [1.0, 0.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 125, 60, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 250, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 60, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 250, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
@@ -182,10 +182,10 @@ class Overlay_Test(rdtest.TestCase):
|
||||
self.check_pixel_value(overlay_id, 150, 160, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 125, 60, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 250, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 60, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 250, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
@@ -210,10 +210,10 @@ class Overlay_Test(rdtest.TestCase):
|
||||
self.check_pixel_value(overlay_id, 150, 160, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 150, 200, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 125, 60, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 250, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 60, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 250, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 60, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 125, 250, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 60, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 250, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 220, 175, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 250, 150, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
@@ -472,8 +472,8 @@ class Overlay_Test(rdtest.TestCase):
|
||||
self.check_pixel_value(overlay_id, 50, 25, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 50, 75, [0.0, 1.0, 0.0, 1.0], eps=eps)
|
||||
|
||||
self.check_pixel_value(overlay_id, 50, 20, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 50, 80, [0.0, 1.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 50, 20, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
self.check_pixel_value(overlay_id, 50, 80, [0.0, 0.0, 0.0, 0.0], eps=eps)
|
||||
elif overlay == rd.DebugOverlay.ViewportScissor:
|
||||
# Inside viewport and scissor, passing triangle
|
||||
self.check_pixel_value(overlay_id, 50, 50,
|
||||
@@ -674,14 +674,14 @@ class Overlay_Test(rdtest.TestCase):
|
||||
sub=sub, eps=eps)
|
||||
elif overlay == rd.DebugOverlay.Depth or overlay == rd.DebugOverlay.Stencil:
|
||||
self.check_pixel_value(overlay_id, 50 >> shift, 36 >> shift, [0.0, 1.0, 0.0, 1.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 30 >> shift, 36 >> shift, [0.0, 1.0, 0.0, 0.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 30 >> shift, 36 >> shift, [0.0, 0.0, 0.0, 0.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 70 >> shift, 34 >> shift, [1.0, 0.0, 0.0, 1.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 70 >> shift, 20 >> shift, [0.0, 1.0, 0.0, 0.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 70 >> shift, 20 >> shift, [0.0, 0.0, 0.0, 0.0], sub=sub)
|
||||
elif overlay == rd.DebugOverlay.BackfaceCull:
|
||||
self.check_pixel_value(overlay_id, 50 >> shift, 36 >> shift, [0.0, 1.0, 0.0, 1.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 30 >> shift, 36 >> shift, [0.0, 1.0, 0.0, 0.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 30 >> shift, 36 >> shift, [0.0, 0.0, 0.0, 0.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 70 >> shift, 34 >> shift, [1.0, 0.0, 0.0, 1.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 70 >> shift, 20 >> shift, [0.0, 1.0, 0.0, 0.0], sub=sub)
|
||||
self.check_pixel_value(overlay_id, 70 >> shift, 20 >> shift, [0.0, 0.0, 0.0, 0.0], sub=sub)
|
||||
elif overlay == rd.DebugOverlay.ViewportScissor:
|
||||
self.check_pixel_value(overlay_id, 20 >> shift, 15 >> shift,
|
||||
[0.2 * 0.4, 0.2 * 0.4, 0.9 * 0.4, 0.4 * 0.4], sub=sub, eps=eps)
|
||||
|
||||
Reference in New Issue
Block a user