clover: Move min image support check

If the gallium driver supports images, but not the minimum image
requirements for CL, then simply don't claim to support images.  This
is better than not claiming to support CL at all.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14310>
This commit is contained in:
Rob Clark 2021-12-26 12:45:49 -08:00 committed by Marge Bot
parent 12ac44378d
commit 94f465856c
1 changed files with 18 additions and 9 deletions

View File

@ -76,13 +76,7 @@ namespace {
dev.max_const_buffer_size() < 64 * 1024 ||
dev.max_const_buffers() < 8 ||
dev.max_mem_local() < 16 * 1024 ||
dev.clc_version < CL_MAKE_VERSION(1, 0, 0) ||
(supports_images &&
(dev.max_images_read() < 128 ||
dev.max_images_write() < 8 ||
dev.max_image_size() < 8192 ||
dev.max_image_size_3d() < 2048 ||
dev.max_samplers() < 16))) {
dev.clc_version < CL_MAKE_VERSION(1, 0, 0)) {
return version;
}
version = CL_MAKE_VERSION(1, 0, 0);
@ -318,8 +312,23 @@ device::max_printf_buffer_size() const {
bool
device::image_support() const {
return get_compute_param<uint32_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0];
bool supports_images = get_compute_param<uint32_t>(pipe, ir_format(),
PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0];
if (!supports_images)
return false;
/* If the gallium driver supports images, but does not support the
* minimum requirements for opencl 1.0 images, then don't claim to
* support images.
*/
if (max_images_read() < 128 ||
max_images_write() < 8 ||
max_image_size() < 8192 ||
max_image_size_3d() < 2048 ||
max_samplers() < 16)
return false;
return true;
}
bool