mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-02 08:25:07 +01:00
VideoCore: Make PrimitiveAssembler const-correct
This commit is contained in:
parent
dcdffabfe6
commit
37a4ea046d
@ -14,7 +14,7 @@ PrimitiveAssembler<VertexType>::PrimitiveAssembler(Regs::TriangleTopology topolo
|
|||||||
: topology(topology), buffer_index(0) {}
|
: topology(topology), buffer_index(0) {}
|
||||||
|
|
||||||
template <typename VertexType>
|
template <typename VertexType>
|
||||||
void PrimitiveAssembler<VertexType>::SubmitVertex(VertexType& vtx,
|
void PrimitiveAssembler<VertexType>::SubmitVertex(const VertexType& vtx,
|
||||||
TriangleHandler triangle_handler) {
|
TriangleHandler triangle_handler) {
|
||||||
switch (topology) {
|
switch (topology) {
|
||||||
// TODO: Figure out what's different with TriangleTopology::Shader.
|
// TODO: Figure out what's different with TriangleTopology::Shader.
|
||||||
|
@ -15,7 +15,8 @@ namespace Pica {
|
|||||||
*/
|
*/
|
||||||
template <typename VertexType>
|
template <typename VertexType>
|
||||||
struct PrimitiveAssembler {
|
struct PrimitiveAssembler {
|
||||||
using TriangleHandler = std::function<void(VertexType& v0, VertexType& v1, VertexType& v2)>;
|
using TriangleHandler =
|
||||||
|
std::function<void(const VertexType& v0, const VertexType& v1, const VertexType& v2)>;
|
||||||
|
|
||||||
PrimitiveAssembler(Regs::TriangleTopology topology = Regs::TriangleTopology::List);
|
PrimitiveAssembler(Regs::TriangleTopology topology = Regs::TriangleTopology::List);
|
||||||
|
|
||||||
@ -25,7 +26,7 @@ struct PrimitiveAssembler {
|
|||||||
* NOTE: We could specify the triangle handler in the constructor, but this way we can
|
* NOTE: We could specify the triangle handler in the constructor, but this way we can
|
||||||
* keep event and handler code next to each other.
|
* keep event and handler code next to each other.
|
||||||
*/
|
*/
|
||||||
void SubmitVertex(VertexType& vtx, TriangleHandler triangle_handler);
|
void SubmitVertex(const VertexType& vtx, TriangleHandler triangle_handler);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resets the internal state of the PrimitiveAssembler.
|
* Resets the internal state of the PrimitiveAssembler.
|
||||||
|
Loading…
Reference in New Issue
Block a user