[PR #1798] [MERGED] renderer_vulkan: add support for Polygon draws #2313

Closed
opened 2026-02-27 21:16:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1798
Author: @polybiusproxy
Created: 12/15/2024
Status: Merged
Merged: 12/21/2024
Merged by: @polybiusproxy

Base: mainHead: poly-idx


📝 Commits (1)

  • 7f1913d renderer_vulkan: add support for Polygon draws

📊 Changes

4 files changed (+43 additions, -10 deletions)

View changed files

📝 src/video_core/buffer_cache/buffer_cache.cpp (+29 -7)
📝 src/video_core/renderer_vulkan/liverpool_to_vk.cpp (+1 -0)
📝 src/video_core/renderer_vulkan/liverpool_to_vk.h (+9 -0)
📝 src/video_core/renderer_vulkan/vk_rasterizer.cpp (+4 -3)

📄 Description

The Polygon primitive type works by having a specified *N* amount of vertices and having the GPU figure out how to fill said primitive—this primitive type is obsolete by now so modern rendering APIs do not support this primitive.

To emulate this, we can use the same approach for quad lists; generate an index buffer on the CPU and draw as triangle lists. Specifically for polygons, we can triangulate these by anchoring the first vertex of the polygon and connecting it with the current and next vertices.

imagen


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1798 **Author:** [@polybiusproxy](https://github.com/polybiusproxy) **Created:** 12/15/2024 **Status:** ✅ Merged **Merged:** 12/21/2024 **Merged by:** [@polybiusproxy](https://github.com/polybiusproxy) **Base:** `main` ← **Head:** `poly-idx` --- ### 📝 Commits (1) - [`7f1913d`](https://github.com/shadps4-emu/shadPS4/commit/7f1913d578c20739445a7a943f0099b77c897e16) renderer_vulkan: add support for Polygon draws ### 📊 Changes **4 files changed** (+43 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `src/video_core/buffer_cache/buffer_cache.cpp` (+29 -7) 📝 `src/video_core/renderer_vulkan/liverpool_to_vk.cpp` (+1 -0) 📝 `src/video_core/renderer_vulkan/liverpool_to_vk.h` (+9 -0) 📝 `src/video_core/renderer_vulkan/vk_rasterizer.cpp` (+4 -3) </details> ### 📄 Description The Polygon primitive type works by having a specified \**N\** amount of vertices and having the GPU figure out how to fill said primitive—this primitive type is obsolete by now so modern rendering APIs do not support this primitive. To emulate this, we can use the same approach for quad lists; generate an index buffer on the CPU and draw as triangle lists. Specifically for polygons, we can triangulate these by anchoring the first vertex of the polygon and connecting it with the current and next vertices. ![imagen](https://github.com/user-attachments/assets/c1455636-712e-4228-be56-d4444a6e6b25) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:16:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2313
No description provided.