rusticl/device: _MAX_CONST_BUFFER0_SIZE is unsigned
authorKarol Herbst <git@karolherbst.de>
Tue, 22 Aug 2023 17:37:52 +0000 (19:37 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 25 Aug 2023 12:03:29 +0000 (12:03 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24868>

src/gallium/frontends/rusticl/core/device.rs

index 34e23a6..aeaba53 100644 (file)
@@ -304,10 +304,11 @@ impl Device {
 
         // CL_DEVICE_MAX_PARAMETER_SIZE
         // For this minimum value, only a maximum of 128 arguments can be passed to a kernel
-        if screen.shader_param(
+        if (screen.shader_param(
             pipe_shader_type::PIPE_SHADER_COMPUTE,
             pipe_shader_cap::PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE,
-        ) < 128
+        ) as u32)
+            < 128
         {
             return false;
         }
@@ -840,7 +841,7 @@ impl Device {
 
     pub fn param_max_size(&self) -> usize {
         min(
-            self.shader_param(pipe_shader_cap::PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE),
+            self.shader_param(pipe_shader_cap::PIPE_SHADER_CAP_MAX_CONST_BUFFER0_SIZE) as u32,
             32 * 1024,
         ) as usize
     }