mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-31 19:55:38 +00:00
GPU: Polyline must have at least two vertices
Fixes GPU stream corruption in Lifeforce Tenka.
This commit is contained in:
parent
eaf13a1461
commit
6bc91f2157
|
@ -252,10 +252,11 @@ bool GPU::HandleRenderCommand(const u32*& command_ptr, u32 command_size)
|
||||||
words_per_vertex = 1 + BoolToUInt8(rc.shading_enable);
|
words_per_vertex = 1 + BoolToUInt8(rc.shading_enable);
|
||||||
if (rc.polyline)
|
if (rc.polyline)
|
||||||
{
|
{
|
||||||
// polyline goes until we hit the termination code
|
// polyline must have at least two vertices, and the terminator is (word & 0xf000f000) == 0x50005000. terminator
|
||||||
num_vertices = 1;
|
// is on the first word for the vertex
|
||||||
|
num_vertices = 2;
|
||||||
bool found_terminator = false;
|
bool found_terminator = false;
|
||||||
for (u32 pos = 2; pos < command_size; pos += words_per_vertex)
|
for (u32 pos = words_per_vertex * 2; pos < command_size; pos += words_per_vertex)
|
||||||
{
|
{
|
||||||
if ((command_ptr[pos] & UINT32_C(0xF000F000)) == UINT32_C(0x50005000))
|
if ((command_ptr[pos] & UINT32_C(0xF000F000)) == UINT32_C(0x50005000))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue