diff options
author | bunnei <bunneidev@gmail.com> | 2017-10-10 05:56:20 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2017-10-10 05:56:20 +0200 |
commit | b1d5db1cf60344b6b081c9d03cb6ccc3264326cd (patch) | |
tree | fde377c4ba3c0f92c032e6f5ec8627aae37270ef /src/video_core/pica.cpp | |
parent | loader: Various improvements for NSO/NRO loaders. (diff) | |
parent | Merge pull request #2996 from MerryMage/split-travis (diff) | |
download | yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.gz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.bz2 yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.lz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.xz yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.tar.zst yuzu-b1d5db1cf60344b6b081c9d03cb6ccc3264326cd.zip |
Diffstat (limited to 'src/video_core/pica.cpp')
-rw-r--r-- | src/video_core/pica.cpp | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/src/video_core/pica.cpp b/src/video_core/pica.cpp index b95148a6a..218e06883 100644 --- a/src/video_core/pica.cpp +++ b/src/video_core/pica.cpp @@ -3,9 +3,11 @@ // Refer to the license.txt file included. #include <cstring> +#include "video_core/geometry_pipeline.h" #include "video_core/pica.h" #include "video_core/pica_state.h" -#include "video_core/regs_pipeline.h" +#include "video_core/renderer_base.h" +#include "video_core/video_core.h" namespace Pica { @@ -24,6 +26,23 @@ void Zero(T& o) { memset(&o, 0, sizeof(o)); } +State::State() : geometry_pipeline(*this) { + auto SubmitVertex = [this](const Shader::AttributeBuffer& vertex) { + using Pica::Shader::OutputVertex; + auto AddTriangle = [this](const OutputVertex& v0, const OutputVertex& v1, + const OutputVertex& v2) { + VideoCore::g_renderer->Rasterizer()->AddTriangle(v0, v1, v2); + }; + primitive_assembler.SubmitVertex( + Shader::OutputVertex::FromAttributeBuffer(regs.rasterizer, vertex), AddTriangle); + }; + + auto SetWinding = [this]() { primitive_assembler.SetWinding(); }; + + g_state.gs_unit.SetVertexHandler(SubmitVertex, SetWinding); + g_state.geometry_pipeline.SetVertexHandler(SubmitVertex); +} + void State::Reset() { Zero(regs); Zero(vs); |