diff options
author | Tony Wasserka <NeoBrainX@gmail.com> | 2014-12-07 00:26:48 +0100 |
---|---|---|
committer | Tony Wasserka <NeoBrainX@gmail.com> | 2014-12-20 18:06:54 +0100 |
commit | cd322e328ec6957b6744ee9b68d29b2c29a554df (patch) | |
tree | fec41fd5536f562e7a842d86176224dddd6e1df0 /src | |
parent | Pica/CommandProcessor: Add a safety check for invalid (?) GPU configurations. (diff) | |
download | yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.tar yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.tar.gz yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.tar.bz2 yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.tar.lz yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.tar.xz yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.tar.zst yuzu-cd322e328ec6957b6744ee9b68d29b2c29a554df.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/primitive_assembly.cpp | 23 | ||||
-rw-r--r-- | src/video_core/primitive_assembly.h | 1 |
2 files changed, 16 insertions, 8 deletions
diff --git a/src/video_core/primitive_assembly.cpp b/src/video_core/primitive_assembly.cpp index 102693ed9..ff46c7b52 100644 --- a/src/video_core/primitive_assembly.cpp +++ b/src/video_core/primitive_assembly.cpp @@ -30,20 +30,27 @@ void PrimitiveAssembler<VertexType>::SubmitVertex(VertexType& vtx, TriangleHandl } break; + case Regs::TriangleTopology::Strip: case Regs::TriangleTopology::Fan: - if (buffer_index == 2) { - buffer_index = 0; - - triangle_handler(buffer[0], buffer[1], vtx); + if (strip_ready) { + // TODO: Should be "buffer[0], buffer[1], vtx" instead! + // Not quite sure why we need this order for things to show up properly. + // Maybe a bug in the rasterizer? + triangle_handler(buffer[1], buffer[0], vtx); + } + buffer[buffer_index] = vtx; - buffer[1] = vtx; - } else { - buffer[buffer_index++] = vtx; + if (topology == Regs::TriangleTopology::Strip) { + strip_ready |= (buffer_index == 1); + buffer_index = !buffer_index; + } else if (topology == Regs::TriangleTopology::Fan) { + buffer_index = 1; + strip_ready = true; } break; default: - LOG_ERROR(Render_Software, "Unknown triangle topology %x:", (int)topology); + LOG_ERROR(HW_GPU, "Unknown triangle topology %x:", (int)topology); break; } } diff --git a/src/video_core/primitive_assembly.h b/src/video_core/primitive_assembly.h index ea2e2f61e..decf0fd64 100644 --- a/src/video_core/primitive_assembly.h +++ b/src/video_core/primitive_assembly.h @@ -37,6 +37,7 @@ private: int buffer_index; VertexType buffer[2]; + bool strip_ready = false; }; |