From: EdB Date: Sat, 11 Oct 2014 22:58:39 +0000 (+0300) Subject: clover: Add allow_empty_tag. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aa93af809fc8268a8a4a80e00ff4b8a2770fa659;p=mesa.git clover: Add allow_empty_tag. To allow empty objs() list checks. Reviewed-by: Francisco Jerez --- diff --git a/src/gallium/state_trackers/clover/core/object.hpp b/src/gallium/state_trackers/clover/core/object.hpp index daad06848b4..e3a5ab7fafd 100644 --- a/src/gallium/state_trackers/clover/core/object.hpp +++ b/src/gallium/state_trackers/clover/core/object.hpp @@ -55,6 +55,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 + struct descriptor_traits { + typedef typename D::object_type object_type; + + static void + validate(D *d) { + if (!d || d->dispatch != &_dispatch) + throw invalid_object_error(); + } + + static void + validate_list(D *const *ds, size_t n) { + if (bool(ds) != bool(n)) + throw error(CL_INVALID_VALUE); + } + }; + template struct descriptor_traits { typedef typename D::object_type object_type;