mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 09:38:07 +02:00
panfrost: Remove load_kernel_input path
Now the state tracker's responsible to lower away for us (and the state tracker can do it correctly, our implementation is incorrect with a strict reading of the Gallium contract). Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18658>
This commit is contained in:
parent
deb3810f1e
commit
847361ba07
3 changed files with 2 additions and 21 deletions
|
|
@ -4199,19 +4199,6 @@ panfrost_launch_grid(struct pipe_context *pipe,
|
|||
struct panfrost_ptr t =
|
||||
pan_pool_alloc_desc(&batch->pool.base, COMPUTE_JOB);
|
||||
|
||||
/* We implement OpenCL inputs as uniforms (or a UBO -- same thing), so
|
||||
* reuse the graphics path for this by lowering to Gallium */
|
||||
|
||||
struct pipe_constant_buffer ubuf = {
|
||||
.buffer = NULL,
|
||||
.buffer_offset = 0,
|
||||
.buffer_size = ctx->shader[PIPE_SHADER_COMPUTE]->req_input_mem,
|
||||
.user_buffer = info->input
|
||||
};
|
||||
|
||||
if (info->input)
|
||||
pipe->set_constant_buffer(pipe, PIPE_SHADER_COMPUTE, 0, false, &ubuf);
|
||||
|
||||
/* Invoke according to the grid info */
|
||||
|
||||
unsigned num_wg[3] = { info->grid[0], info->grid[1], info->grid[2] };
|
||||
|
|
|
|||
|
|
@ -1107,12 +1107,11 @@ bi_emit_load_ubo(bi_builder *b, nir_intrinsic_instr *instr)
|
|||
bool offset_is_const = nir_src_is_const(*offset);
|
||||
bi_index dyn_offset = bi_src_index(offset);
|
||||
uint32_t const_offset = offset_is_const ? nir_src_as_uint(*offset) : 0;
|
||||
bool kernel_input = (instr->intrinsic == nir_intrinsic_load_kernel_input);
|
||||
|
||||
bi_load_ubo_to(b, instr->num_components * nir_dest_bit_size(instr->dest),
|
||||
bi_dest_index(&instr->dest), offset_is_const ?
|
||||
bi_imm_u32(const_offset) : dyn_offset,
|
||||
kernel_input ? bi_zero() : bi_src_index(&instr->src[0]));
|
||||
bi_src_index(&instr->src[0]));
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
@ -1640,7 +1639,6 @@ bi_emit_intrinsic(bi_builder *b, nir_intrinsic_instr *instr)
|
|||
break;
|
||||
|
||||
case nir_intrinsic_load_ubo:
|
||||
case nir_intrinsic_load_kernel_input:
|
||||
bi_emit_load_ubo(b, instr);
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -1814,7 +1814,6 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
|
|||
case nir_intrinsic_load_shared:
|
||||
case nir_intrinsic_load_scratch:
|
||||
case nir_intrinsic_load_input:
|
||||
case nir_intrinsic_load_kernel_input:
|
||||
case nir_intrinsic_load_interpolated_input: {
|
||||
bool is_ubo = instr->intrinsic == nir_intrinsic_load_ubo;
|
||||
bool is_global = instr->intrinsic == nir_intrinsic_load_global ||
|
||||
|
|
@ -1822,7 +1821,6 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
|
|||
bool is_shared = instr->intrinsic == nir_intrinsic_load_shared;
|
||||
bool is_scratch = instr->intrinsic == nir_intrinsic_load_scratch;
|
||||
bool is_flat = instr->intrinsic == nir_intrinsic_load_input;
|
||||
bool is_kernel = instr->intrinsic == nir_intrinsic_load_kernel_input;
|
||||
bool is_interp = instr->intrinsic == nir_intrinsic_load_interpolated_input;
|
||||
|
||||
/* Get the base type of the intrinsic */
|
||||
|
|
@ -1853,9 +1851,7 @@ emit_intrinsic(compiler_context *ctx, nir_intrinsic_instr *instr)
|
|||
nir_intrinsic_component(instr) : 0;
|
||||
reg = nir_dest_index(&instr->dest);
|
||||
|
||||
if (is_kernel) {
|
||||
emit_ubo_read(ctx, &instr->instr, reg, offset, indirect_offset, 0, 0, nr_comp);
|
||||
} else if (is_ubo) {
|
||||
if (is_ubo) {
|
||||
nir_src index = instr->src[0];
|
||||
|
||||
/* TODO: Is indirect block number possible? */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue