From e25167d2bc648f9eb01bc264afa0b8fa8160d4cb Mon Sep 17 00:00:00 2001 From: Triang3l Date: Sun, 12 Dec 2021 18:28:02 +0300 Subject: [PATCH] [GPU] Fix quads>triangles cvar, primitive type test cases --- src/xenia/gpu/primitive_processor.cc | 2 +- src/xenia/gpu/primitive_processor.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/xenia/gpu/primitive_processor.cc b/src/xenia/gpu/primitive_processor.cc index 12ba9cbe5..8dbe1ead3 100644 --- a/src/xenia/gpu/primitive_processor.cc +++ b/src/xenia/gpu/primitive_processor.cc @@ -331,7 +331,7 @@ bool PrimitiveProcessor::Process(ProcessingResult& result_out) { break; case xenos::PrimitiveType::kQuadList: if (convert_quad_lists_to_triangle_lists_) { - host_primitive_type = xenos::PrimitiveType::kQuadList; + host_primitive_type = xenos::PrimitiveType::kTriangleList; } break; default: diff --git a/src/xenia/gpu/primitive_processor.h b/src/xenia/gpu/primitive_processor.h index bfd17caf1..b0a6713be 100644 --- a/src/xenia/gpu/primitive_processor.h +++ b/src/xenia/gpu/primitive_processor.h @@ -509,6 +509,14 @@ class PrimitiveProcessor { } }; + // Triangle fan test cases: + // - 4D5307E6 - main menu - game logo, developer logo, backgrounds of the menu + // item list (the whole menu and individual items) - no index buffer. + // - 4E4D87E6 - terrain - with an index buffer and primitive reset (note that + // there, vfetch indices are computed in the vertex shader, involving + // floating-point reciprocal, so this case is very sensitive to rounding, + // and incorrect geometry may occur not because of vertex grouping issues, + // but also due to the behavior of the vertex shader). // Triangle fans as triangle lists. // Ordered as (v1, v2, v0), (v2, v3, v0) in Direct3D. // https://docs.microsoft.com/en-us/windows/desktop/direct3d9/triangle-fans @@ -565,6 +573,8 @@ class PrimitiveProcessor { uint32_t source_index_count, const PassthroughIndexTransform& index_transform); + // Quad list test cases: + // - 4D5307E6 - main menu - flying dust on the road - no index buffer. static constexpr uint32_t GetQuadListTriangleListIndexCount( uint32_t quad_list_index_count) { return (quad_list_index_count / 4) * 6;