rusticl: skip lowering image/sampler derefs if drivers tells so
Signed-off-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
This commit is contained in:
@@ -742,6 +742,14 @@ impl Device {
|
||||
self.screen.param(pipe_cap::PIPE_CAP_SHAREABLE_SHADERS) == 1
|
||||
}
|
||||
|
||||
pub fn images_as_deref(&self) -> bool {
|
||||
self.screen.param(pipe_cap::PIPE_CAP_NIR_IMAGES_AS_DEREF) == 1
|
||||
}
|
||||
|
||||
pub fn samplers_as_deref(&self) -> bool {
|
||||
self.screen.param(pipe_cap::PIPE_CAP_NIR_SAMPLERS_AS_DEREF) == 1
|
||||
}
|
||||
|
||||
pub fn helper_ctx(&self) -> impl HelperContextWrapper + '_ {
|
||||
HelperContext {
|
||||
lock: self.helper_ctx.lock().unwrap(),
|
||||
|
||||
@@ -534,7 +534,11 @@ fn lower_and_optimize_nir_late(
|
||||
}
|
||||
|
||||
nir.pass1(nir_lower_readonly_images_to_tex, true);
|
||||
nir.pass2(nir_lower_cl_images, true, true);
|
||||
nir.pass2(
|
||||
nir_lower_cl_images,
|
||||
!dev.images_as_deref(),
|
||||
!dev.samplers_as_deref(),
|
||||
);
|
||||
|
||||
nir.reset_scratch_size();
|
||||
nir.pass2(
|
||||
|
||||
Reference in New Issue
Block a user