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
@@ -291,10 +291,6 @@ static void HwCtxIgnoreAaMaskRegister([[maybe_unused]] uint32_t cmd_offset,
static void HwCtxIgnoreAlphaToMaskRegister([[maybe_unused]] uint32_t value) {}
static void HwCtxIgnoreDisabledUserClipPlane(CommandProcessor& cp, uint32_t value) {
EXIT_NOT_IMPLEMENTED(value != 0 || cp.GetCtx().GetClipControl().user_clip_planes != 0);
}
static void HwCtxIgnorePrimitiveIdReset([[maybe_unused]] uint32_t value) {}
static void HwCtxIgnoreVtxControl([[maybe_unused]] uint32_t value) {}
@@ -2899,7 +2895,7 @@ void GraphicsInitJmpTablesCxIndirect() {
for (auto cmd_offset = Pm4::PA_CL_UCP_0_X; cmd_offset <= Pm4::PA_CL_UCP_5_W; cmd_offset++) {
g_hw_ctx_indirect_func[cmd_offset] = [](KYTY_HW_CTX_INDIRECT_ARGS) {
HwCtxIgnoreDisabledUserClipPlane(cp, value);
cp.GetCtx().SetUserClipPlane(cmd_offset - Pm4::PA_CL_UCP_0_X, value);
};
}
+9
View File
@@ -5,6 +5,8 @@
#include "common/common.h"
#include "graphics/guest_gpu/gpu_defs.h"
#include <array>
namespace Libs::Graphics::HW {
struct ColorBase {
@@ -824,6 +826,11 @@ public:
void SetBlendColor(const BlendColor& color) { m_blend_color = color; }
[[nodiscard]] const ClipControl& GetClipControl() const { return m_clip_control; }
void SetClipControl(const ClipControl& control) { m_clip_control = control; }
// PA_CL_UCP_0_X..PA_CL_UCP_5_W as raw float bits, four per plane.
[[nodiscard]] const std::array<uint32_t, 24>& GetUserClipPlanes() const {
return m_user_clip_planes;
}
void SetUserClipPlane(uint32_t index, uint32_t value) { m_user_clip_planes[index] = value; }
[[nodiscard]] const RenderControl& GetRenderControl() const { return m_render_control; }
void SetRenderControl(const RenderControl& control) { m_render_control = control; }
[[nodiscard]] const DepthRenderOverride& GetDepthRenderOverride() const {
@@ -924,6 +931,8 @@ private:
ColorControl m_color_control;
ScanModeControl m_scan_mode_control;
std::array<uint32_t, 24> m_user_clip_planes {};
AaSampleControl m_aa_sample_control;
AaConfig m_aa_config;