[Mesa-dev] [PATCH 1/2] clover: add allow_empty_tag

EdB edb+mesa at sigluy.net
Sat Oct 11 09:01:35 PDT 2014


to allow empty objs() list checks
---
 src/gallium/state_trackers/clover/core/object.hpp | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/gallium/state_trackers/clover/core/object.hpp b/src/gallium/state_trackers/clover/core/object.hpp
index 697565c..01fa779 100644
--- a/src/gallium/state_trackers/clover/core/object.hpp
+++ b/src/gallium/state_trackers/clover/core/object.hpp
@@ -54,6 +54,7 @@ namespace clover {
    };
 
    struct default_tag;
+   struct allow_empty_tag;
    struct wait_list_tag;
    struct property_list_tag;
 
@@ -95,6 +96,23 @@ namespace clover {
       };
 
       template<typename D>
+      struct descriptor_traits<allow_empty_tag, D> {
+         typedef typename D::object_type object_type;
+
+         static void
+         validate(D *d) {
+            if (!d || d->dispatch != &_dispatch)
+               throw invalid_object_error<object_type>();
+         }
+
+         static void
+         validate_list(D *const *ds, size_t n) {
+            if (bool(ds) != bool(n))
+               throw error(CL_INVALID_VALUE);
+         }
+      };
+
+      template<typename D>
       struct descriptor_traits<wait_list_tag, D> {
          typedef typename D::object_type object_type;
 
-- 
1.9.3



More information about the mesa-dev mailing list