diff options
| author | 2018-11-04 23:46:06 -0300 | |
|---|---|---|
| committer | 2018-11-05 00:24:19 -0300 | |
| commit | 19038db4898bc059fe78d21ba9a400b5277dd2dd (patch) | |
| tree | 78ff28c93f700da54a7d452ae82dfa4714cab3c7 /src/video_core/engines | |
| parent | Implement multi-target viewports and blending (diff) | |
| download | yuzu-19038db4898bc059fe78d21ba9a400b5277dd2dd.tar.gz yuzu-19038db4898bc059fe78d21ba9a400b5277dd2dd.tar.xz yuzu-19038db4898bc059fe78d21ba9a400b5277dd2dd.zip | |
Add support to color mask to avoid issues in blending caused by wrong values in the alpha channel in some render targets.
Diffstat (limited to 'src/video_core/engines')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 33eb57360..0509ba3a2 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -462,6 +462,16 @@ public: | |||
| 462 | } | 462 | } |
| 463 | }; | 463 | }; |
| 464 | 464 | ||
| 465 | struct ColorMask { | ||
| 466 | union { | ||
| 467 | u32 raw; | ||
| 468 | BitField<0, 4, u32> R; | ||
| 469 | BitField<4, 4, u32> G; | ||
| 470 | BitField<8, 4, u32> B; | ||
| 471 | BitField<12, 4, u32> A; | ||
| 472 | }; | ||
| 473 | }; | ||
| 474 | |||
| 465 | bool IsShaderConfigEnabled(std::size_t index) const { | 475 | bool IsShaderConfigEnabled(std::size_t index) const { |
| 466 | // The VertexB is always enabled. | 476 | // The VertexB is always enabled. |
| 467 | if (index == static_cast<std::size_t>(Regs::ShaderProgram::VertexB)) { | 477 | if (index == static_cast<std::size_t>(Regs::ShaderProgram::VertexB)) { |
| @@ -571,7 +581,11 @@ public: | |||
| 571 | u32 stencil_back_mask; | 581 | u32 stencil_back_mask; |
| 572 | u32 stencil_back_func_mask; | 582 | u32 stencil_back_func_mask; |
| 573 | 583 | ||
| 574 | INSERT_PADDING_WORDS(0x13); | 584 | INSERT_PADDING_WORDS(0xC); |
| 585 | |||
| 586 | u32 color_mask_common; | ||
| 587 | |||
| 588 | INSERT_PADDING_WORDS(0x6); | ||
| 575 | 589 | ||
| 576 | u32 rt_separate_frag_data; | 590 | u32 rt_separate_frag_data; |
| 577 | 591 | ||
| @@ -847,8 +861,9 @@ public: | |||
| 847 | BitField<6, 4, u32> RT; | 861 | BitField<6, 4, u32> RT; |
| 848 | BitField<10, 11, u32> layer; | 862 | BitField<10, 11, u32> layer; |
| 849 | } clear_buffers; | 863 | } clear_buffers; |
| 850 | 864 | INSERT_PADDING_WORDS(0xB); | |
| 851 | INSERT_PADDING_WORDS(0x4B); | 865 | std::array<ColorMask, NumRenderTargets> color_mask; |
| 866 | INSERT_PADDING_WORDS(0x38); | ||
| 852 | 867 | ||
| 853 | struct { | 868 | struct { |
| 854 | u32 query_address_high; | 869 | u32 query_address_high; |
| @@ -1081,6 +1096,7 @@ ASSERT_REG_POSITION(scissor_test, 0x380); | |||
| 1081 | ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5); | 1096 | ASSERT_REG_POSITION(stencil_back_func_ref, 0x3D5); |
| 1082 | ASSERT_REG_POSITION(stencil_back_mask, 0x3D6); | 1097 | ASSERT_REG_POSITION(stencil_back_mask, 0x3D6); |
| 1083 | ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7); | 1098 | ASSERT_REG_POSITION(stencil_back_func_mask, 0x3D7); |
| 1099 | ASSERT_REG_POSITION(color_mask_common, 0x3E4); | ||
| 1084 | ASSERT_REG_POSITION(rt_separate_frag_data, 0x3EB); | 1100 | ASSERT_REG_POSITION(rt_separate_frag_data, 0x3EB); |
| 1085 | ASSERT_REG_POSITION(zeta, 0x3F8); | 1101 | ASSERT_REG_POSITION(zeta, 0x3F8); |
| 1086 | ASSERT_REG_POSITION(vertex_attrib_format, 0x458); | 1102 | ASSERT_REG_POSITION(vertex_attrib_format, 0x458); |
| @@ -1127,6 +1143,7 @@ ASSERT_REG_POSITION(instanced_arrays, 0x620); | |||
| 1127 | ASSERT_REG_POSITION(cull, 0x646); | 1143 | ASSERT_REG_POSITION(cull, 0x646); |
| 1128 | ASSERT_REG_POSITION(logic_op, 0x671); | 1144 | ASSERT_REG_POSITION(logic_op, 0x671); |
| 1129 | ASSERT_REG_POSITION(clear_buffers, 0x674); | 1145 | ASSERT_REG_POSITION(clear_buffers, 0x674); |
| 1146 | ASSERT_REG_POSITION(color_mask, 0x680); | ||
| 1130 | ASSERT_REG_POSITION(query, 0x6C0); | 1147 | ASSERT_REG_POSITION(query, 0x6C0); |
| 1131 | ASSERT_REG_POSITION(vertex_array[0], 0x700); | 1148 | ASSERT_REG_POSITION(vertex_array[0], 0x700); |
| 1132 | ASSERT_REG_POSITION(independent_blend, 0x780); | 1149 | ASSERT_REG_POSITION(independent_blend, 0x780); |