Slime-Dev / SlimeProject

SlimeEngine is my personal playground for learning modern Vulkan and its 1.3 features. This project serves as both a learning tool and a growing graphics framework, focusing on clean, understandable implementation of advanced Vulkan concepts. It's a work in progress, evolving as I explore and understand more about low-level graphics programming.
3 stars 0 forks source link

Depth buffer is broken #6

Closed AlexMollard closed 2 months ago

AlexMollard commented 2 months ago

Depth Buffer Discarding All Pixels

Problem Description

The depth buffer is currently malfunctioning, discarding every pixel in each frame. This results in incorrect depth testing and rendering artifacts, severely impacting the visual quality and accuracy of the 3D scene.

Symptoms

Potential Causes

  1. Incorrect depth attachment setup in the render pass
  2. Improper depth test configuration in the pipeline state
  3. Shader issues related to depth writing or testing
  4. Misconfigured viewport or scissor settings
  5. Incorrect clear values for the depth buffer
  6. Unintended depth buffer clears between draw calls

Investigation Steps

  1. Verify depth attachment creation and format
  2. Check the depth test and write settings in the pipeline state
  3. Review shader code for depth-related operations
  4. Examine viewport and scissor configurations
  5. Inspect clear values and operations for the depth buffer
  6. Analyze the rendering loop for unintended state changes

Possible Solutions

Impact

Resolving this issue is critical for:

Testing

After implementing fixes:

AlexMollard commented 2 months ago

Issue Resolved

Cause

The colorBlendAttachment.colorWriteMask was not properly set in the graphics pipeline configuration.

Solution

I updated the pipeline creation to correctly set the color write mask.

Commit

The fix has been implemented in the following commit: 71e5cf6: Fixed depth buffer, Adjusted the debug utils as the colours made it hard to debug in renderdoc.