mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-16 18:59:48 +12:00
use proper primitive types
This commit is contained in:
parent
b220c163e3
commit
a08d61ad46
2 changed files with 14 additions and 1 deletions
|
@ -97,4 +97,17 @@ inline MTL::StencilOperation toMTLStencilOperation(u8 op) {
|
|||
return MTL::StencilOperationKeep;
|
||||
}
|
||||
|
||||
inline MTL::PrimitiveType toMTLPrimitiveType(PrimType primType) {
|
||||
switch (primType) {
|
||||
case PrimType::TriangleList: return MTL::PrimitiveTypeTriangle;
|
||||
case PrimType::TriangleStrip: return MTL::PrimitiveTypeTriangleStrip;
|
||||
case PrimType::TriangleFan:
|
||||
Helpers::warn("Triangle fans are not supported on Metal, using triangles instead");
|
||||
return MTL::PrimitiveTypeTriangle;
|
||||
case PrimType::GeometryPrimitive:
|
||||
Helpers::warn("Geometry primitives are not yet, using triangles instead");
|
||||
return MTL::PrimitiveTypeTriangle;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace PICA
|
||||
|
|
|
@ -405,7 +405,7 @@ void RendererMTL::drawVertices(PICA::PrimType primType, std::span<const PICA::Ve
|
|||
renderCommandEncoder->setFragmentBytes(®s[0x48], 0x200 - 0x48, 0);
|
||||
|
||||
// TODO: respect primitive type
|
||||
renderCommandEncoder->drawPrimitives(MTL::PrimitiveTypeTriangle, NS::UInteger(0), NS::UInteger(vertices.size()));
|
||||
renderCommandEncoder->drawPrimitives(toMTLPrimitiveType(primType), NS::UInteger(0), NS::UInteger(vertices.size()));
|
||||
}
|
||||
|
||||
void RendererMTL::screenshot(const std::string& name) {
|
||||
|
|
Loading…
Add table
Reference in a new issue