Module: Mesa Branch: main Commit: 7bb131964ba18f6428bacbeb850e940000240fef URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bb131964ba18f6428bacbeb850e940000240fef
Author: Antonio Gomes <antoniospg...@gmail.com> Date: Fri Sep 8 01:22:16 2023 -0300 rusticl/device: Function to check for gl interop support Reviewed-by: Karol Herbst <kher...@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21305> --- src/gallium/frontends/rusticl/core/device.rs | 11 +++++++++++ src/gallium/frontends/rusticl/mesa/pipe/screen.rs | 7 +++++++ 2 files changed, 18 insertions(+) diff --git a/src/gallium/frontends/rusticl/core/device.rs b/src/gallium/frontends/rusticl/core/device.rs index 86596958ea7..f0b95766ff1 100644 --- a/src/gallium/frontends/rusticl/core/device.rs +++ b/src/gallium/frontends/rusticl/core/device.rs @@ -700,6 +700,17 @@ impl Device { self.screen.param(pipe_cap::PIPE_CAP_DOUBLES) == 1 } + pub fn is_gl_sharing_supported(&self) -> bool { + self.screen.param(pipe_cap::PIPE_CAP_DMABUF) != 0 + && !self.is_device_software() + && self.screen.is_res_handle_supported() + && self.screen.device_uuid().is_some() + } + + pub fn is_device_software(&self) -> bool { + self.screen.device_type() == pipe_loader_device_type::PIPE_LOADER_DEVICE_SOFTWARE + } + pub fn get_nir_options(&self) -> nir_shader_compiler_options { unsafe { *self diff --git a/src/gallium/frontends/rusticl/mesa/pipe/screen.rs b/src/gallium/frontends/rusticl/mesa/pipe/screen.rs index c3272f4c321..1c1b442fe35 100644 --- a/src/gallium/frontends/rusticl/mesa/pipe/screen.rs +++ b/src/gallium/frontends/rusticl/mesa/pipe/screen.rs @@ -328,6 +328,13 @@ impl PipeScreen { } } + pub fn is_res_handle_supported(&self) -> bool { + unsafe { + (*self.screen).resource_from_handle.is_some() + && (*self.screen).resource_get_handle.is_some() + } + } + pub fn nir_shader_compiler_options( &self, shader: pipe_shader_type,