nvk: SET_PS_{REGISTER,WARP}_WATERMARKS

Brings Baldur's Gate 3 from 32 to 35 fps on the character creator. (+9%)
Brings Horizon Zero Dawn from 7098 to 7872 points in its bencmark. (+11%)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34161>
This commit is contained in:
Mel Henning
2025-03-17 19:41:27 -04:00
committed by Marge Bot
parent 39d2a1e773
commit f2aac0f96a
+15
View File
@@ -516,6 +516,21 @@ nvk_push_draw_state_init(struct nvk_queue *queue, struct nv_push *p)
P_NV9097_SET_VERTEX_STREAM_SUBSTITUTE_A(p, zero_addr >> 32);
P_NV9097_SET_VERTEX_STREAM_SUBSTITUTE_B(p, zero_addr);
if (pdev->info.cls_eng3d >= VOLTA_A) {
/* These WATERMARK settings are based on what the blob sets. I'm guessing
* these are thresholds for balancing PS vs VS shaders but I'm not sure.
* We could do this on older cards if we knew what values to set.
*/
P_IMMD(p, NV9097, SET_PS_WARP_WATERMARKS, {
.low = 0x8,
.high = pdev->info.max_warps_per_mp * pdev->info.mp_per_tpc,
});
P_IMMD(p, NV9097, SET_PS_REGISTER_WATERMARKS, {
.low = 0x80,
.high = 0x1000,
});
}
P_MTHD(p, NV9097, SET_MME_SHADOW_SCRATCH(NVK_MME_SCRATCH_VB_ENABLES));
P_NV9097_SET_MME_SHADOW_SCRATCH(p, NVK_MME_SCRATCH_VB_ENABLES, 0);
for (uint32_t b = 0; b < 32; b++) {