AnsweredAssumed Answered

Vulkan fails to clear the depth buffer

Question asked by asylum29 on Sep 15, 2016
Latest reply on Sep 27, 2016 by asylum29

(Radeon R7 360, latest driver)


In a nutshell: I have a tile-based deferred renderer with the following workflow:


- gbuffer render pass (2 color and 1 depth attachment)
- light cull/accumulation compute shader
- forward render pass (using the same depth buffer as the gbuffer pass)


The problem is the following: the gbuffer and accumulation passes work fine, however the forward render pass ignores my request to clear the depth buffer (therefore using compare_op_less discards all fragments).


First, a link to the code: GitHub - asylum2010/Asylum_Tutorials: Code for tutorials posted on my blog.


- set 71_Deferred as startup project
- compile and run (it should work as for now)
- main.cpp line 549: change VK_COMPARE_OP_LESS_OR_EQUAL to VK_COMPARE_OP_LESS
=> the issue is clearly visible


I couldn't find any particular reason why the driver doesn't clear the depth buffer.