[Mesa-dev] [PATCH 2/3] clover: Query the device to see if images are supported

Tom Stellard thomas.stellard at amd.com
Wed Jul 23 17:37:08 PDT 2014


---
 src/gallium/state_trackers/clover/api/device.cpp  | 2 +-
 src/gallium/state_trackers/clover/core/device.cpp | 6 ++++++
 src/gallium/state_trackers/clover/core/device.hpp | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index 97b2cf9..e825468 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -184,7 +184,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_IMAGE_SUPPORT:
-      buf.as_scalar<cl_bool>() = CL_TRUE;
+      buf.as_scalar<cl_bool>() = dev.image_support();
       break;
 
    case CL_DEVICE_MAX_PARAMETER_SIZE:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index b6078db..63aa193 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -169,6 +169,12 @@ device::max_compute_units() const {
                                       PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS)[0];
 }
 
+bool
+device::image_support() const {
+   return get_compute_param<uint32_t>(pipe,
+                                      PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0];
+}
+
 std::vector<size_t>
 device::max_block_size() const {
    auto v = get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index 731c31e..2201700 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -63,6 +63,7 @@ namespace clover {
       cl_ulong max_mem_alloc_size() const;
       cl_uint max_clock_frequency() const;
       cl_uint max_compute_units() const;
+      bool image_support() const;
 
       std::vector<size_t> max_block_size() const;
       std::string device_name() const;
-- 
1.8.1.5



More information about the mesa-dev mailing list