summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-03-27 02:09:01 +0200
committerbunnei <bunneidev@gmail.com>2018-03-27 03:17:03 +0200
commit67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743 (patch)
treee0f68a2ecce868f25c1f4c7e498f5217e9beaa4a /src
parentgraphics_surface: Fix merge conflicts. (diff)
downloadyuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.tar
yuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.tar.gz
yuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.tar.bz2
yuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.tar.lz
yuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.tar.xz
yuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.tar.zst
yuzu-67bc2f5ecd325d8d23d6d3d1ac979c8c78fdd743.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/renderer_opengl/gl_rasterizer.cpp13
-rw-r--r--src/video_core/renderer_opengl/maxwell_to_gl.h10
2 files changed, 12 insertions, 11 deletions
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp
index c4abbb2cd..487d37a26 100644
--- a/src/video_core/renderer_opengl/gl_rasterizer.cpp
+++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp
@@ -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
diff --git a/src/video_core/renderer_opengl/maxwell_to_gl.h b/src/video_core/renderer_opengl/maxwell_to_gl.h
index 003ee2fd9..d847317ac 100644
--- a/src/video_core/renderer_opengl/maxwell_to_gl.h
+++ b/src/video_core/renderer_opengl/maxwell_to_gl.h
@@ -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