mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-12-25 19:02:45 -06:00
Implement vertex array first and subsequent draws
This commit is contained in:
parent
a8bd02acd8
commit
32ad99701d
2 changed files with 25 additions and 1 deletions
|
@ -48,8 +48,14 @@ void DrawManager::ProcessMethodCall(u32 method, u32 argument) {
|
||||||
SetInlineIndexBuffer(regs.inline_index_4x8.index3);
|
SetInlineIndexBuffer(regs.inline_index_4x8.index3);
|
||||||
break;
|
break;
|
||||||
case MAXWELL3D_REG_INDEX(vertex_array_instance_first):
|
case MAXWELL3D_REG_INDEX(vertex_array_instance_first):
|
||||||
|
DrawArrayInstanced(regs.vertex_array_instance_first.topology.Value(),
|
||||||
|
regs.vertex_array_instance_first.start.Value(),
|
||||||
|
regs.vertex_array_instance_first.count.Value(), false);
|
||||||
|
break;
|
||||||
case MAXWELL3D_REG_INDEX(vertex_array_instance_subsequent): {
|
case MAXWELL3D_REG_INDEX(vertex_array_instance_subsequent): {
|
||||||
LOG_WARNING(HW_GPU, "(STUBBED) called");
|
DrawArrayInstanced(regs.vertex_array_instance_subsequent.topology.Value(),
|
||||||
|
regs.vertex_array_instance_subsequent.start.Value(),
|
||||||
|
regs.vertex_array_instance_subsequent.count.Value(), true);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case MAXWELL3D_REG_INDEX(draw_texture.src_y0): {
|
case MAXWELL3D_REG_INDEX(draw_texture.src_y0): {
|
||||||
|
@ -84,6 +90,22 @@ void DrawManager::DrawArray(PrimitiveTopology topology, u32 vertex_first, u32 ve
|
||||||
ProcessDraw(false, num_instances);
|
ProcessDraw(false, num_instances);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DrawManager::DrawArrayInstanced(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count,
|
||||||
|
bool subsequent) {
|
||||||
|
draw_state.topology = topology;
|
||||||
|
draw_state.vertex_buffer.first = vertex_first;
|
||||||
|
draw_state.vertex_buffer.count = vertex_count;
|
||||||
|
|
||||||
|
if (!subsequent) {
|
||||||
|
draw_state.instance_count = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
draw_state.base_instance = draw_state.instance_count - 1;
|
||||||
|
draw_state.draw_mode = DrawMode::Instance;
|
||||||
|
draw_state.instance_count++;
|
||||||
|
ProcessDraw(false, 1);
|
||||||
|
}
|
||||||
|
|
||||||
void DrawManager::DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count,
|
void DrawManager::DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count,
|
||||||
u32 base_index, u32 base_instance, u32 num_instances) {
|
u32 base_index, u32 base_instance, u32 num_instances) {
|
||||||
const auto& regs{maxwell3d->regs};
|
const auto& regs{maxwell3d->regs};
|
||||||
|
|
|
@ -66,6 +66,8 @@ public:
|
||||||
|
|
||||||
void DrawArray(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count,
|
void DrawArray(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count,
|
||||||
u32 base_instance, u32 num_instances);
|
u32 base_instance, u32 num_instances);
|
||||||
|
void DrawArrayInstanced(PrimitiveTopology topology, u32 vertex_first, u32 vertex_count,
|
||||||
|
bool subsequent);
|
||||||
|
|
||||||
void DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index,
|
void DrawIndex(PrimitiveTopology topology, u32 index_first, u32 index_count, u32 base_index,
|
||||||
u32 base_instance, u32 num_instances);
|
u32 base_instance, u32 num_instances);
|
||||||
|
|
Loading…
Reference in a new issue