Merge pull request #1981 from CookiePLMonster/fix-ivb-zeroing

Actually zero g_InlineVertexBuffer_Table[0]
This commit is contained in:
Luke Usher 2020-10-09 21:22:41 +01:00 committed by GitHub
commit a380927fba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -4576,7 +4576,7 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_SetVertexData4f)
// Is this the initial call after D3DDevice_Begin() ?
if (g_InlineVertexBuffer_FVF == 0) {
// Set first vertex to zero (preventing leaks from prior Begin/End calls)
g_InlineVertexBuffer_Table[0] = {};
memset(&g_InlineVertexBuffer_Table[0], 0, sizeof(g_InlineVertexBuffer_Table[0]));
// Handle persistent vertex attribute flags, by resetting non-persistent colors
// to their default value (and leaving the persistent colors alone - see the
@ -4649,7 +4649,7 @@ xbox::void_xt WINAPI xbox::EMUPATCH(D3DDevice_SetVertexData4f)
// Start a new vertex
g_InlineVertexBuffer_TableOffset++;
// Copy all attributes of the previous vertex (if any) to the new vertex
g_InlineVertexBuffer_Table[g_InlineVertexBuffer_TableOffset] = g_InlineVertexBuffer_Table[o];
memcpy(&g_InlineVertexBuffer_Table[g_InlineVertexBuffer_TableOffset], &g_InlineVertexBuffer_Table[o], sizeof(g_InlineVertexBuffer_Table[o]));
break;
}