Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Flyinghead
Beginner
363 Views

Vulkan depth test fails when depth buffer write is disabled and gl_FragDepth is updated in fragment shader

System Setup Information:
-----------------------------------------

System Used: Intel NUC7i5BN
CPU SKU: i5
GPU SKU: Intel Iris Plus Graphics 640
Processor Line: i5-7260U
Graphics Driver Version: 26.20.100.7212
Operating System: Windows 10 Home
OS Version: 10.0.17763
API: Vulkan
Occurs on non-Intel GPUs?: No (tested on NVidia, AMD, Mali, Adreno)

Steps to Reproduce:
-------------------------------

See sample code to reproduce the issue at https://github.com/flyinghead/PracticalVulkan

1. Disable depth buffer write
2. Set z coordinate of vertices in the vertex shader outside the [0,1] range
3. Update gl_FragDepth in the fragment shader to a value within [0,1]

Under these conditions, geometry isn't drawn.

Enabling depth buffer writes makes geometry appear.

0 Kudos
4 Replies
Slawomir_C_Intel
Employee
363 Views

Hello!

This is Sławomir from the graphics software engineering team. 

 

Thank you for your report!   Yes, you are right, there is a bug in handling FragDepth shader output if depthWrite state is disabled.

The issue was reproduced and the team is now working on a fix.

 

 

Flyinghead
Beginner
363 Views

Hi Slawomir,

Thank you for this update. Obviously this is great news!

Thanks again

 

Koury__Shannon
Beginner
363 Views

THanks 

Koury__Shannon
Beginner
363 Views

Thanks

Reply