mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-09 04:00:12 +01:00
clover: Add allow_empty_tag.
To allow empty objs() list checks. Reviewed-by: Francisco Jerez <currojerez@riseup.net>
This commit is contained in:
parent
611d66fe45
commit
aa93af809f
1 changed files with 18 additions and 0 deletions
|
|
@ -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<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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue