From f69d1c1c56138093ccba2490b3c2b4fb359d43ec Mon Sep 17 00:00:00 2001 From: Pierre Moreau Date: Thu, 21 May 2020 18:48:22 +0200 Subject: [PATCH] clover/spirv: Increase max amount of function args MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpenCL only has an upper limit on the size taken by all arguments to a kernel (implementation-defined, but at least 1024 bytes), and not on the count of those arguments. This fixes OpenCL-CTS’s api.min_max_parameter_size. v2: Use `numeric_limits<>::max()` instead of hardcoded value. Reviewed-by: Karol Herbst Signed-off-by: Pierre Moreau Part-of: --- src/gallium/frontends/clover/spirv/invocation.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gallium/frontends/clover/spirv/invocation.cpp b/src/gallium/frontends/clover/spirv/invocation.cpp index cec265d87ed..0723c088a1e 100644 --- a/src/gallium/frontends/clover/spirv/invocation.cpp +++ b/src/gallium/frontends/clover/spirv/invocation.cpp @@ -22,6 +22,7 @@ #include "invocation.hpp" +#include #include #include #include @@ -857,8 +858,12 @@ clover::spirv::is_valid_spirv(const std::string &binary, spvtools::SpirvTools spvTool(target_env); spvTool.SetMessageConsumer(validator_consumer); + spvtools::ValidatorOptions validator_options; + validator_options.SetUniversalLimit(spv_validator_limit_max_function_args, + std::numeric_limits::max()); + return spvTool.Validate(reinterpret_cast(binary.data()), - binary.size() / 4u); + binary.size() / 4u, validator_options); } std::string