@@ -36,22 +36,20 @@ def : Enum {
36
36
37
37
def : Function {
38
38
let name = "olGetDeviceCount";
39
- let desc = "Retrieves the number of available devices within a platform .";
39
+ let desc = "Retrieves the number of available devices.";
40
40
let params = [
41
- Param<"ol_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
42
41
Param<"uint32_t*", "NumDevices", "pointer to the number of devices.", PARAM_OUT>
43
42
];
44
43
let returns = [];
45
44
}
46
45
47
46
def : Function {
48
- let name = "olGetDevice ";
49
- let desc = "Retrieves devices within a platform .";
47
+ let name = "olGetDevices ";
48
+ let desc = "Retrieves devices.";
50
49
let details = [
51
50
"Multiple calls to this function will return identical device handles, in the same order.",
52
51
];
53
52
let params = [
54
- Param<"ol_platform_handle_t", "Platform", "handle of the platform instance", PARAM_IN>,
55
53
Param<"uint32_t", "NumEntries", "the number of devices to be added to phDevices, which must be greater than zero", PARAM_IN>,
56
54
RangedParam<"ol_device_handle_t*", "Devices", "Array of device handles. "
57
55
"If NumEntries is less than the number of devices available, then this function shall only retrieve that number of devices.", PARAM_OUT,
@@ -64,6 +62,58 @@ def : Function {
64
62
];
65
63
}
66
64
65
+ def : FptrTypedef {
66
+ let name = "ol_platform_filter_cb_t";
67
+ let desc = "User-provided function to determine whether a platform is selected.";
68
+ let params = [
69
+ Param<"ol_platform_backend_t", "Backend", "the backend of the platform which is selected for filtering", PARAM_IN>,
70
+ Param<"const char*", "Name", "the name of the platform which is selected for filtering", PARAM_IN>
71
+ ];
72
+ let return = "bool";
73
+ }
74
+
75
+ def : FptrTypedef {
76
+ let name = "ol_device_filter_cb_t";
77
+ let desc = "User-provided function to determine whether a device is selected.";
78
+ let params = [
79
+ Param<"ol_device_type_t", "Type", "the type of the device which is selected for filtering", PARAM_IN>
80
+ ];
81
+ let return = "bool";
82
+ }
83
+
84
+ def : Function {
85
+ let name = "olGetFilteredDevices";
86
+ let desc = "Retrieve a subset of the available devices";
87
+ let details = [
88
+ "Platforms and devices are lazily initialized when they are first filtered",
89
+ "Use MaxNumDevices to stop device and platform discovery after a fixed number of devices",
90
+ "Multiple calls to this function will return identical device handles, in the same order.",
91
+ ];
92
+ let params = [
93
+ Param<"uint32_t", "MaxNumDevices", "the maximum number of devices to be added to phDevices, which must be greater than zero", PARAM_IN>,
94
+ Param<"ol_platform_filter_cb_t", "PlatformFilter", "the callback used to decide whether a platform is included", PARAM_IN>,
95
+ Param<"ol_device_filter_cb_t", "DeviceFilter", "the callback used to decide whether a platform is included", PARAM_IN>,
96
+ Param<"ol_device_handle_t*", "FilteredDevices", "output pointer for the selected devices", PARAM_OUT>,
97
+ ];
98
+ let returns = [];
99
+ }
100
+
101
+ def : Function {
102
+ let name = "olGetFilteredDevicesCount";
103
+ let desc = "Retrieve the number of devices that would be returned by olGetFilteredDevices with the given filters.";
104
+ let details = [
105
+ "Platforms and devices are lazily initialized when they are first filtered",
106
+ "Use MaxNumDevices to stop device and platform discovery after a fixed number of devices",
107
+ ];
108
+ let params = [
109
+ Param<"uint32_t", "MaxNumDevices", "the maximum number of devices to be added to phDevices; a value of 0 implies no limit.", PARAM_IN>,
110
+ Param<"ol_platform_filter_cb_t", "PlatformFilter", "the callback used to decide whether a platform is included", PARAM_IN>,
111
+ Param<"ol_device_filter_cb_t", "DeviceFilter", "the callback used to decide whether a platform is included", PARAM_IN>,
112
+ Param<"uint32_t*", "NumFilteredDevices", "output pointer for the number of selected devices", PARAM_OUT>
113
+ ];
114
+ let returns = [];
115
+ }
116
+
67
117
def : Function {
68
118
let name = "olGetDeviceInfo";
69
119
let desc = "Queries the given property of the device.";
0 commit comments