mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 08:40:11 +01:00
nak: Allow 1-component image load/store
We get these when we get an atomic image load/store Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24998>
This commit is contained in:
parent
ee11b473b5
commit
8781acba18
1 changed files with 10 additions and 4 deletions
|
|
@ -1445,9 +1445,11 @@ impl<'a> ShaderFromNir<'a> {
|
|||
let coord = self.get_image_coord(intrin, dim);
|
||||
/* let sample = self.get_src(&srcs[2]); */
|
||||
|
||||
let comps = u8::try_from(intrin.num_components).unwrap();
|
||||
assert!(intrin.def.bit_size() == 32);
|
||||
assert!(intrin.def.num_components() == 4);
|
||||
let dst = b.alloc_ssa(RegFile::GPR, 4);
|
||||
assert!(comps == 1 || comps == 4);
|
||||
|
||||
let dst = b.alloc_ssa(RegFile::GPR, comps);
|
||||
|
||||
b.push_op(OpSuLd {
|
||||
dst: dst.into(),
|
||||
|
|
@ -1455,7 +1457,7 @@ impl<'a> ShaderFromNir<'a> {
|
|||
image_dim: dim,
|
||||
mem_order: MemOrder::Weak,
|
||||
mem_scope: MemScope::CTA,
|
||||
mask: 0xf,
|
||||
mask: (1 << comps) - 1,
|
||||
handle: handle,
|
||||
coord: coord,
|
||||
});
|
||||
|
|
@ -1468,11 +1470,15 @@ impl<'a> ShaderFromNir<'a> {
|
|||
/* let sample = self.get_src(&srcs[2]); */
|
||||
let data = self.get_src(&srcs[3]);
|
||||
|
||||
let comps = u8::try_from(intrin.num_components).unwrap();
|
||||
assert!(srcs[3].bit_size() == 32);
|
||||
assert!(comps == 1 || comps == 4);
|
||||
|
||||
b.push_op(OpSuSt {
|
||||
image_dim: dim,
|
||||
mem_order: MemOrder::Weak,
|
||||
mem_scope: MemScope::CTA,
|
||||
mask: 0xf,
|
||||
mask: (1 << comps) - 1,
|
||||
handle: handle,
|
||||
coord: coord,
|
||||
data: data,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue