gpu: implement PA_CL_UCP user clip planes through draw push constants

This commit is contained in:
Mr. Big Britches
2026-10-20 07:00:55 +02:00
committed by nmzik
parent 18e6747dbf
commit feed075a9f
11 changed files with 109 additions and 45 deletions
+8 -1
View File
@@ -356,7 +356,14 @@ struct PushData {
static constexpr uint32_t NoStart = UINT32_MAX;
std::array<uint32_t, DwordCount> dwords {};
[[nodiscard]] static constexpr uint32_t GraphicsDrawDwords(bool mesh, bool object_id) {
// User clip planes 0..N follow the mesh draw parameters or object ID, four dwords each.
static constexpr uint32_t UserClipPlaneDword = MeshDrawDwordCount;
[[nodiscard]] static constexpr uint32_t GraphicsDrawDwords(bool mesh, bool object_id,
uint32_t user_clip_planes = 0) {
if (user_clip_planes != 0) {
return UserClipPlaneDword + 4u * std::bit_width(user_clip_planes);
}
return mesh ? MeshDrawDwordCount : static_cast<uint32_t>(object_id);
}