mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 04:30:10 +01:00
nak: wire up sparse image loads
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26719>
This commit is contained in:
parent
b17f139281
commit
410de4bf69
2 changed files with 34 additions and 0 deletions
|
|
@ -2042,6 +2042,39 @@ impl<'a> ShaderFromNir<'a> {
|
|||
});
|
||||
self.set_dst(&intrin.def, dst);
|
||||
}
|
||||
nir_intrinsic_bindless_image_sparse_load => {
|
||||
let handle = self.get_src(&srcs[0]);
|
||||
let dim = self.get_image_dim(intrin);
|
||||
let coord = self.get_image_coord(intrin, dim);
|
||||
// let sample = self.get_src(&srcs[2]);
|
||||
|
||||
let comps = intrin.num_components;
|
||||
assert!(intrin.def.bit_size() == 32);
|
||||
assert!(comps == 5);
|
||||
|
||||
let dst = b.alloc_ssa(RegFile::GPR, comps - 1);
|
||||
let fault = b.alloc_ssa(RegFile::Pred, 1);
|
||||
|
||||
b.push_op(OpSuLd {
|
||||
dst: dst.into(),
|
||||
fault: fault.into(),
|
||||
image_dim: dim,
|
||||
mem_order: MemOrder::Strong(MemScope::System),
|
||||
mem_eviction_priority: self
|
||||
.get_eviction_priority(intrin.access()),
|
||||
mask: (1 << (comps - 1)) - 1,
|
||||
handle: handle,
|
||||
coord: coord,
|
||||
});
|
||||
|
||||
let mut final_dst = Vec::new();
|
||||
for i in 0..usize::from(comps) - 1 {
|
||||
final_dst.push(dst[i]);
|
||||
}
|
||||
final_dst.push(b.sel(fault.into(), 0.into(), 1.into())[0]);
|
||||
|
||||
self.set_ssa(&intrin.def, final_dst);
|
||||
}
|
||||
nir_intrinsic_bindless_image_store => {
|
||||
let handle = self.get_src(&srcs[0]);
|
||||
let dim = self.get_image_dim(intrin);
|
||||
|
|
|
|||
|
|
@ -895,6 +895,7 @@ try_lower_intrin(nir_builder *b, nir_intrinsic_instr *intrin,
|
|||
return lower_sysval_to_root_table(b, intrin, draw.view_index, ctx);
|
||||
|
||||
case nir_intrinsic_image_deref_load:
|
||||
case nir_intrinsic_image_deref_sparse_load:
|
||||
case nir_intrinsic_image_deref_store:
|
||||
case nir_intrinsic_image_deref_atomic:
|
||||
case nir_intrinsic_image_deref_atomic_swap:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue