mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 06:40:11 +01:00
pco: add render target awareness to input attachments
Signed-off-by: Simon Perretta <simon.perretta@imgtec.com> Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36412>
This commit is contained in:
parent
f4bc938a4d
commit
ea917ae732
1 changed files with 27 additions and 0 deletions
|
|
@ -1056,6 +1056,33 @@ static nir_def *lower_image(nir_builder *b, nir_instr *instr, void *cb_data)
|
|||
if (coords)
|
||||
coords = nir_trim_vector(b, coords, num_coord_comps);
|
||||
|
||||
if (ia) {
|
||||
nir_variable *pos = nir_get_variable_with_location(b->shader,
|
||||
nir_var_shader_in,
|
||||
VARYING_SLOT_POS,
|
||||
glsl_vec4_type());
|
||||
pos->data.interpolation = INTERP_MODE_NOPERSPECTIVE;
|
||||
|
||||
nir_def *frag_coords = nir_load_input(b,
|
||||
2,
|
||||
32,
|
||||
nir_imm_int(b, 0),
|
||||
.dest_type = nir_type_float32,
|
||||
.io_semantics = (nir_io_semantics){
|
||||
.location = VARYING_SLOT_POS,
|
||||
.num_slots = 1,
|
||||
});
|
||||
|
||||
frag_coords = nir_f2i32(b, frag_coords);
|
||||
coords = nir_iadd(b, frag_coords, coords);
|
||||
|
||||
nir_def *layer = nir_load_layer_id(b); /* TODO: view id for multiview? */
|
||||
|
||||
coords = nir_pad_vector(b, coords, 3);
|
||||
coords = nir_vector_insert_imm(b, coords, layer, 2);
|
||||
is_array = true;
|
||||
}
|
||||
|
||||
nir_def *float_coords;
|
||||
nir_def *int_coords;
|
||||
nir_def *float_array_index;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue