1
0
Fork 0
forked from suyu/suyu

maxwell_to_gl: Implement missing primitive topologies

Many of these topologies are exclusively available in OpenGL.
This commit is contained in:
ReinUsesLisp 2019-12-22 22:14:37 -03:00
parent 1e76655f83
commit 91d35559e5
No known key found for this signature in database
GPG key ID: 2DFC508897B39CFE

View file

@ -120,6 +120,8 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
return GL_POINTS; return GL_POINTS;
case Maxwell::PrimitiveTopology::Lines: case Maxwell::PrimitiveTopology::Lines:
return GL_LINES; return GL_LINES;
case Maxwell::PrimitiveTopology::LineLoop:
return GL_LINE_LOOP;
case Maxwell::PrimitiveTopology::LineStrip: case Maxwell::PrimitiveTopology::LineStrip:
return GL_LINE_STRIP; return GL_LINE_STRIP;
case Maxwell::PrimitiveTopology::Triangles: case Maxwell::PrimitiveTopology::Triangles:
@ -130,11 +132,23 @@ inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
return GL_TRIANGLE_FAN; return GL_TRIANGLE_FAN;
case Maxwell::PrimitiveTopology::Quads: case Maxwell::PrimitiveTopology::Quads:
return GL_QUADS; return GL_QUADS;
default: case Maxwell::PrimitiveTopology::QuadStrip:
LOG_CRITICAL(Render_OpenGL, "Unimplemented topology={}", static_cast<u32>(topology)); return GL_QUAD_STRIP;
UNREACHABLE(); case Maxwell::PrimitiveTopology::Polygon:
return {}; return GL_POLYGON;
case Maxwell::PrimitiveTopology::LinesAdjacency:
return GL_LINES_ADJACENCY;
case Maxwell::PrimitiveTopology::LineStripAdjacency:
return GL_LINE_STRIP_ADJACENCY;
case Maxwell::PrimitiveTopology::TrianglesAdjacency:
return GL_TRIANGLES_ADJACENCY;
case Maxwell::PrimitiveTopology::TriangleStripAdjacency:
return GL_TRIANGLE_STRIP_ADJACENCY;
case Maxwell::PrimitiveTopology::Patches:
return GL_PATCHES;
} }
UNREACHABLE_MSG("Invalid topology={}", static_cast<int>(topology));
return GL_POINTS;
} }
inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode, inline GLenum TextureFilterMode(Tegra::Texture::TextureFilter filter_mode,