From d920ffdcad86bf43d1e0aaef3cff92179d5bb417 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 10 Apr 2016 13:11:55 -0700 Subject: [PATCH] Ignore upper bits of prim type. This matches tests on what hardware does. --- GPU/Directx9/GPU_DX9.cpp | 3 ++- GPU/GLES/GPU_GLES.cpp | 3 ++- GPU/Vulkan/GPU_Vulkan.cpp | 3 ++- Windows/GEDebugger/VertexPreview.cpp | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/GPU/Directx9/GPU_DX9.cpp b/GPU/Directx9/GPU_DX9.cpp index be499769ca..7cb0d66143 100644 --- a/GPU/Directx9/GPU_DX9.cpp +++ b/GPU/Directx9/GPU_DX9.cpp @@ -776,7 +776,8 @@ void GPU_DX9::Execute_Prim(u32 op, u32 diff) { u32 data = op & 0xFFFFFF; u32 count = data & 0xFFFF; - GEPrimitiveType prim = static_cast(data >> 16); + // Upper bits are ignored. + GEPrimitiveType prim = static_cast((data >> 16) & 7); if (count == 0) return; diff --git a/GPU/GLES/GPU_GLES.cpp b/GPU/GLES/GPU_GLES.cpp index e70db2434b..8e4b064767 100644 --- a/GPU/GLES/GPU_GLES.cpp +++ b/GPU/GLES/GPU_GLES.cpp @@ -948,7 +948,8 @@ void GPU_GLES::Execute_Prim(u32 op, u32 diff) { u32 data = op & 0xFFFFFF; u32 count = data & 0xFFFF; - GEPrimitiveType prim = static_cast(data >> 16); + // Upper bits are ignored. + GEPrimitiveType prim = static_cast((data >> 16) & 7); if (count == 0) return; diff --git a/GPU/Vulkan/GPU_Vulkan.cpp b/GPU/Vulkan/GPU_Vulkan.cpp index b5aa4109e7..9e5a1f6c33 100644 --- a/GPU/Vulkan/GPU_Vulkan.cpp +++ b/GPU/Vulkan/GPU_Vulkan.cpp @@ -822,7 +822,8 @@ void GPU_Vulkan::Execute_Prim(u32 op, u32 diff) { u32 data = op & 0xFFFFFF; u32 count = data & 0xFFFF; - GEPrimitiveType prim = static_cast(data >> 16); + // Upper bits are ignored. + GEPrimitiveType prim = static_cast((data >> 16) & 7); if (count == 0) return; diff --git a/Windows/GEDebugger/VertexPreview.cpp b/Windows/GEDebugger/VertexPreview.cpp index bb18f0f68b..9fb8864ff3 100644 --- a/Windows/GEDebugger/VertexPreview.cpp +++ b/Windows/GEDebugger/VertexPreview.cpp @@ -152,7 +152,7 @@ static void ExpandRectangles(std::vector &vertices, std::vector< } void CGEDebugger::UpdatePrimPreview(u32 op) { - const u32 prim_type = (op >> 16) & 0xFF; + const u32 prim_type = (op >> 16) & 0x7; int count = op & 0xFFFF; if (prim_type >= 7) { ERROR_LOG(COMMON, "Unsupported prim type: %x", op);