diff options
author | Liam <byteslice@airmail.cc> | 2022-03-14 15:11:28 +0100 |
---|---|---|
committer | Liam <byteslice@airmail.cc> | 2022-03-14 15:11:58 +0100 |
commit | 37aa472269df2e66af151c36822d0d248bec1a40 (patch) | |
tree | e04864aa36c9972e7ed23af4aa1f1862b967fd9b /src/video_core/engines | |
parent | Maxwell3D: Restrict topology override effect to after the register is set (diff) | |
download | yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.gz yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.bz2 yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.lz yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.xz yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.zst yuzu-37aa472269df2e66af151c36822d0d248bec1a40.zip |
Diffstat (limited to 'src/video_core/engines')
-rw-r--r-- | src/video_core/engines/maxwell_3d.cpp | 23 | ||||
-rw-r--r-- | src/video_core/engines/maxwell_3d.h | 16 |
2 files changed, 37 insertions, 2 deletions
diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 92baba4e8..aa88984d4 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -370,8 +370,29 @@ void Maxwell3D::CallMethodFromMME(u32 method, u32 method_argument) { } void Maxwell3D::ProcessTopologyOverride() { + using PrimitiveTopology = Maxwell3D::Regs::PrimitiveTopology; + using PrimitiveTopologyOverride = Maxwell3D::Regs::PrimitiveTopologyOverride; + + PrimitiveTopology topology{}; + + switch (regs.topology_override) { + case PrimitiveTopologyOverride::None: + case PrimitiveTopologyOverride::Points: + topology = PrimitiveTopology::Points; + break; + case PrimitiveTopologyOverride::Lines: + topology = PrimitiveTopology::Lines; + break; + case PrimitiveTopologyOverride::LineStrip: + topology = PrimitiveTopology::LineStrip; + break; + default: + topology = static_cast<PrimitiveTopology>(regs.topology_override); + break; + } + if (use_topology_override) { - regs.draw.topology.Assign(regs.topology_override); + regs.draw.topology.Assign(topology); } } diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index eefb7a4dd..513a9d5df 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h @@ -367,6 +367,20 @@ public: Patches = 0xe, }; + enum class PrimitiveTopologyOverride : u32 { + None = 0x0, + Points = 0x1, + Lines = 0x2, + LineStrip = 0x3, + Triangles = 0x4, + TriangleStrip = 0x5, + LinesAdjacency = 0xa, + LineStripAdjacency = 0xb, + TrianglesAdjacency = 0xc, + TriangleStripAdjacency = 0xd, + Patches = 0xe, + }; + enum class IndexFormat : u32 { UnsignedByte = 0x0, UnsignedShort = 0x1, @@ -1251,7 +1265,7 @@ public: INSERT_PADDING_WORDS_NOINIT(0xC); - PrimitiveTopology topology_override; + PrimitiveTopologyOverride topology_override; INSERT_PADDING_WORDS_NOINIT(0x12); |