Vulkan: Fix Workbench Normals

Workbench normals where inverted resulting to drawing artifacts like:
- Black pixels during matcaps (normals contained NAN values)
- Studio light inverted

The root cause for this was that Vulkan default to determine if a
primitive is facing the camera should be switched. The default was still
incorrect.

Although this fixes it, a better solution is to determine the front
facing based on if the viewport should be switched. As all rendering
occurs when the viewport is inverted it doesn't matter at this moment.

Pull Request: https://projects.blender.org/blender/blender/pulls/108797
This commit is contained in:
Jeroen Bakker
2023-06-09 11:54:06 +02:00
parent d154ebfa83
commit f5dd7d5e6c

View File

@@ -16,6 +16,7 @@ VKPipelineStateManager::VKPipelineStateManager()
rasterization_state = {};
rasterization_state.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
rasterization_state.lineWidth = 1.0f;
rasterization_state.frontFace = VK_FRONT_FACE_CLOCKWISE;
pipeline_color_blend_state = {};
pipeline_color_blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;