mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
nvk: Handle pre-Turing dispatch indirect commands
The QMD layout is a bit different. Fixes:976f22a5da("nvk: Implement CmdProcess/ExecuteGeneratedCommandsEXT") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33771> (cherry picked from commit7e12ba8709)
This commit is contained in:
parent
95d0ecd6e5
commit
29ae40e1aa
2 changed files with 23 additions and 9 deletions
|
|
@ -324,7 +324,7 @@
|
||||||
"description": "nvk: Handle pre-Turing dispatch indirect commands",
|
"description": "nvk: Handle pre-Turing dispatch indirect commands",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 2,
|
"nomination_type": 2,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "976f22a5da30c503b05e2873e4d265fb0d4ecb07",
|
"because_sha": "976f22a5da30c503b05e2873e4d265fb0d4ecb07",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -355,19 +355,33 @@ build_process_cs_cmd_seq(nir_builder *b, struct nvk_nir_push *p,
|
||||||
const struct nak_qmd_dispatch_size_layout qmd_layout =
|
const struct nak_qmd_dispatch_size_layout qmd_layout =
|
||||||
nak_get_qmd_dispatch_size_layout(&pdev->info);
|
nak_get_qmd_dispatch_size_layout(&pdev->info);
|
||||||
assert(qmd_layout.x_start % 32 == 0);
|
assert(qmd_layout.x_start % 32 == 0);
|
||||||
|
assert(qmd_layout.x_end == qmd_layout.x_start + 32);
|
||||||
assert(qmd_layout.y_start == qmd_layout.x_start + 32);
|
assert(qmd_layout.y_start == qmd_layout.x_start + 32);
|
||||||
assert(qmd_layout.z_start == qmd_layout.x_start + 64);
|
|
||||||
|
|
||||||
nir_def *qmd_repl[sizeof(struct nvk_ies_cs_qmd) / 4] = {};
|
nir_def *qmd_repl[sizeof(struct nvk_ies_cs_qmd) / 4] = {};
|
||||||
qmd_repl[qmd_layout.x_start / 32] = disp_size_x;
|
qmd_repl[qmd_layout.x_start / 32] = disp_size_x;
|
||||||
qmd_repl[qmd_layout.y_start / 32] = disp_size_y;
|
|
||||||
qmd_repl[qmd_layout.z_start / 32] = disp_size_z;
|
|
||||||
|
|
||||||
/* TODO: Get these from NAK? */
|
if (qmd_layout.z_start == qmd_layout.y_start + 32) {
|
||||||
const uint32_t cb0_lo_start = 1024, cb0_hi_start = 1056;
|
qmd_repl[qmd_layout.y_start / 32] = disp_size_y;
|
||||||
qmd_repl[cb0_lo_start / 32] = nir_unpack_64_2x32_split_x(b, root_addr);
|
qmd_repl[qmd_layout.z_start / 32] = disp_size_z;
|
||||||
qmd_repl[cb0_hi_start / 32] =
|
} else {
|
||||||
nir_ior(b, load_global_dw(b, shader_qmd_addr, cb0_hi_start / 32),
|
assert(qmd_layout.y_end == qmd_layout.y_start + 16);
|
||||||
|
assert(qmd_layout.z_start == qmd_layout.x_start + 48);
|
||||||
|
assert(qmd_layout.z_end == qmd_layout.z_start + 16);
|
||||||
|
qmd_repl[qmd_layout.y_start / 32] =
|
||||||
|
nir_pack_32_2x16_split(b, nir_u2u16(b, disp_size_y),
|
||||||
|
nir_u2u16(b, disp_size_z));
|
||||||
|
}
|
||||||
|
|
||||||
|
struct nak_qmd_cbuf_desc_layout cb0_layout =
|
||||||
|
nak_get_qmd_cbuf_desc_layout(&pdev->info, 0);
|
||||||
|
assert(cb0_layout.addr_lo_start % 32 == 0);
|
||||||
|
assert(cb0_layout.addr_hi_start == cb0_layout.addr_lo_start + 32);
|
||||||
|
const uint32_t cb0_addr_lo_dw = cb0_layout.addr_lo_start / 32;
|
||||||
|
const uint32_t cb0_addr_hi_dw = cb0_layout.addr_hi_start / 32;
|
||||||
|
qmd_repl[cb0_addr_lo_dw] = nir_unpack_64_2x32_split_x(b, root_addr);
|
||||||
|
qmd_repl[cb0_addr_hi_dw] =
|
||||||
|
nir_ior(b, load_global_dw(b, shader_qmd_addr, cb0_addr_hi_dw),
|
||||||
nir_unpack_64_2x32_split_y(b, root_addr));
|
nir_unpack_64_2x32_split_y(b, root_addr));
|
||||||
|
|
||||||
copy_repl_global_dw(b, qmd_addr, shader_qmd_addr,
|
copy_repl_global_dw(b, qmd_addr, shader_qmd_addr,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue