mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 19:58:09 +02:00
radv: split uploading push constants with DGC in two parts
The first part is for copying "normal" push constant values to the upload space in the preprocess buffer. The second part is only for updating the push constants set for DGC. This will allow us to remove using the pipeline layout in the DGC shader. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36777>
This commit is contained in:
parent
3e0d4a1df1
commit
b527a4f23e
1 changed files with 22 additions and 6 deletions
|
|
@ -1669,22 +1669,38 @@ dgc_alloc_push_constant(struct dgc_cmdbuf *cs, nir_def *stream_addr, nir_def *se
|
|||
VK_FROM_HANDLE(radv_pipeline_layout, pipeline_layout, layout->vk.layout);
|
||||
nir_builder *b = cs->b;
|
||||
|
||||
nir_def *upload_offset_pc = nir_load_var(b, cs->upload_offset);
|
||||
|
||||
/* Store push constants set by the command buffer. */
|
||||
for (uint32_t i = 0; i < pipeline_layout->push_constant_size / 4; i++) {
|
||||
if (layout->push_constant_mask & (1ull << i))
|
||||
continue;
|
||||
|
||||
nir_def *va = load_param64(b, params_addr);
|
||||
nir_def *data =
|
||||
nir_build_load_global(b, 1, 32, nir_iadd(b, va, nir_u2u64(b, nir_iadd_imm(b, params->const_offset, i * 4))));
|
||||
|
||||
nir_def *offset = nir_iadd_imm(b, upload_offset_pc, i * 4);
|
||||
nir_build_store_global(b, data, nir_iadd(b, cs->va, nir_u2u64(b, offset)), .access = ACCESS_NON_READABLE);
|
||||
}
|
||||
|
||||
/* Store push constants set by DGC tokens. */
|
||||
u_foreach_bit64 (i, layout->push_constant_mask) {
|
||||
nir_def *data;
|
||||
|
||||
if (layout->sequence_index_mask & (1ull << i)) {
|
||||
data = sequence_id;
|
||||
} else if ((layout->push_constant_mask & (1ull << i))) {
|
||||
} else {
|
||||
data = nir_build_load_global(b, 1, 32, nir_iadd_imm(b, stream_addr, layout->push_constant_offsets[i]),
|
||||
.access = ACCESS_NON_WRITEABLE);
|
||||
} else {
|
||||
nir_def *va = load_param64(b, params_addr);
|
||||
data = nir_build_load_global(b, 1, 32,
|
||||
nir_iadd(b, va, nir_u2u64(b, nir_iadd_imm(b, params->const_offset, i * 4))));
|
||||
}
|
||||
|
||||
dgc_upload(cs, data);
|
||||
nir_def *offset = nir_iadd_imm(b, upload_offset_pc, i * 4);
|
||||
nir_build_store_global(b, data, nir_iadd(b, cs->va, nir_u2u64(b, offset)), .access = ACCESS_NON_READABLE);
|
||||
}
|
||||
|
||||
nir_store_var(b, cs->upload_offset,
|
||||
nir_iadd_imm(b, nir_load_var(b, cs->upload_offset), pipeline_layout->push_constant_size), 0x1);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue