From bbea8761c221953f953b0bf8b54da51947b3027f Mon Sep 17 00:00:00 2001 From: Karol Herbst Date: Thu, 29 Sep 2022 03:03:26 +0200 Subject: [PATCH] rusticl/device: fix some device limits Signed-off-by: Karol Herbst Part-of: --- 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 99cdce9..efcb6535 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::::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::::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 { -- 2.7.4