Module: Mesa
Branch: main
Commit: bbea8761c221953f953b0bf8b54da51947b3027f
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bbea8761c221953f953b0bf8b54da51947b3027f

Author: Karol Herbst <[email protected]>
Date:   Thu Sep 29 03:03:26 2022 +0200

rusticl/device: fix some device limits

Signed-off-by: Karol Herbst <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20161>

---

 src/gallium/frontends/rusticl/core/device.rs | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/gallium/frontends/rusticl/core/device.rs 
b/src/gallium/frontends/rusticl/core/device.rs
index 99cdce94117..efcb6535625 100644
--- a/src/gallium/frontends/rusticl/core/device.rs
+++ b/src/gallium/frontends/rusticl/core/device.rs
@@ -257,9 +257,9 @@ impl Device {
 
         // CL_DEVICE_MAX_PARAMETER_SIZE
         // For this minimum value, only a maximum of 128 arguments can be 
passed to a kernel
-        if ComputeParam::<u64>::compute_param(
-            screen,
-            pipe_compute_cap::PIPE_COMPUTE_CAP_MAX_INPUT_SIZE,
+        if screen.shader_param(
+            pipe_shader_type::PIPE_SHADER_COMPUTE,
+            pipe_shader_cap::PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE,
         ) < 128
         {
             return false;
@@ -535,8 +535,11 @@ impl Device {
     }
 
     pub fn const_max_size(&self) -> cl_ulong {
-        self.screen
-            .param(pipe_cap::PIPE_CAP_MAX_SHADER_BUFFER_SIZE_UINT) as u64
+        min(
+            self.max_mem_alloc(),
+            self.screen
+                .param(pipe_cap::PIPE_CAP_MAX_SHADER_BUFFER_SIZE_UINT) as u64,
+        )
     }
 
     pub fn device_type(&self, internal: bool) -> cl_device_type {
@@ -704,10 +707,7 @@ impl Device {
     }
 
     pub fn param_max_size(&self) -> usize {
-        ComputeParam::<u64>::compute_param(
-            self.screen.as_ref(),
-            pipe_compute_cap::PIPE_COMPUTE_CAP_MAX_INPUT_SIZE,
-        ) as usize
+        
self.shader_param(pipe_shader_cap::PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE) as 
usize
     }
 
     pub fn printf_buffer_size(&self) -> usize {

Reply via email to