summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Liam2022-03-14 10:11:28 -0400
committerGravatar Liam2022-03-14 10:11:58 -0400
commit37aa472269df2e66af151c36822d0d248bec1a40 (patch)
treee04864aa36c9972e7ed23af4aa1f1862b967fd9b /src
parentMaxwell3D: Restrict topology override effect to after the register is set (diff)
downloadyuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.gz
yuzu-37aa472269df2e66af151c36822d0d248bec1a40.tar.xz
yuzu-37aa472269df2e66af151c36822d0d248bec1a40.zip
Maxwell3D: Use override constants from nouveau
This fixes some incorrect rendering in Sunshine
Diffstat (limited to 'src')
-rw-r--r--src/video_core/engines/maxwell_3d.cpp23
-rw-r--r--src/video_core/engines/maxwell_3d.h16
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) {
370} 370}
371 371
372void Maxwell3D::ProcessTopologyOverride() { 372void Maxwell3D::ProcessTopologyOverride() {
373 using PrimitiveTopology = Maxwell3D::Regs::PrimitiveTopology;
374 using PrimitiveTopologyOverride = Maxwell3D::Regs::PrimitiveTopologyOverride;
375
376 PrimitiveTopology topology{};
377
378 switch (regs.topology_override) {
379 case PrimitiveTopologyOverride::None:
380 case PrimitiveTopologyOverride::Points:
381 topology = PrimitiveTopology::Points;
382 break;
383 case PrimitiveTopologyOverride::Lines:
384 topology = PrimitiveTopology::Lines;
385 break;
386 case PrimitiveTopologyOverride::LineStrip:
387 topology = PrimitiveTopology::LineStrip;
388 break;
389 default:
390 topology = static_cast<PrimitiveTopology>(regs.topology_override);
391 break;
392 }
393
373 if (use_topology_override) { 394 if (use_topology_override) {
374 regs.draw.topology.Assign(regs.topology_override); 395 regs.draw.topology.Assign(topology);
375 } 396 }
376} 397}
377 398
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:
367 Patches = 0xe, 367 Patches = 0xe,
368 }; 368 };
369 369
370 enum class PrimitiveTopologyOverride : u32 {
371 None = 0x0,
372 Points = 0x1,
373 Lines = 0x2,
374 LineStrip = 0x3,
375 Triangles = 0x4,
376 TriangleStrip = 0x5,
377 LinesAdjacency = 0xa,
378 LineStripAdjacency = 0xb,
379 TrianglesAdjacency = 0xc,
380 TriangleStripAdjacency = 0xd,
381 Patches = 0xe,
382 };
383
370 enum class IndexFormat : u32 { 384 enum class IndexFormat : u32 {
371 UnsignedByte = 0x0, 385 UnsignedByte = 0x0,
372 UnsignedShort = 0x1, 386 UnsignedShort = 0x1,
@@ -1251,7 +1265,7 @@ public:
1251 1265
1252 INSERT_PADDING_WORDS_NOINIT(0xC); 1266 INSERT_PADDING_WORDS_NOINIT(0xC);
1253 1267
1254 PrimitiveTopology topology_override; 1268 PrimitiveTopologyOverride topology_override;
1255 1269
1256 INSERT_PADDING_WORDS_NOINIT(0x12); 1270 INSERT_PADDING_WORDS_NOINIT(0x12);
1257 1271