summaryrefslogtreecommitdiffstats
path: root/src/video_core/engines
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-05-08 21:16:53 +0200
committerGitHub <noreply@github.com>2020-05-08 21:16:53 +0200
commit50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d (patch)
tree594f42eb18464e5370917bfad61694ecce7a050b /src/video_core/engines
parentMerge pull request #3879 from lioncash/global2 (diff)
parentvk_graphics_pipeline: Implement viewport swizzles with NV_viewport_swizzle (diff)
downloadyuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.tar
yuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.tar.gz
yuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.tar.bz2
yuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.tar.lz
yuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.tar.xz
yuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.tar.zst
yuzu-50c27d5ae1bfe6cff6f091f07d68ab7b8e394d9d.zip
Diffstat (limited to 'src/video_core/engines')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp6
-rw-r--r--src/video_core/engines/maxwell_3d.h20
2 files changed, 25 insertions, 1 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp
index 33936e209..024c9e43b 100644
--- a/src/video_core/engines/maxwell_3d.cpp
+++ b/src/video_core/engines/maxwell_3d.cpp
@@ -44,6 +44,12 @@ void Maxwell3D::InitializeRegisterDefaults() {
viewport.depth_range_near = 0.0f;
viewport.depth_range_far = 1.0f;
}
+ for (auto& viewport : regs.viewport_transform) {
+ viewport.swizzle.x.Assign(Regs::ViewportSwizzle::PositiveX);
+ viewport.swizzle.y.Assign(Regs::ViewportSwizzle::PositiveY);
+ viewport.swizzle.z.Assign(Regs::ViewportSwizzle::PositiveZ);
+ viewport.swizzle.w.Assign(Regs::ViewportSwizzle::PositiveW);
+ }
// Doom and Bomberman seems to use the uninitialized registers and just enable blend
// 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 1a5df05ce..05dd6b39b 100644
--- a/src/video_core/engines/maxwell_3d.h
+++ b/src/video_core/engines/maxwell_3d.h
@@ -576,6 +576,17 @@ public:
Replay = 3,
};
+ enum class ViewportSwizzle : u32 {
+ PositiveX = 0,
+ NegativeX = 1,
+ PositiveY = 2,
+ NegativeY = 3,
+ PositiveZ = 4,
+ NegativeZ = 5,
+ PositiveW = 6,
+ NegativeW = 7,
+ };
+
struct RenderTargetConfig {
u32 address_high;
u32 address_low;
@@ -619,7 +630,14 @@ public:
f32 translate_x;
f32 translate_y;
f32 translate_z;
- INSERT_UNION_PADDING_WORDS(2);
+ union {
+ u32 raw;
+ BitField<0, 3, ViewportSwizzle> x;
+ BitField<4, 3, ViewportSwizzle> y;
+ BitField<8, 3, ViewportSwizzle> z;
+ BitField<12, 3, ViewportSwizzle> w;
+ } swizzle;
+ INSERT_UNION_PADDING_WORDS(1);
Common::Rectangle<f32> GetRect() const {
return {