mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 11:40:10 +01:00
brw: Update try_load_push_input to handle dword-unit offsets too
We don't need this case today, but it's trivial to handle. Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38990>
This commit is contained in:
parent
f601aa5ce7
commit
f62f7d80e2
1 changed files with 5 additions and 4 deletions
|
|
@ -345,12 +345,13 @@ try_load_push_input(nir_builder *b,
|
||||||
nir_intrinsic_instr *io,
|
nir_intrinsic_instr *io,
|
||||||
nir_def *offset)
|
nir_def *offset)
|
||||||
{
|
{
|
||||||
if (!nir_def_is_const(offset) || !cb_data->vec4_access)
|
if (!nir_def_is_const(offset))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
const unsigned base = io_base_slot(io, cb_data) +
|
const unsigned offset_unit = cb_data->vec4_access ? 16 : 4;
|
||||||
nir_src_as_uint(nir_src_for_ssa(offset));
|
const uint32_t byte_offset =
|
||||||
const uint32_t byte_offset = 16 * base + 4 * io_component(io, cb_data);
|
16 * io_base_slot(io, cb_data) + 4 * io_component(io, cb_data) +
|
||||||
|
offset_unit * nir_src_as_uint(nir_src_for_ssa(offset));
|
||||||
assert((byte_offset % 4) == 0);
|
assert((byte_offset % 4) == 0);
|
||||||
|
|
||||||
const enum mesa_shader_stage stage = b->shader->info.stage;
|
const enum mesa_shader_stage stage = b->shader->info.stage;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue