[Beignet] [PATCH] Runtime: Only return the format allowed in the spec.
Zhigang Gong
zhigang.gong at linux.intel.com
Wed Sep 4 00:07:10 PDT 2013
For the CL_INTENSITY and CL_LUMINANCE, it only supports
CL_UNORM_INT8,CL_UNORM_INT16, CL_SNORM_INT8, CL_SNORM_INT16,
CL_HALF_FLOAT or CL_FLOAT.
Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
---
src/cl_image.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/cl_image.c b/src/cl_image.c
index 6ea104b..6361c76 100644
--- a/src/cl_image.c
+++ b/src/cl_image.c
@@ -104,6 +104,12 @@ cl_image_get_intel_format(const cl_image_format *fmt)
case CL_A:
case CL_INTENSITY:
case CL_LUMINANCE:
+ if ((order == CL_INTENSITY || order == CL_LUMINANCE)
+ && (type != CL_UNORM_INT8 && type != CL_UNORM_INT16
+ && type != CL_SNORM_INT8 && type != CL_SNORM_INT16
+ && type != CL_HALF_FLOAT && type != CL_FLOAT))
+ return INTEL_UNSUPPORTED_FORMAT;
+
switch (type) {
case CL_HALF_FLOAT: return I965_SURFACEFORMAT_R16_FLOAT;
case CL_FLOAT: return I965_SURFACEFORMAT_R32_FLOAT;
--
1.7.9.5
More information about the Beignet
mailing list