diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/engines/maxwell_3d.h | 7 | ||||
| -rw-r--r-- | src/video_core/renderer_opengl/gl_rasterizer.cpp | 16 |
2 files changed, 15 insertions, 8 deletions
diff --git a/src/video_core/engines/maxwell_3d.h b/src/video_core/engines/maxwell_3d.h index 180be4ff4..58db81222 100644 --- a/src/video_core/engines/maxwell_3d.h +++ b/src/video_core/engines/maxwell_3d.h | |||
| @@ -455,7 +455,11 @@ public: | |||
| 455 | u32 enable[NumRenderTargets]; | 455 | u32 enable[NumRenderTargets]; |
| 456 | } blend; | 456 | } blend; |
| 457 | 457 | ||
| 458 | INSERT_PADDING_WORDS(0x77); | 458 | INSERT_PADDING_WORDS(0x2D); |
| 459 | |||
| 460 | u32 vb_element_base; | ||
| 461 | |||
| 462 | INSERT_PADDING_WORDS(0x49); | ||
| 459 | 463 | ||
| 460 | struct { | 464 | struct { |
| 461 | u32 tsc_address_high; | 465 | u32 tsc_address_high; |
| @@ -745,6 +749,7 @@ ASSERT_REG_POSITION(vertex_attrib_format[0], 0x458); | |||
| 745 | ASSERT_REG_POSITION(rt_control, 0x487); | 749 | ASSERT_REG_POSITION(rt_control, 0x487); |
| 746 | ASSERT_REG_POSITION(independent_blend_enable, 0x4B9); | 750 | ASSERT_REG_POSITION(independent_blend_enable, 0x4B9); |
| 747 | ASSERT_REG_POSITION(blend, 0x4CF); | 751 | ASSERT_REG_POSITION(blend, 0x4CF); |
| 752 | ASSERT_REG_POSITION(vb_element_base, 0x50D); | ||
| 748 | ASSERT_REG_POSITION(tsc, 0x557); | 753 | ASSERT_REG_POSITION(tsc, 0x557); |
| 749 | ASSERT_REG_POSITION(tic, 0x55D); | 754 | ASSERT_REG_POSITION(tic, 0x55D); |
| 750 | ASSERT_REG_POSITION(code_address, 0x582); | 755 | ASSERT_REG_POSITION(code_address, 0x582); |
diff --git a/src/video_core/renderer_opengl/gl_rasterizer.cpp b/src/video_core/renderer_opengl/gl_rasterizer.cpp index 45560fbee..324c28d1b 100644 --- a/src/video_core/renderer_opengl/gl_rasterizer.cpp +++ b/src/video_core/renderer_opengl/gl_rasterizer.cpp | |||
| @@ -412,14 +412,16 @@ void RasterizerOpenGL::DrawArrays() { | |||
| 412 | 412 | ||
| 413 | const GLenum primitive_mode{MaxwellToGL::PrimitiveTopology(regs.draw.topology)}; | 413 | const GLenum primitive_mode{MaxwellToGL::PrimitiveTopology(regs.draw.topology)}; |
| 414 | if (is_indexed) { | 414 | if (is_indexed) { |
| 415 | const GLint index_min{static_cast<GLint>(regs.index_array.first)}; | 415 | const GLint base_vertex{static_cast<GLint>(regs.vb_element_base)}; |
| 416 | const GLint index_max{static_cast<GLint>(regs.index_array.first + regs.index_array.count)}; | 416 | |
| 417 | glDrawRangeElementsBaseVertex(primitive_mode, index_min, index_max, regs.index_array.count, | 417 | // Adjust the index buffer offset so it points to the first desired index. |
| 418 | MaxwellToGL::IndexFormat(regs.index_array.format), | 418 | index_buffer_offset += regs.index_array.first * regs.index_array.FormatSizeInBytes(); |
| 419 | reinterpret_cast<const void*>(index_buffer_offset), | 419 | |
| 420 | -index_min); | 420 | glDrawElementsBaseVertex(primitive_mode, regs.index_array.count, |
| 421 | MaxwellToGL::IndexFormat(regs.index_array.format), | ||
| 422 | reinterpret_cast<const void*>(index_buffer_offset), base_vertex); | ||
| 421 | } else { | 423 | } else { |
| 422 | glDrawArrays(primitive_mode, 0, regs.vertex_buffer.count); | 424 | glDrawArrays(primitive_mode, regs.vertex_buffer.first, regs.vertex_buffer.count); |
| 423 | } | 425 | } |
| 424 | 426 | ||
| 425 | // Disable scissor test | 427 | // Disable scissor test |