diff options
author | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-14 18:34:02 +0100 |
---|---|---|
committer | Rodolfo Bogado <rodolfoosvaldobogado@gmail.com> | 2018-11-17 23:59:34 +0100 |
commit | e69eb3c7609bdb632e4c3e979562325b7a0b4610 (patch) | |
tree | e586d0c62a6286d4f53477db6c2160fa5426b16a | |
parent | add AlphaToCoverage and AlphaToOne (diff) | |
download | yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.tar yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.tar.gz yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.tar.bz2 yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.tar.lz yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.tar.xz yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.tar.zst yuzu-e69eb3c7609bdb632e4c3e979562325b7a0b4610.zip |
-rw-r--r-- | src/video_core/engines/maxwell_3d.h | 121 |
1 files changed, 61 insertions, 60 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 753aff57f..1af948d24 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -480,6 +480,67 @@ public: }; }; + struct ViewportTransform { + f32 scale_x; + f32 scale_y; + f32 scale_z; + f32 translate_x; + f32 translate_y; + f32 translate_z; + INSERT_PADDING_WORDS(2); + + MathUtil::Rectangle<s32> GetRect() const { + return { + GetX(), // left + GetY() + GetHeight(), // top + GetX() + GetWidth(), // right + GetY() // bottom + }; + }; + + s32 GetX() const { + return static_cast<s32>(std::max(0.0f, translate_x - std::fabs(scale_x))); + } + + s32 GetY() const { + return static_cast<s32>(std::max(0.0f, translate_y - std::fabs(scale_y))); + } + + s32 GetWidth() const { + return static_cast<s32>(translate_x + std::fabs(scale_x)) - GetX(); + } + + s32 GetHeight() const { + return static_cast<s32>(translate_y + std::fabs(scale_y)) - GetY(); + } + }; + + struct ScissorTest { + u32 enable; + union { + BitField<0, 16, u32> min_x; + BitField<16, 16, u32> max_x; + }; + union { + BitField<0, 16, u32> min_y; + BitField<16, 16, u32> max_y; + }; + u32 fill; + }; + + struct ViewPort { + union { + BitField<0, 16, u32> x; + BitField<16, 16, u32> width; + }; + union { + BitField<0, 16, u32> y; + BitField<16, 16, u32> height; + }; + float depth_range_near; + float depth_range_far; + }; + bool IsShaderConfigEnabled(std::size_t index) const { // The VertexB is always enabled. if (index == static_cast<std::size_t>(Regs::ShaderProgram::VertexB)) { @@ -507,56 +568,8 @@ public: std::array<RenderTargetConfig, NumRenderTargets> rt; - struct ViewportTransform { - f32 scale_x; - f32 scale_y; - f32 scale_z; - f32 translate_x; - f32 translate_y; - f32 translate_z; - INSERT_PADDING_WORDS(2); - - MathUtil::Rectangle<s32> GetRect() const { - return { - GetX(), // left - GetY() + GetHeight(), // top - GetX() + GetWidth(), // right - GetY() // bottom - }; - }; - - s32 GetX() const { - return static_cast<s32>(std::max(0.0f, translate_x - std::fabs(scale_x))); - } - - s32 GetY() const { - return static_cast<s32>(std::max(0.0f, translate_y - std::fabs(scale_y))); - } - - s32 GetWidth() const { - return static_cast<s32>(translate_x + std::fabs(scale_x)) - GetX(); - } - - s32 GetHeight() const { - return static_cast<s32>(translate_y + std::fabs(scale_y)) - GetY(); - } - }; - std::array<ViewportTransform, NumViewports> viewport_transform; - struct ViewPort { - union { - BitField<0, 16, u32> x; - BitField<16, 16, u32> width; - }; - union { - BitField<0, 16, u32> y; - BitField<16, 16, u32> height; - }; - float depth_range_near; - float depth_range_far; - }; - std::array<ViewPort, NumViewports> viewports; INSERT_PADDING_WORDS(0x1D); @@ -575,18 +588,6 @@ public: INSERT_PADDING_WORDS(0x17); - struct ScissorTest { - u32 enable; - union { - BitField<0, 16, u32> min_x; - BitField<16, 16, u32> max_x; - }; - union { - BitField<0, 16, u32> min_y; - BitField<16, 16, u32> max_y; - }; - u32 fill; - }; std::array<ScissorTest, NumViewports> scissor_test; INSERT_PADDING_WORDS(0x15); |