mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-27 14:10:25 +01:00
nak: Use suld.constant when ACCESS_CAN_REORDER is set
This is way faster than suld.sys, which is what we're using today. So far I haven't seen it matter for anything but texel buffers but it likely helps some app somewhere. Backport-to: 25.0 Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33612>
This commit is contained in:
parent
5762586c6d
commit
ffdc0d8e98
1 changed files with 20 additions and 2 deletions
|
|
@ -2338,6 +2338,15 @@ impl<'a> ShaderFromNir<'a> {
|
|||
let coord = self.get_image_coord(intrin, dim);
|
||||
// let sample = self.get_src(&srcs[2]);
|
||||
|
||||
let mem_order = if intrin.intrinsic
|
||||
== nir_intrinsic_load_global_constant
|
||||
|| (intrin.access() & ACCESS_CAN_REORDER) != 0
|
||||
{
|
||||
MemOrder::Constant
|
||||
} else {
|
||||
MemOrder::Strong(MemScope::System)
|
||||
};
|
||||
|
||||
let comps = intrin.num_components;
|
||||
assert!(intrin.def.bit_size() == 32);
|
||||
assert!(comps == 1 || comps == 2 || comps == 4);
|
||||
|
|
@ -2348,7 +2357,7 @@ impl<'a> ShaderFromNir<'a> {
|
|||
dst: dst.into(),
|
||||
fault: Dst::None,
|
||||
image_dim: dim,
|
||||
mem_order: MemOrder::Strong(MemScope::System),
|
||||
mem_order,
|
||||
mem_eviction_priority: self
|
||||
.get_eviction_priority(intrin.access()),
|
||||
mask: (1 << comps) - 1,
|
||||
|
|
@ -2363,6 +2372,15 @@ impl<'a> ShaderFromNir<'a> {
|
|||
let coord = self.get_image_coord(intrin, dim);
|
||||
// let sample = self.get_src(&srcs[2]);
|
||||
|
||||
let mem_order = if intrin.intrinsic
|
||||
== nir_intrinsic_load_global_constant
|
||||
|| (intrin.access() & ACCESS_CAN_REORDER) != 0
|
||||
{
|
||||
MemOrder::Constant
|
||||
} else {
|
||||
MemOrder::Strong(MemScope::System)
|
||||
};
|
||||
|
||||
let comps = intrin.num_components;
|
||||
assert!(intrin.def.bit_size() == 32);
|
||||
assert!(comps == 5);
|
||||
|
|
@ -2374,7 +2392,7 @@ impl<'a> ShaderFromNir<'a> {
|
|||
dst: dst.into(),
|
||||
fault: fault.into(),
|
||||
image_dim: dim,
|
||||
mem_order: MemOrder::Strong(MemScope::System),
|
||||
mem_order,
|
||||
mem_eviction_priority: self
|
||||
.get_eviction_priority(intrin.access()),
|
||||
mask: (1 << (comps - 1)) - 1,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue