clover: add more cl_mem_object_type to pipe_texture_target mapping
authorSerge Martin <edb@sigluy.net>
Tue, 19 May 2020 13:56:15 +0000 (15:56 +0200)
committerSerge Martin <edb@sigluy.net>
Tue, 14 Jul 2020 07:33:02 +0000 (09:33 +0200)
It avoid unnecessary CL_INVALID_VALUE return from clGetSupportedImageFormats

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5897>

src/gallium/frontends/clover/core/format.cpp

index dee1872c829c112a449a1696a87c5198208e536f..16a5767b9340908d1f4e91f62a10dcefd8f5d1b4 100644 (file)
@@ -122,11 +122,18 @@ namespace clover {
    translate_target(cl_mem_object_type type) {
       switch (type) {
       case CL_MEM_OBJECT_BUFFER:
+      case CL_MEM_OBJECT_IMAGE1D_BUFFER:
          return PIPE_BUFFER;
+      case CL_MEM_OBJECT_IMAGE1D:
+         return PIPE_TEXTURE_1D;
       case CL_MEM_OBJECT_IMAGE2D:
          return PIPE_TEXTURE_2D;
       case CL_MEM_OBJECT_IMAGE3D:
          return PIPE_TEXTURE_3D;
+      case CL_MEM_OBJECT_IMAGE1D_ARRAY:
+         return PIPE_TEXTURE_1D_ARRAY;
+      case CL_MEM_OBJECT_IMAGE2D_ARRAY:
+         return PIPE_TEXTURE_2D_ARRAY;
       default:
          throw error(CL_INVALID_VALUE);
       }