From fea109d40ff8c0bd0f90675fe5b9799cc88240eb Mon Sep 17 00:00:00 2001 From: Serge Martin Date: Tue, 19 May 2020 15:56:15 +0200 Subject: [PATCH] clover: add more cl_mem_object_type to pipe_texture_target mapping It avoid unnecessary CL_INVALID_VALUE return from clGetSupportedImageFormats Reviewed-by: Francisco Jerez Part-of: --- src/gallium/frontends/clover/core/format.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/frontends/clover/core/format.cpp b/src/gallium/frontends/clover/core/format.cpp index dee1872c829..16a5767b934 100644 --- a/src/gallium/frontends/clover/core/format.cpp +++ b/src/gallium/frontends/clover/core/format.cpp @@ -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); } -- 2.30.2