diff options
| author | 2022-10-10 20:32:38 +0100 | |
|---|---|---|
| committer | 2022-10-10 20:59:57 +0100 | |
| commit | 4496030ea9bd873d101628a8eb943b976ec7b07a (patch) | |
| tree | d26b116981aa0dd9eaec5e951976d59a63322de4 /src/video_core/renderer_vulkan | |
| parent | Merge pull request #9043 from german77/vector_data (diff) | |
| download | yuzu-4496030ea9bd873d101628a8eb943b976ec7b07a.tar.gz yuzu-4496030ea9bd873d101628a8eb943b976ec7b07a.tar.xz yuzu-4496030ea9bd873d101628a8eb943b976ec7b07a.zip | |
Fix stencil func registers, make clip control equivalent to how it was before, but surely wrong.
Diffstat (limited to 'src/video_core/renderer_vulkan')
| -rw-r--r-- | src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 14 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_state_tracker.cpp | 12 |
3 files changed, 17 insertions, 15 deletions
diff --git a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp index eb7c22fd5..eab1b8f93 100644 --- a/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp +++ b/src/video_core/renderer_vulkan/fixed_pipeline_state.cpp | |||
| @@ -63,7 +63,11 @@ void FixedPipelineState::Refresh(Tegra::Engines::Maxwell3D& maxwell3d, | |||
| 63 | primitive_restart_enable.Assign(regs.primitive_restart.enabled != 0 ? 1 : 0); | 63 | primitive_restart_enable.Assign(regs.primitive_restart.enabled != 0 ? 1 : 0); |
| 64 | depth_bias_enable.Assign(enabled_lut[POLYGON_OFFSET_ENABLE_LUT[topology_index]] != 0 ? 1 : 0); | 64 | depth_bias_enable.Assign(enabled_lut[POLYGON_OFFSET_ENABLE_LUT[topology_index]] != 0 ? 1 : 0); |
| 65 | depth_clamp_disabled.Assign(regs.viewport_clip_control.geometry_clip == | 65 | depth_clamp_disabled.Assign(regs.viewport_clip_control.geometry_clip == |
| 66 | Maxwell::ViewportClipControl::GeometryClip::Passthrough); | 66 | Maxwell::ViewportClipControl::GeometryClip::Passthrough || |
| 67 | regs.viewport_clip_control.geometry_clip == | ||
| 68 | Maxwell::ViewportClipControl::GeometryClip::FrustumXYZ || | ||
| 69 | regs.viewport_clip_control.geometry_clip == | ||
| 70 | Maxwell::ViewportClipControl::GeometryClip::FrustumZ); | ||
| 67 | ndc_minus_one_to_one.Assign(regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1 : 0); | 71 | ndc_minus_one_to_one.Assign(regs.depth_mode == Maxwell::DepthMode::MinusOneToOne ? 1 : 0); |
| 68 | polygon_mode.Assign(PackPolygonMode(regs.polygon_mode_front)); | 72 | polygon_mode.Assign(PackPolygonMode(regs.polygon_mode_front)); |
| 69 | patch_control_points_minus_one.Assign(regs.patch_vertices - 1); | 73 | patch_control_points_minus_one.Assign(regs.patch_vertices - 1); |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 892cd94a3..47dfb45a1 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -772,11 +772,10 @@ void RasterizerVulkan::UpdateStencilFaces(Tegra::Engines::Maxwell3D::Regs& regs) | |||
| 772 | if (regs.stencil_two_side_enable) { | 772 | if (regs.stencil_two_side_enable) { |
| 773 | // Separate values per face | 773 | // Separate values per face |
| 774 | scheduler.Record( | 774 | scheduler.Record( |
| 775 | [front_ref = regs.stencil_front_func.ref, | 775 | [front_ref = regs.stencil_front_ref, front_write_mask = regs.stencil_front_mask, |
| 776 | front_write_mask = regs.stencil_front_func.mask, | 776 | front_test_mask = regs.stencil_front_func_mask, back_ref = regs.stencil_back_ref, |
| 777 | front_test_mask = regs.stencil_front_func.func_mask, | 777 | back_write_mask = regs.stencil_back_mask, |
| 778 | back_ref = regs.stencil_back_func.ref, back_write_mask = regs.stencil_back_func.mask, | 778 | back_test_mask = regs.stencil_back_func_mask](vk::CommandBuffer cmdbuf) { |
| 779 | back_test_mask = regs.stencil_back_func.func_mask](vk::CommandBuffer cmdbuf) { | ||
| 780 | // Front face | 779 | // Front face |
| 781 | cmdbuf.SetStencilReference(VK_STENCIL_FACE_FRONT_BIT, front_ref); | 780 | cmdbuf.SetStencilReference(VK_STENCIL_FACE_FRONT_BIT, front_ref); |
| 782 | cmdbuf.SetStencilWriteMask(VK_STENCIL_FACE_FRONT_BIT, front_write_mask); | 781 | cmdbuf.SetStencilWriteMask(VK_STENCIL_FACE_FRONT_BIT, front_write_mask); |
| @@ -789,9 +788,8 @@ void RasterizerVulkan::UpdateStencilFaces(Tegra::Engines::Maxwell3D::Regs& regs) | |||
| 789 | }); | 788 | }); |
| 790 | } else { | 789 | } else { |
| 791 | // Front face defines both faces | 790 | // Front face defines both faces |
| 792 | scheduler.Record([ref = regs.stencil_front_func.ref, | 791 | scheduler.Record([ref = regs.stencil_front_ref, write_mask = regs.stencil_front_mask, |
| 793 | write_mask = regs.stencil_front_func.mask, | 792 | test_mask = regs.stencil_front_func_mask](vk::CommandBuffer cmdbuf) { |
| 794 | test_mask = regs.stencil_front_func.func_mask](vk::CommandBuffer cmdbuf) { | ||
| 795 | cmdbuf.SetStencilReference(VK_STENCIL_FACE_FRONT_AND_BACK, ref); | 793 | cmdbuf.SetStencilReference(VK_STENCIL_FACE_FRONT_AND_BACK, ref); |
| 796 | cmdbuf.SetStencilWriteMask(VK_STENCIL_FACE_FRONT_AND_BACK, write_mask); | 794 | cmdbuf.SetStencilWriteMask(VK_STENCIL_FACE_FRONT_AND_BACK, write_mask); |
| 797 | cmdbuf.SetStencilCompareMask(VK_STENCIL_FACE_FRONT_AND_BACK, test_mask); | 795 | cmdbuf.SetStencilCompareMask(VK_STENCIL_FACE_FRONT_AND_BACK, test_mask); |
diff --git a/src/video_core/renderer_vulkan/vk_state_tracker.cpp b/src/video_core/renderer_vulkan/vk_state_tracker.cpp index ed98c8370..b87c3be66 100644 --- a/src/video_core/renderer_vulkan/vk_state_tracker.cpp +++ b/src/video_core/renderer_vulkan/vk_state_tracker.cpp | |||
| @@ -77,12 +77,12 @@ void SetupDirtyDepthBounds(Tables& tables) { | |||
| 77 | void SetupDirtyStencilProperties(Tables& tables) { | 77 | void SetupDirtyStencilProperties(Tables& tables) { |
| 78 | auto& table = tables[0]; | 78 | auto& table = tables[0]; |
| 79 | table[OFF(stencil_two_side_enable)] = StencilProperties; | 79 | table[OFF(stencil_two_side_enable)] = StencilProperties; |
| 80 | table[OFF(stencil_front_func.ref)] = StencilProperties; | 80 | table[OFF(stencil_front_ref)] = StencilProperties; |
| 81 | table[OFF(stencil_front_func.mask)] = StencilProperties; | 81 | table[OFF(stencil_front_mask)] = StencilProperties; |
| 82 | table[OFF(stencil_front_func.func_mask)] = StencilProperties; | 82 | table[OFF(stencil_front_func_mask)] = StencilProperties; |
| 83 | table[OFF(stencil_back_func.ref)] = StencilProperties; | 83 | table[OFF(stencil_back_ref)] = StencilProperties; |
| 84 | table[OFF(stencil_back_func.mask)] = StencilProperties; | 84 | table[OFF(stencil_back_mask)] = StencilProperties; |
| 85 | table[OFF(stencil_back_func.func_mask)] = StencilProperties; | 85 | table[OFF(stencil_back_func_mask)] = StencilProperties; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | void SetupDirtyLineWidth(Tables& tables) { | 88 | void SetupDirtyLineWidth(Tables& tables) { |