mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2024-11-26 08:15:44 +01:00
gl_rasterizer: Move PrimitiveTopology check to MaxwellToGL.
This commit is contained in:
parent
666d53299c
commit
67bc2f5ecd
@ -326,17 +326,7 @@ void RasterizerOpenGL::DrawArrays() {
|
||||
state.Apply();
|
||||
|
||||
// Draw the vertex batch
|
||||
GLenum primitive_mode;
|
||||
switch (regs.draw.topology) {
|
||||
case Maxwell::PrimitiveTopology::TriangleStrip:
|
||||
primitive_mode = GL_TRIANGLE_STRIP;
|
||||
break;
|
||||
default:
|
||||
UNREACHABLE();
|
||||
}
|
||||
|
||||
const bool is_indexed = accelerate_draw == AccelDraw::Indexed;
|
||||
|
||||
AnalyzeVertexArray(is_indexed);
|
||||
state.draw.vertex_buffer = stream_buffer->GetHandle();
|
||||
state.Apply();
|
||||
@ -384,7 +374,8 @@ void RasterizerOpenGL::DrawArrays() {
|
||||
if (is_indexed) {
|
||||
UNREACHABLE();
|
||||
} else {
|
||||
glDrawArrays(primitive_mode, 0, regs.vertex_buffer.count);
|
||||
glDrawArrays(MaxwellToGL::PrimitiveTopology(regs.draw.topology), 0,
|
||||
regs.vertex_buffer.count);
|
||||
}
|
||||
|
||||
// Disable scissor test
|
||||
|
@ -37,4 +37,14 @@ inline GLenum VertexType(Maxwell::VertexAttribute attrib) {
|
||||
return {};
|
||||
}
|
||||
|
||||
inline GLenum PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
|
||||
switch (topology) {
|
||||
case Maxwell::PrimitiveTopology::TriangleStrip:
|
||||
return GL_TRIANGLE_STRIP;
|
||||
}
|
||||
LOG_CRITICAL(Render_OpenGL, "Unimplemented primitive topology=%d", topology);
|
||||
UNREACHABLE();
|
||||
return {};
|
||||
}
|
||||
|
||||
} // namespace MaxwellToGL
|
||||
|
Loading…
Reference in New Issue
Block a user