diff options
| -rw-r--r-- | src/video_core/engines/draw_manager.cpp | 24 | ||||
| -rw-r--r-- | src/video_core/engines/draw_manager.h | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/src/video_core/engines/draw_manager.cpp b/src/video_core/engines/draw_manager.cpp index f34090791..d77ff455b 100644 --- a/src/video_core/engines/draw_manager.cpp +++ b/src/video_core/engines/draw_manager.cpp | |||
| @@ -48,8 +48,14 @@ void DrawManager::ProcessMethodCall(u32 method, u32 argument) { | |||
| 48 | SetInlineIndexBuffer(regs.inline_index_4x8.index3); | 48 | SetInlineIndexBuffer(regs.inline_index_4x8.index3); |
| 49 | break; | 49 | break; |
| 50 | case MAXWELL3D_REG_INDEX(vertex_array_instance_first): | 50 | case MAXWELL3D_REG_INDEX(vertex_array_instance_first): |
| 51 | DrawArrayInstanced(regs.vertex_array_instance_first.topology.Value(), | ||
| 52 | regs.vertex_array_instance_first.start.Value(), | ||
| 53 | regs.vertex_array_instance_first.count.Value(), false); | ||
| 54 | break; | ||
| 51 | case MAXWELL3D_REG_INDEX(vertex_array_instance_subsequent): { | 55 | case MAXWELL3D_REG_INDEX(vertex_array_instance_subsequent): { |
| 52 | LOG_WARNING(HW_GPU, "(STUBBED) called"); | 56 | DrawArrayInstanced(regs.vertex_array_instance_subsequent.topology.Value(), |
| 57 | regs.vertex_array_instance_subsequent.start.Value(), | ||
| 58 | regs.vertex_array_instance_subsequent.count.Value(), true); | ||
| 53 | break; | 59 | break; |
| 54 | } | 60 | } |
| 55 | case MAXWELL3D_REG_INDEX(draw_texture.src_y0): { | 61 | case MAXWELL3D_REG_INDEX(draw_texture.src_y0): { |
| @@ -84,6 +90,22 @@ void DrawManager::DrawArray(PrimitiveTopology topology, u32 vertex_first, u32 ve | |||
| 84 | ProcessDraw(false, num_instances); | 90 | ProcessDraw(false, num_instances); |
| 85 | } | 91 | } |
| 86 | 92 | ||
| 93 | void DrawManager::DrawArrayInstanced(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, | ||
| 94 | bool subsequent) { | ||
| 95 | draw_state.topology = topology; | ||
| 96 | draw_state.vertex_buffer.first = vertex_first; | ||
| 97 | draw_state.vertex_buffer.count = vertex_count; | ||
| 98 | |||
| 99 | if (!subsequent) { | ||
| 100 | draw_state.instance_count = 1; | ||
| 101 | } | ||
| 102 | |||
| 103 | draw_state.base_instance = draw_state.instance_count - 1; | ||
| 104 | draw_state.draw_mode = DrawMode::Instance; | ||
| 105 | draw_state.instance_count++; | ||
| 106 | ProcessDraw(false, 1); | ||
| 107 | } | ||
| 108 | |||
| 87 | void DrawManager::DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count, | 109 | void DrawManager::DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count, |
| 88 | u32 base_index, u32 base_instance, u32 num_instances) { | 110 | u32 base_index, u32 base_instance, u32 num_instances) { |
| 89 | const auto& regs{maxwell3d->regs}; | 111 | const auto& regs{maxwell3d->regs}; |
diff --git a/src/video_core/engines/draw_manager.h b/src/video_core/engines/draw_manager.h index 18d959143..cfc8127fc 100644 --- a/src/video_core/engines/draw_manager.h +++ b/src/video_core/engines/draw_manager.h | |||
| @@ -66,6 +66,8 @@ public: | |||
| 66 | 66 | ||
| 67 | void DrawArray(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, | 67 | void DrawArray(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, |
| 68 | u32 base_instance, u32 num_instances); | 68 | u32 base_instance, u32 num_instances); |
| 69 | void DrawArrayInstanced(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count, | ||
| 70 | bool subsequent); | ||
| 69 | 71 | ||
| 70 | void DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index, | 72 | void DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index, |
| 71 | u32 base_instance, u32 num_instances); | 73 | u32 base_instance, u32 num_instances); |