mirror of
https://github.com/PabloMK7/citra
synced 2024-11-15 13:18:24 +00:00
Merge pull request #5240 from lioncash/primitive
primitive_assembly: Minor changes
This commit is contained in:
commit
362956a69b
2 changed files with 7 additions and 6 deletions
|
@ -11,11 +11,11 @@ namespace Pica {
|
|||
|
||||
template <typename VertexType>
|
||||
PrimitiveAssembler<VertexType>::PrimitiveAssembler(PipelineRegs::TriangleTopology topology)
|
||||
: topology(topology), buffer_index(0) {}
|
||||
: topology(topology) {}
|
||||
|
||||
template <typename VertexType>
|
||||
void PrimitiveAssembler<VertexType>::SubmitVertex(const VertexType& vtx,
|
||||
TriangleHandler triangle_handler) {
|
||||
const TriangleHandler& triangle_handler) {
|
||||
switch (topology) {
|
||||
case PipelineRegs::TriangleTopology::List:
|
||||
case PipelineRegs::TriangleTopology::Shader:
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <functional>
|
||||
#include <boost/serialization/access.hpp>
|
||||
#include "video_core/regs_pipeline.h"
|
||||
|
@ -19,7 +20,7 @@ struct PrimitiveAssembler {
|
|||
using TriangleHandler =
|
||||
std::function<void(const VertexType& v0, const VertexType& v1, const VertexType& v2)>;
|
||||
|
||||
PrimitiveAssembler(
|
||||
explicit PrimitiveAssembler(
|
||||
PipelineRegs::TriangleTopology topology = PipelineRegs::TriangleTopology::List);
|
||||
|
||||
/*
|
||||
|
@ -28,7 +29,7 @@ struct PrimitiveAssembler {
|
|||
* NOTE: We could specify the triangle handler in the constructor, but this way we can
|
||||
* keep event and handler code next to each other.
|
||||
*/
|
||||
void SubmitVertex(const VertexType& vtx, TriangleHandler triangle_handler);
|
||||
void SubmitVertex(const VertexType& vtx, const TriangleHandler& triangle_handler);
|
||||
|
||||
/**
|
||||
* Invert the vertex order of the next triangle. Called by geometry shader emitter.
|
||||
|
@ -59,8 +60,8 @@ struct PrimitiveAssembler {
|
|||
private:
|
||||
PipelineRegs::TriangleTopology topology;
|
||||
|
||||
int buffer_index;
|
||||
VertexType buffer[2];
|
||||
int buffer_index = 0;
|
||||
std::array<VertexType, 2> buffer;
|
||||
bool strip_ready = false;
|
||||
bool winding = false;
|
||||
|
||||
|
|
Loading…
Reference in a new issue