From 12a11472f1cdc7a6071c1d161b09b56dab0bed51 Mon Sep 17 00:00:00 2001 From: Subv Date: Sat, 22 Aug 2015 22:09:00 -0500 Subject: GPU: Implemented register 0x22A. This is the equivalent of the "first" parameter in glDrawArrays, it tells the GPU the vertex index at which to start rendering. Register 0x22A doesn't affect indexed rendering. --- src/video_core/command_processor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/video_core/command_processor.cpp') diff --git a/src/video_core/command_processor.cpp b/src/video_core/command_processor.cpp index d82e20f86..bfce080bb 100644 --- a/src/video_core/command_processor.cpp +++ b/src/video_core/command_processor.cpp @@ -231,7 +231,8 @@ static void WritePicaReg(u32 id, u32 value, u32 mask) { for (unsigned int index = 0; index < regs.num_vertices; ++index) { - unsigned int vertex = is_indexed ? (index_u16 ? index_address_16[index] : index_address_8[index]) : index; + // Indexed rendering doesn't use the start offset + unsigned int vertex = is_indexed ? (index_u16 ? index_address_16[index] : index_address_8[index]) : (index + regs.vertex_offset); // -1 is a common special value used for primitive restart. Since it's unknown if // the PICA supports it, and it would mess up the caching, guard against it here. -- cgit v1.2.3