diff options
| author | 2020-05-04 17:49:48 -0300 | |
|---|---|---|
| committer | 2020-05-04 17:50:59 -0300 | |
| commit | 9b8e9623683da728f98019b096517704eb946d21 (patch) | |
| tree | a8077ca5fa5bafbe63d09b0a92ebe8a2557232e5 /src | |
| parent | Merge pull request #3843 from ogniK5377/GetPopFromGeneralChannelEvent (diff) | |
| download | yuzu-9b8e9623683da728f98019b096517704eb946d21.tar.gz yuzu-9b8e9623683da728f98019b096517704eb946d21.tar.xz yuzu-9b8e9623683da728f98019b096517704eb946d21.zip | |
maxwell_3d: Add viewport swizzles
Diffstat (limited to '')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 6 | ||||
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 19 |
2 files changed, 24 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 7db055ea0..8155f6e2e 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp | |||
| @@ -44,6 +44,12 @@ void Maxwell3D::InitializeRegisterDefaults() { | |||
| 44 | viewport.depth_range_near = 0.0f; | 44 | viewport.depth_range_near = 0.0f; |
| 45 | viewport.depth_range_far = 1.0f; | 45 | viewport.depth_range_far = 1.0f; |
| 46 | } | 46 | } |
| 47 | for (auto& viewport : regs.viewport_transform) { | ||
| 48 | viewport.swizzle.x.Assign(Regs::ViewportSwizzle::PositiveX); | ||
| 49 | viewport.swizzle.y.Assign(Regs::ViewportSwizzle::PositiveY); | ||
| 50 | viewport.swizzle.z.Assign(Regs::ViewportSwizzle::PositiveZ); | ||
| 51 | viewport.swizzle.w.Assign(Regs::ViewportSwizzle::PositiveW); | ||
| 52 | } | ||
| 47 | 53 | ||
| 48 | // Doom and Bomberman seems to use the uninitialized registers and just enable blend | 54 | // Doom and Bomberman seems to use the uninitialized registers and just enable blend |
| 49 | // so initialize blend registers with sane values | 55 | // so initialize blend registers with sane values |
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 864924ff3..4aeff4cc9 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -575,6 +575,17 @@ public: | |||
| 575 | Replay = 3, | 575 | Replay = 3, |
| 576 | }; | 576 | }; |
| 577 | 577 | ||
| 578 | enum class ViewportSwizzle : u32 { | ||
| 579 | PositiveX = 0, | ||
| 580 | NegativeX = 1, | ||
| 581 | PositiveY = 2, | ||
| 582 | NegativeY = 3, | ||
| 583 | PositiveZ = 4, | ||
| 584 | NegativeZ = 5, | ||
| 585 | PositiveW = 6, | ||
| 586 | NegativeW = 7, | ||
| 587 | }; | ||
| 588 | |||
| 578 | struct RenderTargetConfig { | 589 | struct RenderTargetConfig { |
| 579 | u32 address_high; | 590 | u32 address_high; |
| 580 | u32 address_low; | 591 | u32 address_low; |
| @@ -618,7 +629,13 @@ public: | |||
| 618 | f32 translate_x; | 629 | f32 translate_x; |
| 619 | f32 translate_y; | 630 | f32 translate_y; |
| 620 | f32 translate_z; | 631 | f32 translate_z; |
| 621 | INSERT_UNION_PADDING_WORDS(2); | 632 | union { |
| 633 | BitField<0, 3, ViewportSwizzle> x; | ||
| 634 | BitField<4, 3, ViewportSwizzle> y; | ||
| 635 | BitField<8, 3, ViewportSwizzle> z; | ||
| 636 | BitField<12, 3, ViewportSwizzle> w; | ||
| 637 | } swizzle; | ||
| 638 | INSERT_UNION_PADDING_WORDS(1); | ||
| 622 | 639 | ||
| 623 | Common::Rectangle<f32> GetRect() const { | 640 | Common::Rectangle<f32> GetRect() const { |
| 624 | return { | 641 | return { |