From 3d636b47859ba084799a4caa34d22e622487f89e Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Fri, 25 Jul 2014 17:12:28 -0400 Subject: clover: Add checks for image support to the image functions v2 Most image functions are required to return a CL_INVALID_OPERATION error when used on devices without image support. v2: - Simplified the code Reviewed-by: Francisco Jerez --- src/gallium/state_trackers/clover/api/transfer.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gallium/state_trackers/clover/api/transfer.cpp') diff --git a/src/gallium/state_trackers/clover/api/transfer.cpp b/src/gallium/state_trackers/clover/api/transfer.cpp index 404ceb028b4..07d8a7307f2 100644 --- a/src/gallium/state_trackers/clover/api/transfer.cpp +++ b/src/gallium/state_trackers/clover/api/transfer.cpp @@ -101,6 +101,9 @@ namespace { const vector_t &orig, const vector_t ®ion) { vector_t size = { img.width(), img.height(), img.depth() }; + if (!q.device().image_support()) + throw error(CL_INVALID_OPERATION); + if (img.context() != q.context()) throw error(CL_INVALID_CONTEXT); -- cgit v1.2.3