mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-25 07:21:14 +01:00
Merge pull request #1960 from phire/zfreeze-buffer-underrun
Fix a buffer underrun in CalculateZSlope.
This commit is contained in:
commit
a93433a860
@ -287,6 +287,10 @@ void VertexManager::CalculateZSlope(NativeVertexFormat* format)
|
|||||||
size_t posOff = vert_decl.position.offset;
|
size_t posOff = vert_decl.position.offset;
|
||||||
size_t mtxOff = vert_decl.posmtx.offset;
|
size_t mtxOff = vert_decl.posmtx.offset;
|
||||||
|
|
||||||
|
// Make sure the buffer contains at lest 3 vertices.
|
||||||
|
if ((s_pCurBufferPointer - s_pBaseBufferPointer) < (vert_decl.stride * 3))
|
||||||
|
return;
|
||||||
|
|
||||||
// Lookup vertices of the last rendered triangle and software-transform them
|
// Lookup vertices of the last rendered triangle and software-transform them
|
||||||
// This allows us to determine the depth slope, which will be used if z--freeze
|
// This allows us to determine the depth slope, which will be used if z--freeze
|
||||||
// is enabled in the following flush.
|
// is enabled in the following flush.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user