Chia-I Wu | fb2559d | 2014-08-01 11:19:52 +0800 | [diff] [blame^] | 1 | """XGL API description""" |
| 2 | |
| 3 | # Copyright (C) 2014 LunarG, Inc. |
| 4 | # |
| 5 | # Permission is hereby granted, free of charge, to any person obtaining a |
| 6 | # copy of this software and associated documentation files (the "Software"), |
| 7 | # to deal in the Software without restriction, including without limitation |
| 8 | # the rights to use, copy, modify, merge, publish, distribute, sublicense, |
| 9 | # and/or sell copies of the Software, and to permit persons to whom the |
| 10 | # Software is furnished to do so, subject to the following conditions: |
| 11 | # |
| 12 | # The above copyright notice and this permission notice shall be included |
| 13 | # in all copies or substantial portions of the Software. |
| 14 | # |
| 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL |
| 18 | # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING |
| 20 | # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
| 21 | # DEALINGS IN THE SOFTWARE. |
| 22 | |
| 23 | class Param(object): |
| 24 | """A function parameter.""" |
| 25 | |
| 26 | def __init__(self, ty, name): |
| 27 | self.ty = ty |
| 28 | self.name = name |
| 29 | |
| 30 | def c(self): |
| 31 | """Return the parameter in C.""" |
| 32 | idx = self.ty.find("[") |
| 33 | |
| 34 | # arrays have a different syntax |
| 35 | if idx >= 0: |
| 36 | return "%s %s%s" % (self.ty[:idx], self.name, self.ty[idx:]) |
| 37 | else: |
| 38 | return "%s %s" % (self.ty, self.name) |
| 39 | |
| 40 | class Proto(object): |
| 41 | """A function prototype.""" |
| 42 | |
| 43 | def __init__(self, ret, name, params=()): |
| 44 | # the proto has only a param |
| 45 | if not isinstance(params, (list, tuple)): |
| 46 | params = (params,) |
| 47 | |
| 48 | self.ret = ret |
| 49 | self.name = name |
| 50 | self.params = params |
| 51 | |
| 52 | def c_params(self, need_type=True, need_name=True): |
| 53 | """Return the parameter list in C.""" |
| 54 | if self.params and (need_type or need_name): |
| 55 | if need_type and need_name: |
| 56 | return ", ".join([param.c() for param in self.params]) |
| 57 | elif need_type: |
| 58 | return ", ".join([param.ty for param in self.params]) |
| 59 | else: |
| 60 | return ", ".join([param.name for param in self.params]) |
| 61 | else: |
| 62 | return "void" if need_type else "" |
| 63 | |
| 64 | def c_decl(self, name, attr="", typed=False, need_param_names=True): |
| 65 | """Return a named declaration in C.""" |
| 66 | format_vals = (self.ret, |
| 67 | attr + " " if attr else "", |
| 68 | name, |
| 69 | self.c_params(need_name=need_param_names)) |
| 70 | |
| 71 | if typed: |
| 72 | return "%s (%s*%s)(%s)" % format_vals |
| 73 | else: |
| 74 | return "%s %s%s(%s)" % format_vals |
| 75 | |
| 76 | def c_typedef(self, suffix="", attr=""): |
| 77 | """Return the typedef for the prototype in C.""" |
| 78 | return self.c_decl(self.name + suffix, attr=attr, typed=True) |
| 79 | |
| 80 | def c_func(self, prefix="", attr=""): |
| 81 | """Return the prototype in C.""" |
| 82 | return self.c_decl(prefix + self.name, attr=attr, typed=False) |
| 83 | |
| 84 | def c_call(self): |
| 85 | """Return a call to the prototype in C.""" |
| 86 | return "%s(%s)" % (self.name, self.c_params(need_type=False)) |
| 87 | |
| 88 | # XGL core API |
| 89 | core = ( |
| 90 | Proto("XGL_RESULT", "InitAndEnumerateGpus", |
| 91 | (Param("const XGL_APPLICATION_INFO*", "pAppInfo"), |
| 92 | Param("const XGL_ALLOC_CALLBACKS*", "pAllocCb"), |
| 93 | Param("XGL_UINT", "maxGpus"), |
| 94 | Param("XGL_UINT*", "pGpuCount"), |
| 95 | Param("XGL_PHYSICAL_GPU*", "pGpus"))), |
| 96 | |
| 97 | Proto("XGL_RESULT", "GetGpuInfo", |
| 98 | (Param("XGL_PHYSICAL_GPU", "gpu"), |
| 99 | Param("XGL_PHYSICAL_GPU_INFO_TYPE", "infoType"), |
| 100 | Param("XGL_SIZE*", "pDataSize"), |
| 101 | Param("XGL_VOID*", "pData"))), |
| 102 | |
| 103 | Proto("XGL_RESULT", "CreateDevice", |
| 104 | (Param("XGL_PHYSICAL_GPU", "gpu"), |
| 105 | Param("const XGL_DEVICE_CREATE_INFO*", "pCreateInfo"), |
| 106 | Param("XGL_DEVICE*", "pDevice"))), |
| 107 | |
| 108 | Proto("XGL_RESULT", "DestroyDevice", |
| 109 | (Param("XGL_DEVICE", "device"))), |
| 110 | |
| 111 | Proto("XGL_RESULT", "GetExtensionSupport", |
| 112 | (Param("XGL_PHYSICAL_GPU", "gpu"), |
| 113 | Param("const XGL_CHAR*", "pExtName"))), |
| 114 | |
| 115 | Proto("XGL_RESULT", "GetDeviceQueue", |
| 116 | (Param("XGL_DEVICE", "device"), |
| 117 | Param("XGL_QUEUE_TYPE", "queueType"), |
| 118 | Param("XGL_UINT", "queueIndex"), |
| 119 | Param("XGL_QUEUE*", "pQueue"))), |
| 120 | |
| 121 | Proto("XGL_RESULT", "QueueSubmit", |
| 122 | (Param("XGL_QUEUE", "queue"), |
| 123 | Param("XGL_UINT", "cmdBufferCount"), |
| 124 | Param("const XGL_CMD_BUFFER*", "pCmdBuffers"), |
| 125 | Param("XGL_UINT", "memRefCount"), |
| 126 | Param("const XGL_MEMORY_REF*", "pMemRefs"), |
| 127 | Param("XGL_FENCE", "fence"))), |
| 128 | |
| 129 | Proto("XGL_RESULT", "QueueSetGlobalMemReferences", |
| 130 | (Param("XGL_QUEUE", "queue"), |
| 131 | Param("XGL_UINT", "memRefCount"), |
| 132 | Param("const XGL_MEMORY_REF*", "pMemRefs"))), |
| 133 | |
| 134 | Proto("XGL_RESULT", "QueueWaitIdle", |
| 135 | (Param("XGL_QUEUE", "queue"))), |
| 136 | |
| 137 | Proto("XGL_RESULT", "DeviceWaitIdle", |
| 138 | (Param("XGL_DEVICE", "device"))), |
| 139 | |
| 140 | Proto("XGL_RESULT", "GetMemoryHeapCount", |
| 141 | (Param("XGL_DEVICE", "device"), |
| 142 | Param("XGL_UINT*", "pCount"))), |
| 143 | |
| 144 | Proto("XGL_RESULT", "GetMemoryHeapInfo", |
| 145 | (Param("XGL_DEVICE", "device"), |
| 146 | Param("XGL_UINT", "heapId"), |
| 147 | Param("XGL_MEMORY_HEAP_INFO_TYPE", "infoType"), |
| 148 | Param("XGL_SIZE*", "pDataSize"), |
| 149 | Param("XGL_VOID*", "pData"))), |
| 150 | |
| 151 | Proto("XGL_RESULT", "AllocMemory", |
| 152 | (Param("XGL_DEVICE", "device"), |
| 153 | Param("const XGL_MEMORY_ALLOC_INFO*", "pAllocInfo"), |
| 154 | Param("XGL_GPU_MEMORY*", "pMem"))), |
| 155 | |
| 156 | Proto("XGL_RESULT", "FreeMemory", |
| 157 | (Param("XGL_GPU_MEMORY", "mem"))), |
| 158 | |
| 159 | Proto("XGL_RESULT", "SetMemoryPriority", |
| 160 | (Param("XGL_GPU_MEMORY", "mem"), |
| 161 | Param("XGL_MEMORY_PRIORITY", "priority"))), |
| 162 | |
| 163 | Proto("XGL_RESULT", "MapMemory", |
| 164 | (Param("XGL_GPU_MEMORY", "mem"), |
| 165 | Param("XGL_FLAGS", "flags"), |
| 166 | Param("XGL_VOID**", "ppData"))), |
| 167 | |
| 168 | Proto("XGL_RESULT", "UnmapMemory", |
| 169 | (Param("XGL_GPU_MEMORY", "mem"))), |
| 170 | |
| 171 | Proto("XGL_RESULT", "PinSystemMemory", |
| 172 | (Param("XGL_DEVICE", "device"), |
| 173 | Param("const XGL_VOID*", "pSysMem"), |
| 174 | Param("XGL_SIZE", "memSize"), |
| 175 | Param("XGL_GPU_MEMORY*", "pMem"))), |
| 176 | |
| 177 | Proto("XGL_RESULT", "RemapVirtualMemoryPages", |
| 178 | (Param("XGL_DEVICE", "device"), |
| 179 | Param("XGL_UINT", "rangeCount"), |
| 180 | Param("const XGL_VIRTUAL_MEMORY_REMAP_RANGE*", "pRanges"), |
| 181 | Param("XGL_UINT", "preWaitSemaphoreCount"), |
| 182 | Param("const XGL_QUEUE_SEMAPHORE*", "pPreWaitSemaphores"), |
| 183 | Param("XGL_UINT", "postSignalSemaphoreCount"), |
| 184 | Param("const XGL_QUEUE_SEMAPHORE*", "pPostSignalSemaphores"))), |
| 185 | |
| 186 | Proto("XGL_RESULT", "GetMultiGpuCompatibility", |
| 187 | (Param("XGL_PHYSICAL_GPU", "gpu0"), |
| 188 | Param("XGL_PHYSICAL_GPU", "gpu1"), |
| 189 | Param("XGL_GPU_COMPATIBILITY_INFO*", "pInfo"))), |
| 190 | |
| 191 | Proto("XGL_RESULT", "OpenSharedMemory", |
| 192 | (Param("XGL_DEVICE", "device"), |
| 193 | Param("const XGL_MEMORY_OPEN_INFO*", "pOpenInfo"), |
| 194 | Param("XGL_GPU_MEMORY*", "pMem"))), |
| 195 | |
| 196 | Proto("XGL_RESULT", "OpenSharedQueueSemaphore", |
| 197 | (Param("XGL_DEVICE", "device"), |
| 198 | Param("const XGL_QUEUE_SEMAPHORE_OPEN_INFO*", "pOpenInfo"), |
| 199 | Param("XGL_QUEUE_SEMAPHORE*", "pSemaphore"))), |
| 200 | |
| 201 | Proto("XGL_RESULT", "OpenPeerMemory", |
| 202 | (Param("XGL_DEVICE", "device"), |
| 203 | Param("const XGL_PEER_MEMORY_OPEN_INFO*", "pOpenInfo"), |
| 204 | Param("XGL_GPU_MEMORY*", "pMem"))), |
| 205 | |
| 206 | Proto("XGL_RESULT", "OpenPeerImage", |
| 207 | (Param("XGL_DEVICE", "device"), |
| 208 | Param("const XGL_PEER_IMAGE_OPEN_INFO*", "pOpenInfo"), |
| 209 | Param("XGL_IMAGE*", "pImage"), |
| 210 | Param("XGL_GPU_MEMORY*", "pMem"))), |
| 211 | |
| 212 | Proto("XGL_RESULT", "DestroyObject", |
| 213 | (Param("XGL_OBJECT", "object"))), |
| 214 | |
| 215 | Proto("XGL_RESULT", "GetObjectInfo", |
| 216 | (Param("XGL_BASE_OBJECT", "object"), |
| 217 | Param("XGL_OBJECT_INFO_TYPE", "infoType"), |
| 218 | Param("XGL_SIZE*", "pDataSize"), |
| 219 | Param("XGL_VOID*", "pData"))), |
| 220 | |
| 221 | Proto("XGL_RESULT", "BindObjectMemory", |
| 222 | (Param("XGL_OBJECT", "object"), |
| 223 | Param("XGL_GPU_MEMORY", "mem"), |
| 224 | Param("XGL_GPU_SIZE", "offset"))), |
| 225 | |
| 226 | Proto("XGL_RESULT", "CreateFence", |
| 227 | (Param("XGL_DEVICE", "device"), |
| 228 | Param("const XGL_FENCE_CREATE_INFO*", "pCreateInfo"), |
| 229 | Param("XGL_FENCE*", "pFence"))), |
| 230 | |
| 231 | Proto("XGL_RESULT", "GetFenceStatus", |
| 232 | (Param("XGL_FENCE", "fence"))), |
| 233 | |
| 234 | Proto("XGL_RESULT", "WaitForFences", |
| 235 | (Param("XGL_DEVICE", "device"), |
| 236 | Param("XGL_UINT", "fenceCount"), |
| 237 | Param("const XGL_FENCE*", "pFences"), |
| 238 | Param("XGL_BOOL", "waitAll"), |
| 239 | Param("XGL_UINT64", "timeout"))), |
| 240 | |
| 241 | Proto("XGL_RESULT", "CreateQueueSemaphore", |
| 242 | (Param("XGL_DEVICE", "device"), |
| 243 | Param("const XGL_QUEUE_SEMAPHORE_CREATE_INFO*", "pCreateInfo"), |
| 244 | Param("XGL_QUEUE_SEMAPHORE*", "pSemaphore"))), |
| 245 | |
| 246 | Proto("XGL_RESULT", "SignalQueueSemaphore", |
| 247 | (Param("XGL_QUEUE", "queue"), |
| 248 | Param("XGL_QUEUE_SEMAPHORE", "semaphore"))), |
| 249 | |
| 250 | Proto("XGL_RESULT", "WaitQueueSemaphore", |
| 251 | (Param("XGL_QUEUE", "queue"), |
| 252 | Param("XGL_QUEUE_SEMAPHORE", "semaphore"))), |
| 253 | |
| 254 | Proto("XGL_RESULT", "CreateEvent", |
| 255 | (Param("XGL_DEVICE", "device"), |
| 256 | Param("const XGL_EVENT_CREATE_INFO*", "pCreateInfo"), |
| 257 | Param("XGL_EVENT*", "pEvent"))), |
| 258 | |
| 259 | Proto("XGL_RESULT", "GetEventStatus", |
| 260 | (Param("XGL_EVENT", "event"))), |
| 261 | |
| 262 | Proto("XGL_RESULT", "SetEvent", |
| 263 | (Param("XGL_EVENT", "event"))), |
| 264 | |
| 265 | Proto("XGL_RESULT", "ResetEvent", |
| 266 | (Param("XGL_EVENT", "event"))), |
| 267 | |
| 268 | Proto("XGL_RESULT", "CreateQueryPool", |
| 269 | (Param("XGL_DEVICE", "device"), |
| 270 | Param("const XGL_QUERY_POOL_CREATE_INFO*", "pCreateInfo"), |
| 271 | Param("XGL_QUERY_POOL*", "pQueryPool"))), |
| 272 | |
| 273 | Proto("XGL_RESULT", "GetQueryPoolResults", |
| 274 | (Param("XGL_QUERY_POOL", "queryPool"), |
| 275 | Param("XGL_UINT", "startQuery"), |
| 276 | Param("XGL_UINT", "queryCount"), |
| 277 | Param("XGL_SIZE*", "pDataSize"), |
| 278 | Param("XGL_VOID*", "pData"))), |
| 279 | |
| 280 | Proto("XGL_RESULT", "GetFormatInfo", |
| 281 | (Param("XGL_DEVICE", "device"), |
| 282 | Param("XGL_FORMAT", "format"), |
| 283 | Param("XGL_FORMAT_INFO_TYPE", "infoType"), |
| 284 | Param("XGL_SIZE*", "pDataSize"), |
| 285 | Param("XGL_VOID*", "pData"))), |
| 286 | |
| 287 | Proto("XGL_RESULT", "CreateImage", |
| 288 | (Param("XGL_DEVICE", "device"), |
| 289 | Param("const XGL_IMAGE_CREATE_INFO*", "pCreateInfo"), |
| 290 | Param("XGL_IMAGE*", "pImage"))), |
| 291 | |
| 292 | Proto("XGL_RESULT", "GetImageSubresourceInfo", |
| 293 | (Param("XGL_IMAGE", "image"), |
| 294 | Param("const XGL_IMAGE_SUBRESOURCE*", "pSubresource"), |
| 295 | Param("XGL_SUBRESOURCE_INFO_TYPE", "infoType"), |
| 296 | Param("XGL_SIZE*", "pDataSize"), |
| 297 | Param("XGL_VOID*", "pData"))), |
| 298 | |
| 299 | Proto("XGL_RESULT", "CreateImageView", |
| 300 | (Param("XGL_DEVICE", "device"), |
| 301 | Param("const XGL_IMAGE_VIEW_CREATE_INFO*", "pCreateInfo"), |
| 302 | Param("XGL_IMAGE_VIEW*", "pView"))), |
| 303 | |
| 304 | Proto("XGL_RESULT", "CreateColorAttachmentView", |
| 305 | (Param("XGL_DEVICE", "device"), |
| 306 | Param("const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO*", "pCreateInfo"), |
| 307 | Param("XGL_COLOR_ATTACHMENT_VIEW*", "pView"))), |
| 308 | |
| 309 | Proto("XGL_RESULT", "CreateDepthStencilView", |
| 310 | (Param("XGL_DEVICE", "device"), |
| 311 | Param("const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO*", "pCreateInfo"), |
| 312 | Param("XGL_DEPTH_STENCIL_VIEW*", "pView"))), |
| 313 | |
| 314 | Proto("XGL_RESULT", "CreateShader", |
| 315 | (Param("XGL_DEVICE", "device"), |
| 316 | Param("const XGL_SHADER_CREATE_INFO*", "pCreateInfo"), |
| 317 | Param("XGL_SHADER*", "pShader"))), |
| 318 | |
| 319 | Proto("XGL_RESULT", "CreateGraphicsPipeline", |
| 320 | (Param("XGL_DEVICE", "device"), |
| 321 | Param("const XGL_GRAPHICS_PIPELINE_CREATE_INFO*", "pCreateInfo"), |
| 322 | Param("XGL_PIPELINE*", "pPipeline"))), |
| 323 | |
| 324 | Proto("XGL_RESULT", "CreateComputePipeline", |
| 325 | (Param("XGL_DEVICE", "device"), |
| 326 | Param("const XGL_COMPUTE_PIPELINE_CREATE_INFO*", "pCreateInfo"), |
| 327 | Param("XGL_PIPELINE*", "pPipeline"))), |
| 328 | |
| 329 | Proto("XGL_RESULT", "StorePipeline", |
| 330 | (Param("XGL_PIPELINE", "pipeline"), |
| 331 | Param("XGL_SIZE*", "pDataSize"), |
| 332 | Param("XGL_VOID*", "pData"))), |
| 333 | |
| 334 | Proto("XGL_RESULT", "LoadPipeline", |
| 335 | (Param("XGL_DEVICE", "device"), |
| 336 | Param("XGL_SIZE", "dataSize"), |
| 337 | Param("const XGL_VOID*", "pData"), |
| 338 | Param("XGL_PIPELINE*", "pPipeline"))), |
| 339 | |
| 340 | Proto("XGL_RESULT", "CreatePipelineDelta", |
| 341 | (Param("XGL_DEVICE", "device"), |
| 342 | Param("XGL_PIPELINE", "p1"), |
| 343 | Param("XGL_PIPELINE", "p2"), |
| 344 | Param("XGL_PIPELINE_DELTA*", "delta"))), |
| 345 | |
| 346 | Proto("XGL_RESULT", "CreateSampler", |
| 347 | (Param("XGL_DEVICE", "device"), |
| 348 | Param("const XGL_SAMPLER_CREATE_INFO*", "pCreateInfo"), |
| 349 | Param("XGL_SAMPLER*", "pSampler"))), |
| 350 | |
| 351 | Proto("XGL_RESULT", "CreateDescriptorSet", |
| 352 | (Param("XGL_DEVICE", "device"), |
| 353 | Param("const XGL_DESCRIPTOR_SET_CREATE_INFO*", "pCreateInfo"), |
| 354 | Param("XGL_DESCRIPTOR_SET*", "pDescriptorSet"))), |
| 355 | |
| 356 | Proto("XGL_VOID", "BeginDescriptorSetUpdate", |
| 357 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"))), |
| 358 | |
| 359 | Proto("XGL_VOID", "EndDescriptorSetUpdate", |
| 360 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"))), |
| 361 | |
| 362 | Proto("XGL_VOID", "AttachSamplerDescriptors", |
| 363 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"), |
| 364 | Param("XGL_UINT", "startSlot"), |
| 365 | Param("XGL_UINT", "slotCount"), |
| 366 | Param("const XGL_SAMPLER*", "pSamplers"))), |
| 367 | |
| 368 | Proto("XGL_VOID", "AttachImageViewDescriptors", |
| 369 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"), |
| 370 | Param("XGL_UINT", "startSlot"), |
| 371 | Param("XGL_UINT", "slotCount"), |
| 372 | Param("const XGL_IMAGE_VIEW_ATTACH_INFO*", "pImageViews"))), |
| 373 | |
| 374 | Proto("XGL_VOID", "AttachMemoryViewDescriptors", |
| 375 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"), |
| 376 | Param("XGL_UINT", "startSlot"), |
| 377 | Param("XGL_UINT", "slotCount"), |
| 378 | Param("const XGL_MEMORY_VIEW_ATTACH_INFO*", "pMemViews"))), |
| 379 | |
| 380 | Proto("XGL_VOID", "AttachNestedDescriptors", |
| 381 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"), |
| 382 | Param("XGL_UINT", "startSlot"), |
| 383 | Param("XGL_UINT", "slotCount"), |
| 384 | Param("const XGL_DESCRIPTOR_SET_ATTACH_INFO*", "pNestedDescriptorSets"))), |
| 385 | |
| 386 | Proto("XGL_VOID", "ClearDescriptorSetSlots", |
| 387 | (Param("XGL_DESCRIPTOR_SET", "descriptorSet"), |
| 388 | Param("XGL_UINT", "startSlot"), |
| 389 | Param("XGL_UINT", "slotCount"))), |
| 390 | |
| 391 | Proto("XGL_RESULT", "CreateViewportState", |
| 392 | (Param("XGL_DEVICE", "device"), |
| 393 | Param("const XGL_VIEWPORT_STATE_CREATE_INFO*", "pCreateInfo"), |
| 394 | Param("XGL_VIEWPORT_STATE_OBJECT*", "pState"))), |
| 395 | |
| 396 | Proto("XGL_RESULT", "CreateRasterState", |
| 397 | (Param("XGL_DEVICE", "device"), |
| 398 | Param("const XGL_RASTER_STATE_CREATE_INFO*", "pCreateInfo"), |
| 399 | Param("XGL_RASTER_STATE_OBJECT*", "pState"))), |
| 400 | |
| 401 | Proto("XGL_RESULT", "CreateMsaaState", |
| 402 | (Param("XGL_DEVICE", "device"), |
| 403 | Param("const XGL_MSAA_STATE_CREATE_INFO*", "pCreateInfo"), |
| 404 | Param("XGL_MSAA_STATE_OBJECT*", "pState"))), |
| 405 | |
| 406 | Proto("XGL_RESULT", "CreateColorBlendState", |
| 407 | (Param("XGL_DEVICE", "device"), |
| 408 | Param("const XGL_COLOR_BLEND_STATE_CREATE_INFO*", "pCreateInfo"), |
| 409 | Param("XGL_COLOR_BLEND_STATE_OBJECT*", "pState"))), |
| 410 | |
| 411 | Proto("XGL_RESULT", "CreateDepthStencilState", |
| 412 | (Param("XGL_DEVICE", "device"), |
| 413 | Param("const XGL_DEPTH_STENCIL_STATE_CREATE_INFO*", "pCreateInfo"), |
| 414 | Param("XGL_DEPTH_STENCIL_STATE_OBJECT*", "pState"))), |
| 415 | |
| 416 | Proto("XGL_RESULT", "CreateCommandBuffer", |
| 417 | (Param("XGL_DEVICE", "device"), |
| 418 | Param("const XGL_CMD_BUFFER_CREATE_INFO*", "pCreateInfo"), |
| 419 | Param("XGL_CMD_BUFFER*", "pCmdBuffer"))), |
| 420 | |
| 421 | Proto("XGL_RESULT", "BeginCommandBuffer", |
| 422 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 423 | Param("XGL_FLAGS", "flags"))), |
| 424 | |
| 425 | Proto("XGL_RESULT", "EndCommandBuffer", |
| 426 | (Param("XGL_CMD_BUFFER", "cmdBuffer"))), |
| 427 | |
| 428 | Proto("XGL_RESULT", "ResetCommandBuffer", |
| 429 | (Param("XGL_CMD_BUFFER", "cmdBuffer"))), |
| 430 | |
| 431 | Proto("XGL_VOID", "CmdBindPipeline", |
| 432 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 433 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 434 | Param("XGL_PIPELINE", "pipeline"))), |
| 435 | |
| 436 | Proto("XGL_VOID", "CmdBindPipelineDelta", |
| 437 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 438 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 439 | Param("XGL_PIPELINE_DELTA", "delta"))), |
| 440 | |
| 441 | Proto("XGL_VOID", "CmdBindStateObject", |
| 442 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 443 | Param("XGL_STATE_BIND_POINT", "stateBindPoint"), |
| 444 | Param("XGL_STATE_OBJECT", "state"))), |
| 445 | |
| 446 | Proto("XGL_VOID", "CmdBindDescriptorSet", |
| 447 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 448 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 449 | Param("XGL_UINT", "index"), |
| 450 | Param("XGL_DESCRIPTOR_SET", "descriptorSet"), |
| 451 | Param("XGL_UINT", "slotOffset"))), |
| 452 | |
| 453 | Proto("XGL_VOID", "CmdBindDynamicMemoryView", |
| 454 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 455 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 456 | Param("const XGL_MEMORY_VIEW_ATTACH_INFO*", "pMemView"))), |
| 457 | |
| 458 | Proto("XGL_VOID", "CmdBindIndexData", |
| 459 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 460 | Param("XGL_GPU_MEMORY", "mem"), |
| 461 | Param("XGL_GPU_SIZE", "offset"), |
| 462 | Param("XGL_INDEX_TYPE", "indexType"))), |
| 463 | |
| 464 | Proto("XGL_VOID", "CmdBindAttachments", |
| 465 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 466 | Param("XGL_UINT", "colorAttachmentCount"), |
| 467 | Param("const XGL_COLOR_ATTACHMENT_BIND_INFO*", "pColorAttachments"), |
| 468 | Param("const XGL_DEPTH_STENCIL_BIND_INFO*", "pDepthStencilAttachment"))), |
| 469 | |
| 470 | Proto("XGL_VOID", "CmdPrepareMemoryRegions", |
| 471 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 472 | Param("XGL_UINT", "transitionCount"), |
| 473 | Param("const XGL_MEMORY_STATE_TRANSITION*", "pStateTransitions"))), |
| 474 | |
| 475 | Proto("XGL_VOID", "CmdPrepareImages", |
| 476 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 477 | Param("XGL_UINT", "transitionCount"), |
| 478 | Param("const XGL_IMAGE_STATE_TRANSITION*", "pStateTransitions"))), |
| 479 | |
| 480 | Proto("XGL_VOID", "CmdDraw", |
| 481 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 482 | Param("XGL_UINT", "firstVertex"), |
| 483 | Param("XGL_UINT", "vertexCount"), |
| 484 | Param("XGL_UINT", "firstInstance"), |
| 485 | Param("XGL_UINT", "instanceCount"))), |
| 486 | |
| 487 | Proto("XGL_VOID", "CmdDrawIndexed", |
| 488 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 489 | Param("XGL_UINT", "firstIndex"), |
| 490 | Param("XGL_UINT", "indexCount"), |
| 491 | Param("XGL_INT", "vertexOffset"), |
| 492 | Param("XGL_UINT", "firstInstance"), |
| 493 | Param("XGL_UINT", "instanceCount"))), |
| 494 | |
| 495 | Proto("XGL_VOID", "CmdDrawIndirect", |
| 496 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 497 | Param("XGL_GPU_MEMORY", "mem"), |
| 498 | Param("XGL_GPU_SIZE", "offset"), |
| 499 | Param("XGL_UINT32", "count"), |
| 500 | Param("XGL_UINT32", "stride"))), |
| 501 | |
| 502 | Proto("XGL_VOID", "CmdDrawIndexedIndirect", |
| 503 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 504 | Param("XGL_GPU_MEMORY", "mem"), |
| 505 | Param("XGL_GPU_SIZE", "offset"), |
| 506 | Param("XGL_UINT32", "count"), |
| 507 | Param("XGL_UINT32", "stride"))), |
| 508 | |
| 509 | Proto("XGL_VOID", "CmdDispatch", |
| 510 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 511 | Param("XGL_UINT", "x"), |
| 512 | Param("XGL_UINT", "y"), |
| 513 | Param("XGL_UINT", "z"))), |
| 514 | |
| 515 | Proto("XGL_VOID", "CmdDispatchIndirect", |
| 516 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 517 | Param("XGL_GPU_MEMORY", "mem"), |
| 518 | Param("XGL_GPU_SIZE", "offset"))), |
| 519 | |
| 520 | Proto("XGL_VOID", "CmdCopyMemory", |
| 521 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 522 | Param("XGL_GPU_MEMORY", "srcMem"), |
| 523 | Param("XGL_GPU_MEMORY", "destMem"), |
| 524 | Param("XGL_UINT", "regionCount"), |
| 525 | Param("const XGL_MEMORY_COPY*", "pRegions"))), |
| 526 | |
| 527 | Proto("XGL_VOID", "CmdCopyImage", |
| 528 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 529 | Param("XGL_IMAGE", "srcImage"), |
| 530 | Param("XGL_IMAGE", "destImage"), |
| 531 | Param("XGL_UINT", "regionCount"), |
| 532 | Param("const XGL_IMAGE_COPY*", "pRegions"))), |
| 533 | |
| 534 | Proto("XGL_VOID", "CmdCopyMemoryToImage", |
| 535 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 536 | Param("XGL_GPU_MEMORY", "srcMem"), |
| 537 | Param("XGL_IMAGE", "destImage"), |
| 538 | Param("XGL_UINT", "regionCount"), |
| 539 | Param("const XGL_MEMORY_IMAGE_COPY*", "pRegions"))), |
| 540 | |
| 541 | Proto("XGL_VOID", "CmdCopyImageToMemory", |
| 542 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 543 | Param("XGL_IMAGE", "srcImage"), |
| 544 | Param("XGL_GPU_MEMORY", "destMem"), |
| 545 | Param("XGL_UINT", "regionCount"), |
| 546 | Param("const XGL_MEMORY_IMAGE_COPY*", "pRegions"))), |
| 547 | |
| 548 | Proto("XGL_VOID", "CmdCloneImageData", |
| 549 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 550 | Param("XGL_IMAGE", "srcImage"), |
| 551 | Param("XGL_IMAGE_STATE", "srcImageState"), |
| 552 | Param("XGL_IMAGE", "destImage"), |
| 553 | Param("XGL_IMAGE_STATE", "destImageState"))), |
| 554 | |
| 555 | Proto("XGL_VOID", "CmdUpdateMemory", |
| 556 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 557 | Param("XGL_GPU_MEMORY", "destMem"), |
| 558 | Param("XGL_GPU_SIZE", "destOffset"), |
| 559 | Param("XGL_GPU_SIZE", "dataSize"), |
| 560 | Param("const XGL_UINT32*", "pData"))), |
| 561 | |
| 562 | Proto("XGL_VOID", "CmdFillMemory", |
| 563 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 564 | Param("XGL_GPU_MEMORY", "destMem"), |
| 565 | Param("XGL_GPU_SIZE", "destOffset"), |
| 566 | Param("XGL_GPU_SIZE", "fillSize"), |
| 567 | Param("XGL_UINT32", "data"))), |
| 568 | |
| 569 | Proto("XGL_VOID", "CmdClearColorImage", |
| 570 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 571 | Param("XGL_IMAGE", "image"), |
| 572 | Param("const XGL_FLOAT[4]", "color"), |
| 573 | Param("XGL_UINT", "rangeCount"), |
| 574 | Param("const XGL_IMAGE_SUBRESOURCE_RANGE*", "pRanges"))), |
| 575 | |
| 576 | Proto("XGL_VOID", "CmdClearColorImageRaw", |
| 577 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 578 | Param("XGL_IMAGE", "image"), |
| 579 | Param("const XGL_UINT32[4]", "color"), |
| 580 | Param("XGL_UINT", "rangeCount"), |
| 581 | Param("const XGL_IMAGE_SUBRESOURCE_RANGE*", "pRanges"))), |
| 582 | |
| 583 | Proto("XGL_VOID", "CmdClearDepthStencil", |
| 584 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 585 | Param("XGL_IMAGE", "image"), |
| 586 | Param("XGL_FLOAT", "depth"), |
| 587 | Param("XGL_UINT32", "stencil"), |
| 588 | Param("XGL_UINT", "rangeCount"), |
| 589 | Param("const XGL_IMAGE_SUBRESOURCE_RANGE*", "pRanges"))), |
| 590 | |
| 591 | Proto("XGL_VOID", "CmdResolveImage", |
| 592 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 593 | Param("XGL_IMAGE", "srcImage"), |
| 594 | Param("XGL_IMAGE", "destImage"), |
| 595 | Param("XGL_UINT", "rectCount"), |
| 596 | Param("const XGL_IMAGE_RESOLVE*", "pRects"))), |
| 597 | |
| 598 | Proto("XGL_VOID", "CmdSetEvent", |
| 599 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 600 | Param("XGL_EVENT", "event"))), |
| 601 | |
| 602 | Proto("XGL_VOID", "CmdResetEvent", |
| 603 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 604 | Param("XGL_EVENT", "event"))), |
| 605 | |
| 606 | Proto("XGL_VOID", "CmdMemoryAtomic", |
| 607 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 608 | Param("XGL_GPU_MEMORY", "destMem"), |
| 609 | Param("XGL_GPU_SIZE", "destOffset"), |
| 610 | Param("XGL_UINT64", "srcData"), |
| 611 | Param("XGL_ATOMIC_OP", "atomicOp"))), |
| 612 | |
| 613 | Proto("XGL_VOID", "CmdBeginQuery", |
| 614 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 615 | Param("XGL_QUERY_POOL", "queryPool"), |
| 616 | Param("XGL_UINT", "slot"), |
| 617 | Param("XGL_FLAGS", "flags"))), |
| 618 | |
| 619 | Proto("XGL_VOID", "CmdEndQuery", |
| 620 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 621 | Param("XGL_QUERY_POOL", "queryPool"), |
| 622 | Param("XGL_UINT", "slot"))), |
| 623 | |
| 624 | Proto("XGL_VOID", "CmdResetQueryPool", |
| 625 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 626 | Param("XGL_QUERY_POOL", "queryPool"), |
| 627 | Param("XGL_UINT", "startQuery"), |
| 628 | Param("XGL_UINT", "queryCount"))), |
| 629 | |
| 630 | Proto("XGL_VOID", "CmdWriteTimestamp", |
| 631 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 632 | Param("XGL_TIMESTAMP_TYPE", "timestampType"), |
| 633 | Param("XGL_GPU_MEMORY", "destMem"), |
| 634 | Param("XGL_GPU_SIZE", "destOffset"))), |
| 635 | |
| 636 | Proto("XGL_VOID", "CmdInitAtomicCounters", |
| 637 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 638 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 639 | Param("XGL_UINT", "startCounter"), |
| 640 | Param("XGL_UINT", "counterCount"), |
| 641 | Param("const XGL_UINT32*", "pData"))), |
| 642 | |
| 643 | Proto("XGL_VOID", "CmdLoadAtomicCounters", |
| 644 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 645 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 646 | Param("XGL_UINT", "startCounter"), |
| 647 | Param("XGL_UINT", "counterCount"), |
| 648 | Param("XGL_GPU_MEMORY", "srcMem"), |
| 649 | Param("XGL_GPU_SIZE", "srcOffset"))), |
| 650 | |
| 651 | Proto("XGL_VOID", "CmdSaveAtomicCounters", |
| 652 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 653 | Param("XGL_PIPELINE_BIND_POINT", "pipelineBindPoint"), |
| 654 | Param("XGL_UINT", "startCounter"), |
| 655 | Param("XGL_UINT", "counterCount"), |
| 656 | Param("XGL_GPU_MEMORY", "destMem"), |
| 657 | Param("XGL_GPU_SIZE", "destOffset"))), |
| 658 | |
| 659 | Proto("XGL_RESULT", "DbgSetValidationLevel", |
| 660 | (Param("XGL_DEVICE", "device"), |
| 661 | Param("XGL_VALIDATION_LEVEL", "validationLevel"))), |
| 662 | |
| 663 | Proto("XGL_RESULT", "DbgRegisterMsgCallback", |
| 664 | (Param("XGL_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"), |
| 665 | Param("XGL_VOID*", "pUserData"))), |
| 666 | |
| 667 | Proto("XGL_RESULT", "DbgUnregisterMsgCallback", |
| 668 | (Param("XGL_DBG_MSG_CALLBACK_FUNCTION", "pfnMsgCallback"))), |
| 669 | |
| 670 | Proto("XGL_RESULT", "DbgSetMessageFilter", |
| 671 | (Param("XGL_DEVICE", "device"), |
| 672 | Param("XGL_INT", "msgCode"), |
| 673 | Param("XGL_DBG_MSG_FILTER", "filter"))), |
| 674 | |
| 675 | Proto("XGL_RESULT", "DbgSetObjectTag", |
| 676 | (Param("XGL_BASE_OBJECT", "object"), |
| 677 | Param("XGL_SIZE", "tagSize"), |
| 678 | Param("const XGL_VOID*", "pTag"))), |
| 679 | |
| 680 | Proto("XGL_RESULT", "DbgSetGlobalOption", |
| 681 | (Param("XGL_DBG_GLOBAL_OPTION", "dbgOption"), |
| 682 | Param("XGL_SIZE", "dataSize"), |
| 683 | Param("const XGL_VOID*", "pData"))), |
| 684 | |
| 685 | Proto("XGL_RESULT", "DbgSetDeviceOption", |
| 686 | (Param("XGL_DEVICE", "device"), |
| 687 | Param("XGL_DBG_DEVICE_OPTION", "dbgOption"), |
| 688 | Param("XGL_SIZE", "dataSize"), |
| 689 | Param("const XGL_VOID*", "pData"))), |
| 690 | |
| 691 | Proto("XGL_VOID", "CmdDbgMarkerBegin", |
| 692 | (Param("XGL_CMD_BUFFER", "cmdBuffer"), |
| 693 | Param("const XGL_CHAR*", "pMarker"))), |
| 694 | |
| 695 | Proto("XGL_VOID", "CmdDbgMarkerEnd", |
| 696 | (Param("XGL_CMD_BUFFER", "cmdBuffer"))), |
| 697 | ) |
| 698 | |
| 699 | # the dispatch table defined for ICDs |
| 700 | # XXX figure out the real order |
| 701 | icd_dispatch_table = ( |
| 702 | "InitAndEnumerateGpus", |
| 703 | "GetGpuInfo", |
| 704 | "CreateDevice", |
| 705 | "DestroyDevice", |
| 706 | "GetExtensionSupport", |
| 707 | "GetDeviceQueue", |
| 708 | "QueueSubmit", |
| 709 | "QueueSetGlobalMemReferences", |
| 710 | "QueueWaitIdle", |
| 711 | "DeviceWaitIdle", |
| 712 | "GetMemoryHeapCount", |
| 713 | "GetMemoryHeapInfo", |
| 714 | "AllocMemory", |
| 715 | "FreeMemory", |
| 716 | "SetMemoryPriority", |
| 717 | "MapMemory", |
| 718 | "UnmapMemory", |
| 719 | "PinSystemMemory", |
| 720 | "RemapVirtualMemoryPages", |
| 721 | "GetMultiGpuCompatibility", |
| 722 | "OpenSharedMemory", |
| 723 | "OpenSharedQueueSemaphore", |
| 724 | "OpenPeerMemory", |
| 725 | "OpenPeerImage", |
| 726 | "DestroyObject", |
| 727 | "GetObjectInfo", |
| 728 | "BindObjectMemory", |
| 729 | "CreateFence", |
| 730 | "GetFenceStatus", |
| 731 | "WaitForFences", |
| 732 | "CreateQueueSemaphore", |
| 733 | "SignalQueueSemaphore", |
| 734 | "WaitQueueSemaphore", |
| 735 | "CreateEvent", |
| 736 | "GetEventStatus", |
| 737 | "SetEvent", |
| 738 | "ResetEvent", |
| 739 | "CreateQueryPool", |
| 740 | "GetQueryPoolResults", |
| 741 | "GetFormatInfo", |
| 742 | "CreateImage", |
| 743 | "GetImageSubresourceInfo", |
| 744 | "CreateImageView", |
| 745 | "CreateColorAttachmentView", |
| 746 | "CreateDepthStencilView", |
| 747 | "CreateShader", |
| 748 | "CreateGraphicsPipeline", |
| 749 | "CreateComputePipeline", |
| 750 | "StorePipeline", |
| 751 | "LoadPipeline", |
| 752 | "CreatePipelineDelta", |
| 753 | "CreateSampler", |
| 754 | "CreateDescriptorSet", |
| 755 | "BeginDescriptorSetUpdate", |
| 756 | "EndDescriptorSetUpdate", |
| 757 | "AttachSamplerDescriptors", |
| 758 | "AttachImageViewDescriptors", |
| 759 | "AttachMemoryViewDescriptors", |
| 760 | "AttachNestedDescriptors", |
| 761 | "ClearDescriptorSetSlots", |
| 762 | "CreateViewportState", |
| 763 | "CreateRasterState", |
| 764 | "CreateMsaaState", |
| 765 | "CreateColorBlendState", |
| 766 | "CreateDepthStencilState", |
| 767 | "CreateCommandBuffer", |
| 768 | "BeginCommandBuffer", |
| 769 | "EndCommandBuffer", |
| 770 | "ResetCommandBuffer", |
| 771 | "CmdBindPipeline", |
| 772 | "CmdBindPipelineDelta", |
| 773 | "CmdBindStateObject", |
| 774 | "CmdBindDescriptorSet", |
| 775 | "CmdBindDynamicMemoryView", |
| 776 | "CmdBindIndexData", |
| 777 | "CmdBindAttachments", |
| 778 | "CmdPrepareMemoryRegions", |
| 779 | "CmdPrepareImages", |
| 780 | "CmdDraw", |
| 781 | "CmdDrawIndexed", |
| 782 | "CmdDrawIndirect", |
| 783 | "CmdDrawIndexedIndirect", |
| 784 | "CmdDispatch", |
| 785 | "CmdDispatchIndirect", |
| 786 | "CmdCopyMemory", |
| 787 | "CmdCopyImage", |
| 788 | "CmdCopyMemoryToImage", |
| 789 | "CmdCopyImageToMemory", |
| 790 | "CmdCloneImageData", |
| 791 | "CmdUpdateMemory", |
| 792 | "CmdFillMemory", |
| 793 | "CmdClearColorImage", |
| 794 | "CmdClearColorImageRaw", |
| 795 | "CmdClearDepthStencil", |
| 796 | "CmdResolveImage", |
| 797 | "CmdSetEvent", |
| 798 | "CmdResetEvent", |
| 799 | "CmdMemoryAtomic", |
| 800 | "CmdBeginQuery", |
| 801 | "CmdEndQuery", |
| 802 | "CmdResetQueryPool", |
| 803 | "CmdWriteTimestamp", |
| 804 | "CmdInitAtomicCounters", |
| 805 | "CmdLoadAtomicCounters", |
| 806 | "CmdSaveAtomicCounters", |
| 807 | "DbgSetValidationLevel", |
| 808 | "DbgRegisterMsgCallback", |
| 809 | "DbgUnregisterMsgCallback", |
| 810 | "DbgSetMessageFilter", |
| 811 | "DbgSetObjectTag", |
| 812 | "DbgSetGlobalOption", |
| 813 | "DbgSetDeviceOption", |
| 814 | "CmdDbgMarkerBegin", |
| 815 | "CmdDbgMarkerEnd", |
| 816 | ) |