@@ -1080,6 +1080,8 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
1080
1080
state.depthBoundsTestEnable = VK_FALSE;
1081
1081
state.cullMode = VK_CULL_MODE_NONE;
1082
1082
1083
+ state.sampleMask = {~0U };
1084
+
1083
1085
// disable all discard rectangles
1084
1086
RemoveNextStruct (&pipeCreateInfo,
1085
1087
VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT);
@@ -1178,6 +1180,12 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
1178
1180
}
1179
1181
}
1180
1182
1183
+ state.logicOpEnable = false ;
1184
+ for (uint32_t i = 0 ; i < state.colorBlendEnable .size (); i++)
1185
+ state.colorBlendEnable [i] = false ;
1186
+ for (uint32_t i = 0 ; i < state.colorWriteMask .size (); i++)
1187
+ state.colorWriteMask [i] = 0xf ;
1188
+
1181
1189
// set scissors to max for drawcall
1182
1190
if (overlay == DebugOverlay::Drawcall && pipeCreateInfo.pViewportState )
1183
1191
{
@@ -1488,10 +1496,18 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
1488
1496
state.depthBoundsTestEnable = VK_FALSE;
1489
1497
state.cullMode = VK_CULL_MODE_NONE;
1490
1498
1499
+ state.sampleMask = {~0U };
1500
+
1491
1501
// enable dynamic depth clamp
1492
1502
if (m_pDriver->GetDeviceEnabledFeatures ().depthClamp )
1493
1503
state.depthClampEnable = true ;
1494
1504
1505
+ state.logicOpEnable = false ;
1506
+ for (uint32_t i = 0 ; i < state.colorBlendEnable .size (); i++)
1507
+ state.colorBlendEnable [i] = false ;
1508
+ for (uint32_t i = 0 ; i < state.colorWriteMask .size (); i++)
1509
+ state.colorWriteMask [i] = 0xf ;
1510
+
1495
1511
// modify state
1496
1512
state.SetRenderPass (GetResID (m_Overlay.NoDepthRP ));
1497
1513
state.subpass = 0 ;
@@ -1817,10 +1833,18 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
1817
1833
state.depthBoundsTestEnable = VK_FALSE;
1818
1834
state.cullMode = VK_CULL_MODE_NONE;
1819
1835
1836
+ state.sampleMask = {~0U };
1837
+
1820
1838
// enable dynamic depth clamp
1821
1839
if (m_pDriver->GetDeviceEnabledFeatures ().depthClamp )
1822
1840
state.depthClampEnable = true ;
1823
1841
1842
+ state.logicOpEnable = false ;
1843
+ for (uint32_t i = 0 ; i < state.colorBlendEnable .size (); i++)
1844
+ state.colorBlendEnable [i] = false ;
1845
+ for (uint32_t i = 0 ; i < state.colorWriteMask .size (); i++)
1846
+ state.colorWriteMask [i] = 0xf ;
1847
+
1824
1848
// modify state
1825
1849
state.SetRenderPass (GetResID (m_Overlay.NoDepthRP ));
1826
1850
state.subpass = 0 ;
@@ -1953,7 +1977,9 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
1953
1977
if (useDepthWriteStencilPass)
1954
1978
{
1955
1979
useDepthWriteStencilPass = false ;
1956
- const VulkanCreationInfo::ShaderEntry &ps = pipeInfo.shaders [4 ];
1980
+ const VulkanCreationInfo::ShaderEntry &ps =
1981
+ state.graphics .shaderObject ? createinfo.m_ShaderObject [state.shaderObjects [4 ]].shad
1982
+ : pipeInfo.shaders [4 ];
1957
1983
if (ps.module != ResourceId ())
1958
1984
{
1959
1985
ShaderReflection *reflection = ps.refl ;
@@ -2473,10 +2499,32 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
2473
2499
state.depthBoundsTestEnable = VK_FALSE;
2474
2500
state.cullMode = VK_CULL_MODE_NONE;
2475
2501
2502
+ state.sampleMask = {~0U };
2503
+
2476
2504
// enable dynamic depth clamp
2477
2505
if (m_pDriver->GetDeviceEnabledFeatures ().depthClamp )
2478
2506
state.depthClampEnable = true ;
2479
2507
2508
+ state.logicOpEnable = false ;
2509
+ for (uint32_t i = 0 ; i < state.colorBlendEnable .size (); i++)
2510
+ state.colorBlendEnable [i] = false ;
2511
+ for (uint32_t i = 0 ; i < state.colorWriteMask .size (); i++)
2512
+ state.colorWriteMask [i] = 0xf ;
2513
+
2514
+ if (depthRP != VK_NULL_HANDLE)
2515
+ {
2516
+ if (overlay == DebugOverlay::Depth)
2517
+ {
2518
+ state.depthTestEnable = origDepthTest;
2519
+ }
2520
+ else
2521
+ {
2522
+ state.front .passOp = state.front .failOp = state.front .depthFailOp = VK_STENCIL_OP_KEEP;
2523
+ state.back .passOp = state.back .failOp = state.back .depthFailOp = VK_STENCIL_OP_KEEP;
2524
+ state.stencilTestEnable = origStencilTest;
2525
+ }
2526
+ }
2527
+
2480
2528
if (state.graphics .shaderObject )
2481
2529
{
2482
2530
state.graphics .pipeline = ResourceId ();
@@ -2487,6 +2535,10 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
2487
2535
2488
2536
if (useDepthWriteStencilPass)
2489
2537
{
2538
+ // disable colour write
2539
+ for (uint32_t i = 0 ; i < state.colorWriteMask .size (); i++)
2540
+ state.colorWriteMask [i] = 0x0 ;
2541
+
2490
2542
// override stencil dynamic state
2491
2543
state.front .compare = 0xff ;
2492
2544
state.front .write = 0xff ;
0 commit comments