mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 20:00:10 +01:00
st/pbo_compute: fix z coords for compute pbos
without manually taking the value from the global_id vec, this will
end up being offset.y again, which breaks z-indexing
Fixes: e7b9561959 ("gallium: implement compute pbo download")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16728>
This commit is contained in:
parent
15f37d8d6f
commit
1c019ee1ba
1 changed files with 12 additions and 3 deletions
|
|
@ -620,10 +620,19 @@ create_conversion_shader(struct st_context *st, enum pipe_texture_target target,
|
|||
nir_ssa_def *iid = nir_load_local_invocation_id(&b);
|
||||
nir_ssa_def *tile = nir_imul(&b, wid, bsize);
|
||||
nir_ssa_def *global_id = nir_iadd(&b, tile, iid);
|
||||
nir_ssa_def *start = nir_iadd(&b, global_id, sd.offset);
|
||||
nir_ssa_def *start = nir_iadd(&b, nir_trim_vector(&b, global_id, 2), sd.offset);
|
||||
|
||||
nir_ssa_def *coord = nir_channels(&b, start, (1<<coord_components)-1);
|
||||
nir_ssa_def *max = nir_iadd(&b, sd.offset, sd.range);
|
||||
nir_ssa_def *coord;
|
||||
if (coord_components < 3)
|
||||
coord = start;
|
||||
else {
|
||||
/* pad offset vec with global_id to get correct z offset */
|
||||
assert(coord_components == 3);
|
||||
coord = nir_vec3(&b, nir_channel(&b, start, 0),
|
||||
nir_channel(&b, start, 1),
|
||||
nir_channel(&b, global_id, 2));
|
||||
}
|
||||
nir_ssa_def *max = nir_iadd(&b, nir_pad_vector_imm_int(&b, sd.offset, 0, 3), sd.range);
|
||||
nir_push_if(&b, nir_ball(&b, nir_ilt(&b, coord, nir_trim_vector(&b, max, coord_components))));
|
||||
nir_tex_instr *txf = nir_tex_instr_create(b.shader, 3);
|
||||
txf->is_array = glsl_sampler_type_is_array(sampler->type);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue