Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 53 additions & 1 deletion renderdoc/driver/vulkan/vk_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,6 +1080,8 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
state.depthBoundsTestEnable = VK_FALSE;
state.cullMode = VK_CULL_MODE_NONE;

state.sampleMask = {~0U};

// disable all discard rectangles
RemoveNextStruct(&pipeCreateInfo,
VK_STRUCTURE_TYPE_PIPELINE_DISCARD_RECTANGLE_STATE_CREATE_INFO_EXT);
Expand Down Expand Up @@ -1178,6 +1180,12 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
}
}

state.logicOpEnable = false;
for(uint32_t i = 0; i < state.colorBlendEnable.size(); i++)
state.colorBlendEnable[i] = false;
for(uint32_t i = 0; i < state.colorWriteMask.size(); i++)
state.colorWriteMask[i] = 0xf;

// set scissors to max for drawcall
if(overlay == DebugOverlay::Drawcall && pipeCreateInfo.pViewportState)
{
Expand Down Expand Up @@ -1488,10 +1496,18 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
state.depthBoundsTestEnable = VK_FALSE;
state.cullMode = VK_CULL_MODE_NONE;

state.sampleMask = {~0U};

// enable dynamic depth clamp
if(m_pDriver->GetDeviceEnabledFeatures().depthClamp)
state.depthClampEnable = true;

state.logicOpEnable = false;
for(uint32_t i = 0; i < state.colorBlendEnable.size(); i++)
state.colorBlendEnable[i] = false;
for(uint32_t i = 0; i < state.colorWriteMask.size(); i++)
state.colorWriteMask[i] = 0xf;

// modify state
state.SetRenderPass(GetResID(m_Overlay.NoDepthRP));
state.subpass = 0;
Expand Down Expand Up @@ -1817,10 +1833,18 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
state.depthBoundsTestEnable = VK_FALSE;
state.cullMode = VK_CULL_MODE_NONE;

state.sampleMask = {~0U};

// enable dynamic depth clamp
if(m_pDriver->GetDeviceEnabledFeatures().depthClamp)
state.depthClampEnable = true;

state.logicOpEnable = false;
for(uint32_t i = 0; i < state.colorBlendEnable.size(); i++)
state.colorBlendEnable[i] = false;
for(uint32_t i = 0; i < state.colorWriteMask.size(); i++)
state.colorWriteMask[i] = 0xf;

// modify state
state.SetRenderPass(GetResID(m_Overlay.NoDepthRP));
state.subpass = 0;
Expand Down Expand Up @@ -1953,7 +1977,9 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
if(useDepthWriteStencilPass)
{
useDepthWriteStencilPass = false;
const VulkanCreationInfo::ShaderEntry &ps = pipeInfo.shaders[4];
const VulkanCreationInfo::ShaderEntry &ps =
state.graphics.shaderObject ? createinfo.m_ShaderObject[state.shaderObjects[4]].shad
: pipeInfo.shaders[4];
if(ps.module != ResourceId())
{
ShaderReflection *reflection = ps.refl;
Expand Down Expand Up @@ -2473,10 +2499,32 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D
state.depthBoundsTestEnable = VK_FALSE;
state.cullMode = VK_CULL_MODE_NONE;

state.sampleMask = {~0U};

// enable dynamic depth clamp
if(m_pDriver->GetDeviceEnabledFeatures().depthClamp)
state.depthClampEnable = true;

state.logicOpEnable = false;
for(uint32_t i = 0; i < state.colorBlendEnable.size(); i++)
state.colorBlendEnable[i] = false;
for(uint32_t i = 0; i < state.colorWriteMask.size(); i++)
state.colorWriteMask[i] = 0xf;

if(depthRP != VK_NULL_HANDLE)
{
if(overlay == DebugOverlay::Depth)
{
state.depthTestEnable = origDepthTest;
}
else
{
state.front.passOp = state.front.failOp = state.front.depthFailOp = VK_STENCIL_OP_KEEP;
state.back.passOp = state.back.failOp = state.back.depthFailOp = VK_STENCIL_OP_KEEP;
state.stencilTestEnable = origStencilTest;
}
}

if(state.graphics.shaderObject)
{
state.graphics.pipeline = ResourceId();
Expand All @@ -2487,6 +2535,10 @@ ResourceId VulkanReplay::RenderOverlay(ResourceId texid, FloatVector clearCol, D

if(useDepthWriteStencilPass)
{
// disable colour write
for(uint32_t i = 0; i < state.colorWriteMask.size(); i++)
state.colorWriteMask[i] = 0x0;

// override stencil dynamic state
state.front.compare = 0xff;
state.front.write = 0xff;
Expand Down