1 /* 2 Copyright (c) 2019-2021 Timur Gafarov. 3 4 Boost Software License - Version 1.0 - August 17th, 2003 5 6 Permission is hereby granted, free of charge, to any person or organization 7 obtaining a copy of the software and accompanying documentation covered by 8 this license (the "Software") to use, reproduce, display, distribute, 9 execute, and transmit the Software, and to prepare derivative works of the 10 Software, and to permit third-parties to whom the Software is furnished to 11 do so, all subject to the following: 12 13 The copyright notices in the Software and this entire statement, including 14 the above license grant, this restriction and the following disclaimer, 15 must be included in all copies of the Software, in whole or in part, and 16 all derivative works of the Software, unless such copies or derivative 17 works are solely in the form of machine-executable object code generated by 18 a source language processor. 19 20 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 23 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 24 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 25 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 26 DEALINGS IN THE SOFTWARE. 27 */ 28 module bindbc.wgpu.funcs; 29 30 import core.stdc.stdint; 31 import bindbc.wgpu.types; 32 33 // this matches the test in wgpu sources guarding x11/wayland fns, which is: 34 // #[cfg(all( 35 // unix, 36 // not(target_os = "android"), 37 // not(target_os = "ios"), 38 // not(target_os = "macos") 39 // ))] 40 version(Posix) 41 { 42 version (Android) private enum have_xorg = false; 43 else version (OSX) private enum have_xorg = false; 44 else version (iOS) private enum have_xorg = false; 45 else private enum have_xorg = true; 46 } 47 else private enum have_xorg = false; 48 49 version (OSX) private enum have_metal = true; 50 else version (iOS) private enum have_metal = true; 51 else private enum have_metal = false; 52 53 __gshared 54 { 55 extern(C) @nogc nothrow: 56 57 alias da_wgpuCreateInstance = WGPUInstance function(const(WGPUInstanceDescriptor)* descriptor); 58 da_wgpuCreateInstance wgpuCreateInstance; 59 60 alias da_wgpuGetProcAddress = WGPUProc function(WGPUDevice device, const(char)* procName); 61 da_wgpuGetProcAddress wgpuGetProcAddress; 62 63 // Methods of Adapter 64 alias da_wgpuAdapterGetLimits = bool function(WGPUAdapter adapter, WGPUSupportedLimits* limits); 65 da_wgpuAdapterGetLimits wgpuAdapterGetLimits; 66 67 alias da_wgpuAdapterGetProperties = void function(WGPUAdapter adapter, WGPUAdapterProperties* properties); 68 da_wgpuAdapterGetProperties wgpuAdapterGetProperties; 69 70 alias da_wgpuAdapterHasFeature = bool function(WGPUAdapter adapter, WGPUFeatureName feature); 71 da_wgpuAdapterHasFeature wgpuAdapterHasFeature; 72 73 alias da_wgpuAdapterRequestDevice = void function(WGPUAdapter adapter, const(WGPUDeviceDescriptor)* descriptor, WGPURequestDeviceCallback callback, void* userdata); 74 da_wgpuAdapterRequestDevice wgpuAdapterRequestDevice; 75 76 // Methods of Buffer 77 alias da_wgpuBufferDestroy = void function(WGPUBuffer buffer); 78 da_wgpuBufferDestroy wgpuBufferDestroy; 79 80 alias da_wgpuBufferGetConstMappedRange = const(void)* function(WGPUBuffer buffer, size_t offset, size_t size); 81 da_wgpuBufferGetConstMappedRange wgpuBufferGetConstMappedRange; 82 83 alias da_wgpuBufferGetMappedRange = void* function(WGPUBuffer buffer, size_t offset, size_t size); 84 da_wgpuBufferGetMappedRange wgpuBufferGetMappedRange; 85 86 alias da_wgpuBufferMapAsync = void function(WGPUBuffer buffer, WGPUMapModeFlags mode, size_t offset, size_t size, WGPUBufferMapCallback callback, void* userdata); 87 da_wgpuBufferMapAsync wgpuBufferMapAsync; 88 89 alias da_wgpuBufferUnmap = void function(WGPUBuffer buffer); 90 da_wgpuBufferUnmap wgpuBufferUnmap; 91 92 // Methods of CommandEncoder 93 alias da_wgpuCommandEncoderBeginComputePass = WGPUComputePassEncoder function(WGPUCommandEncoder commandEncoder, const(WGPUComputePassDescriptor)* descriptor); 94 da_wgpuCommandEncoderBeginComputePass wgpuCommandEncoderBeginComputePass; 95 96 alias da_wgpuCommandEncoderBeginRenderPass = WGPURenderPassEncoder function(WGPUCommandEncoder commandEncoder, const(WGPURenderPassDescriptor)* descriptor); 97 da_wgpuCommandEncoderBeginRenderPass wgpuCommandEncoderBeginRenderPass; 98 99 alias da_wgpuCommandEncoderCopyBufferToBuffer = void function(WGPUCommandEncoder commandEncoder, WGPUBuffer source, ulong sourceOffset, WGPUBuffer destination, ulong destinationOffset, ulong size); 100 da_wgpuCommandEncoderCopyBufferToBuffer wgpuCommandEncoderCopyBufferToBuffer; 101 102 alias da_wgpuCommandEncoderCopyBufferToTexture = void function(WGPUCommandEncoder commandEncoder, const(WGPUImageCopyBuffer)* source, const(WGPUImageCopyTexture)* destination, const(WGPUExtent3D)* copySize); 103 da_wgpuCommandEncoderCopyBufferToTexture wgpuCommandEncoderCopyBufferToTexture; 104 105 alias da_wgpuCommandEncoderCopyTextureToBuffer = void function(WGPUCommandEncoder commandEncoder, const(WGPUImageCopyTexture)* source, const(WGPUImageCopyBuffer)* destination, const(WGPUExtent3D)* copySize); 106 da_wgpuCommandEncoderCopyTextureToBuffer wgpuCommandEncoderCopyTextureToBuffer; 107 108 alias da_wgpuCommandEncoderCopyTextureToTexture = void function(WGPUCommandEncoder commandEncoder, const(WGPUImageCopyTexture)* source, const(WGPUImageCopyTexture)* destination, const(WGPUExtent3D)* copySize); 109 da_wgpuCommandEncoderCopyTextureToTexture wgpuCommandEncoderCopyTextureToTexture; 110 111 alias da_wgpuCommandEncoderFinish = WGPUCommandBuffer function(WGPUCommandEncoder commandEncoder, const(WGPUCommandBufferDescriptor)* descriptor); 112 da_wgpuCommandEncoderFinish wgpuCommandEncoderFinish; 113 114 alias da_wgpuCommandEncoderInsertDebugMarker = void function(WGPUCommandEncoder commandEncoder, const(char)* markerLabel); 115 da_wgpuCommandEncoderInsertDebugMarker wgpuCommandEncoderInsertDebugMarker; 116 117 alias da_wgpuCommandEncoderPopDebugGroup = void function(WGPUCommandEncoder commandEncoder); 118 da_wgpuCommandEncoderPopDebugGroup wgpuCommandEncoderPopDebugGroup; 119 120 alias da_wgpuCommandEncoderPushDebugGroup = void function(WGPUCommandEncoder commandEncoder, const(char)* groupLabel); 121 da_wgpuCommandEncoderPushDebugGroup wgpuCommandEncoderPushDebugGroup; 122 123 alias da_wgpuCommandEncoderResolveQuerySet = void function(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint firstQuery, uint queryCount, WGPUBuffer destination, ulong destinationOffset); 124 da_wgpuCommandEncoderResolveQuerySet wgpuCommandEncoderResolveQuerySet; 125 126 alias da_wgpuCommandEncoderWriteTimestamp = void function(WGPUCommandEncoder commandEncoder, WGPUQuerySet querySet, uint queryIndex); 127 da_wgpuCommandEncoderWriteTimestamp wgpuCommandEncoderWriteTimestamp; 128 129 // Methods of ComputePassEncoder 130 alias da_wgpuComputePassEncoderBeginPipelineStatisticsQuery = void function(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint queryIndex); 131 da_wgpuComputePassEncoderBeginPipelineStatisticsQuery wgpuComputePassEncoderBeginPipelineStatisticsQuery; 132 133 alias da_wgpuComputePassEncoderDispatch = void function(WGPUComputePassEncoder computePassEncoder, uint x, uint y, uint z); 134 da_wgpuComputePassEncoderDispatch wgpuComputePassEncoderDispatch; 135 136 alias da_wgpuComputePassEncoderDispatchIndirect = void function(WGPUComputePassEncoder computePassEncoder, WGPUBuffer indirectBuffer, ulong indirectOffset); 137 da_wgpuComputePassEncoderDispatchIndirect wgpuComputePassEncoderDispatchIndirect; 138 139 alias da_wgpuComputePassEncoderEndPass = void function(WGPUComputePassEncoder computePassEncoder); 140 da_wgpuComputePassEncoderEndPass wgpuComputePassEncoderEndPass; 141 142 alias da_wgpuComputePassEncoderEndPipelineStatisticsQuery = void function(WGPUComputePassEncoder computePassEncoder); 143 da_wgpuComputePassEncoderEndPipelineStatisticsQuery wgpuComputePassEncoderEndPipelineStatisticsQuery; 144 145 alias da_wgpuComputePassEncoderInsertDebugMarker = void function(WGPUComputePassEncoder computePassEncoder, const(char)* markerLabel); 146 da_wgpuComputePassEncoderInsertDebugMarker wgpuComputePassEncoderInsertDebugMarker; 147 148 alias da_wgpuComputePassEncoderPopDebugGroup = void function(WGPUComputePassEncoder computePassEncoder); 149 da_wgpuComputePassEncoderPopDebugGroup wgpuComputePassEncoderPopDebugGroup; 150 151 alias da_wgpuComputePassEncoderPushDebugGroup = void function(WGPUComputePassEncoder computePassEncoder, const(char)* groupLabel); 152 da_wgpuComputePassEncoderPushDebugGroup wgpuComputePassEncoderPushDebugGroup; 153 154 alias da_wgpuComputePassEncoderSetBindGroup = void function(WGPUComputePassEncoder computePassEncoder, uint groupIndex, WGPUBindGroup group, uint dynamicOffsetCount, const(uint)* dynamicOffsets); 155 da_wgpuComputePassEncoderSetBindGroup wgpuComputePassEncoderSetBindGroup; 156 157 alias da_wgpuComputePassEncoderSetPipeline = void function(WGPUComputePassEncoder computePassEncoder, WGPUComputePipeline pipeline); 158 da_wgpuComputePassEncoderSetPipeline wgpuComputePassEncoderSetPipeline; 159 160 alias da_wgpuComputePassEncoderWriteTimestamp = void function(WGPUComputePassEncoder computePassEncoder, WGPUQuerySet querySet, uint queryIndex); 161 da_wgpuComputePassEncoderWriteTimestamp wgpuComputePassEncoderWriteTimestamp; 162 163 // Methods of ComputePipeline 164 alias da_wgpuComputePipelineGetBindGroupLayout = WGPUBindGroupLayout function(WGPUComputePipeline computePipeline, uint groupIndex); 165 da_wgpuComputePipelineGetBindGroupLayout wgpuComputePipelineGetBindGroupLayout; 166 167 alias da_wgpuComputePipelineSetLabel = void function(WGPUComputePipeline computePipeline, const(char)* label); 168 da_wgpuComputePipelineSetLabel wgpuComputePipelineSetLabel; 169 170 // Methods of Device 171 alias da_wgpuDeviceCreateBindGroup = WGPUBindGroup function(WGPUDevice device, const(WGPUBindGroupDescriptor)* descriptor); 172 da_wgpuDeviceCreateBindGroup wgpuDeviceCreateBindGroup; 173 174 alias da_wgpuDeviceCreateBindGroupLayout = WGPUBindGroupLayout function(WGPUDevice device, const(WGPUBindGroupLayoutDescriptor)* descriptor); 175 da_wgpuDeviceCreateBindGroupLayout wgpuDeviceCreateBindGroupLayout; 176 177 alias da_wgpuDeviceCreateBuffer = WGPUBuffer function(WGPUDevice device, const(WGPUBufferDescriptor)* descriptor); 178 da_wgpuDeviceCreateBuffer wgpuDeviceCreateBuffer; 179 180 alias da_wgpuDeviceCreateCommandEncoder = WGPUCommandEncoder function(WGPUDevice device, const(WGPUCommandEncoderDescriptor)* descriptor); 181 da_wgpuDeviceCreateCommandEncoder wgpuDeviceCreateCommandEncoder; 182 183 alias da_wgpuDeviceCreateComputePipeline = WGPUComputePipeline function(WGPUDevice device, const(WGPUComputePipelineDescriptor)* descriptor); 184 da_wgpuDeviceCreateComputePipeline wgpuDeviceCreateComputePipeline; 185 186 alias da_wgpuDeviceCreateComputePipelineAsync = void function(WGPUDevice device, const(WGPUComputePipelineDescriptor)* descriptor, WGPUCreateComputePipelineAsyncCallback callback, void* userdata); 187 da_wgpuDeviceCreateComputePipelineAsync wgpuDeviceCreateComputePipelineAsync; 188 189 alias da_wgpuDeviceCreatePipelineLayout = WGPUPipelineLayout function(WGPUDevice device, const(WGPUPipelineLayoutDescriptor)* descriptor); 190 da_wgpuDeviceCreatePipelineLayout wgpuDeviceCreatePipelineLayout; 191 192 alias da_wgpuDeviceCreateQuerySet = WGPUQuerySet function(WGPUDevice device, const(WGPUQuerySetDescriptor)* descriptor); 193 da_wgpuDeviceCreateQuerySet wgpuDeviceCreateQuerySet; 194 195 alias da_wgpuDeviceCreateRenderBundleEncoder = WGPURenderBundleEncoder function(WGPUDevice device, const(WGPURenderBundleEncoderDescriptor)* descriptor); 196 da_wgpuDeviceCreateRenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder; 197 198 alias da_wgpuDeviceCreateRenderPipeline = WGPURenderPipeline function(WGPUDevice device, const(WGPURenderPipelineDescriptor)* descriptor); 199 da_wgpuDeviceCreateRenderPipeline wgpuDeviceCreateRenderPipeline; 200 201 alias da_wgpuDeviceCreateRenderPipelineAsync = void function(WGPUDevice device, const(WGPURenderPipelineDescriptor)* descriptor, WGPUCreateRenderPipelineAsyncCallback callback, void* userdata); 202 da_wgpuDeviceCreateRenderPipelineAsync wgpuDeviceCreateRenderPipelineAsync; 203 204 alias da_wgpuDeviceCreateSampler = WGPUSampler function(WGPUDevice device, const(WGPUSamplerDescriptor)* descriptor); 205 da_wgpuDeviceCreateSampler wgpuDeviceCreateSampler; 206 207 alias da_wgpuDeviceCreateShaderModule = WGPUShaderModule function(WGPUDevice device, const(WGPUShaderModuleDescriptor)* descriptor); 208 da_wgpuDeviceCreateShaderModule wgpuDeviceCreateShaderModule; 209 210 alias da_wgpuDeviceCreateSwapChain = WGPUSwapChain function(WGPUDevice device, WGPUSurface surface, const(WGPUSwapChainDescriptor)* descriptor); 211 da_wgpuDeviceCreateSwapChain wgpuDeviceCreateSwapChain; 212 213 alias da_wgpuDeviceCreateTexture = WGPUTexture function(WGPUDevice device, const(WGPUTextureDescriptor)* descriptor); 214 da_wgpuDeviceCreateTexture wgpuDeviceCreateTexture; 215 216 alias da_wgpuDeviceDestroy = void function(WGPUDevice device); 217 da_wgpuDeviceDestroy wgpuDeviceDestroy; 218 219 alias da_wgpuDeviceGetLimits = void function(WGPUDevice device, WGPUSupportedLimits* limits); 220 da_wgpuDeviceGetLimits wgpuDeviceGetLimits; 221 222 alias da_wgpuDeviceGetQueue = WGPUQueue function(WGPUDevice device); 223 da_wgpuDeviceGetQueue wgpuDeviceGetQueue; 224 225 alias da_wgpuDevicePopErrorScope = bool function(WGPUDevice device, WGPUErrorCallback callback, void* userdata); 226 da_wgpuDevicePopErrorScope wgpuDevicePopErrorScope; 227 228 alias da_wgpuDevicePushErrorScope = void function(WGPUDevice device, WGPUErrorFilter filter); 229 da_wgpuDevicePushErrorScope wgpuDevicePushErrorScope; 230 231 alias da_wgpuDeviceSetDeviceLostCallback = void function(WGPUDevice device, WGPUDeviceLostCallback callback, void* userdata); 232 da_wgpuDeviceSetDeviceLostCallback wgpuDeviceSetDeviceLostCallback; 233 234 alias da_wgpuDeviceSetUncapturedErrorCallback = void function(WGPUDevice device, WGPUErrorCallback callback, void* userdata); 235 da_wgpuDeviceSetUncapturedErrorCallback wgpuDeviceSetUncapturedErrorCallback; 236 237 // Methods of Instance 238 alias da_wgpuInstanceCreateSurface = WGPUSurface function(WGPUInstance instance, const(WGPUSurfaceDescriptor)* descriptor); 239 da_wgpuInstanceCreateSurface wgpuInstanceCreateSurface; 240 241 alias da_wgpuInstanceProcessEvents = void function(WGPUInstance instance); 242 da_wgpuInstanceProcessEvents wgpuInstanceProcessEvents; 243 244 alias da_wgpuInstanceRequestAdapter = void function(WGPUInstance instance, const(WGPURequestAdapterOptions)* options, WGPURequestAdapterCallback callback, void* userdata); 245 da_wgpuInstanceRequestAdapter wgpuInstanceRequestAdapter; 246 247 // Methods of QuerySet 248 alias da_wgpuQuerySetDestroy = void function(WGPUQuerySet querySet); 249 da_wgpuQuerySetDestroy wgpuQuerySetDestroy; 250 251 // Methods of Queue 252 alias da_wgpuQueueOnSubmittedWorkDone = void function(WGPUQueue queue, ulong signalValue, WGPUQueueWorkDoneCallback callback, void* userdata); 253 da_wgpuQueueOnSubmittedWorkDone wgpuQueueOnSubmittedWorkDone; 254 255 alias da_wgpuQueueSubmit = void function(WGPUQueue queue, uint commandCount, const(WGPUCommandBuffer)* commands); 256 da_wgpuQueueSubmit wgpuQueueSubmit; 257 258 alias da_wgpuQueueWriteBuffer = void function(WGPUQueue queue, WGPUBuffer buffer, ulong bufferOffset, const(void)* data, size_t size); 259 da_wgpuQueueWriteBuffer wgpuQueueWriteBuffer; 260 261 alias da_wgpuQueueWriteTexture = void function(WGPUQueue queue, const(WGPUImageCopyTexture)* destination, const(void)* data, size_t dataSize, const(WGPUTextureDataLayout)* dataLayout, const(WGPUExtent3D)* writeSize); 262 da_wgpuQueueWriteTexture wgpuQueueWriteTexture; 263 264 // Methods of RenderBundleEncoder 265 alias da_wgpuRenderBundleEncoderDraw = void function(WGPURenderBundleEncoder renderBundleEncoder, uint vertexCount, uint instanceCount, uint firstVertex, uint firstInstance); 266 da_wgpuRenderBundleEncoderDraw wgpuRenderBundleEncoderDraw; 267 268 alias da_wgpuRenderBundleEncoderDrawIndexed = void function(WGPURenderBundleEncoder renderBundleEncoder, uint indexCount, uint instanceCount, uint firstIndex, int baseVertex, uint firstInstance); 269 da_wgpuRenderBundleEncoderDrawIndexed wgpuRenderBundleEncoderDrawIndexed; 270 271 alias da_wgpuRenderBundleEncoderDrawIndexedIndirect = void function(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, ulong indirectOffset); 272 da_wgpuRenderBundleEncoderDrawIndexedIndirect wgpuRenderBundleEncoderDrawIndexedIndirect; 273 274 alias da_wgpuRenderBundleEncoderDrawIndirect = void function(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer indirectBuffer, ulong indirectOffset); 275 da_wgpuRenderBundleEncoderDrawIndirect wgpuRenderBundleEncoderDrawIndirect; 276 277 alias da_wgpuRenderBundleEncoderFinish = WGPURenderBundle function(WGPURenderBundleEncoder renderBundleEncoder, const(WGPURenderBundleDescriptor)* descriptor); 278 da_wgpuRenderBundleEncoderFinish wgpuRenderBundleEncoderFinish; 279 280 alias da_wgpuRenderBundleEncoderInsertDebugMarker = void function(WGPURenderBundleEncoder renderBundleEncoder, const(char)* markerLabel); 281 da_wgpuRenderBundleEncoderInsertDebugMarker wgpuRenderBundleEncoderInsertDebugMarker; 282 283 alias da_wgpuRenderBundleEncoderPopDebugGroup = void function(WGPURenderBundleEncoder renderBundleEncoder); 284 da_wgpuRenderBundleEncoderPopDebugGroup wgpuRenderBundleEncoderPopDebugGroup; 285 286 alias da_wgpuRenderBundleEncoderPushDebugGroup = void function(WGPURenderBundleEncoder renderBundleEncoder, const(char)* groupLabel); 287 da_wgpuRenderBundleEncoderPushDebugGroup wgpuRenderBundleEncoderPushDebugGroup; 288 289 alias da_wgpuRenderBundleEncoderSetBindGroup = void function(WGPURenderBundleEncoder renderBundleEncoder, uint groupIndex, WGPUBindGroup group, uint dynamicOffsetCount, const(uint)* dynamicOffsets); 290 da_wgpuRenderBundleEncoderSetBindGroup wgpuRenderBundleEncoderSetBindGroup; 291 292 alias da_wgpuRenderBundleEncoderSetIndexBuffer = void function(WGPURenderBundleEncoder renderBundleEncoder, WGPUBuffer buffer, WGPUIndexFormat format, ulong offset, ulong size); 293 da_wgpuRenderBundleEncoderSetIndexBuffer wgpuRenderBundleEncoderSetIndexBuffer; 294 295 alias da_wgpuRenderBundleEncoderSetPipeline = void function(WGPURenderBundleEncoder renderBundleEncoder, WGPURenderPipeline pipeline); 296 da_wgpuRenderBundleEncoderSetPipeline wgpuRenderBundleEncoderSetPipeline; 297 298 alias da_wgpuRenderBundleEncoderSetVertexBuffer = void function(WGPURenderBundleEncoder renderBundleEncoder, uint slot, WGPUBuffer buffer, ulong offset, ulong size); 299 da_wgpuRenderBundleEncoderSetVertexBuffer wgpuRenderBundleEncoderSetVertexBuffer; 300 301 // Methods of RenderPassEncoder 302 alias da_wgpuRenderPassEncoderBeginOcclusionQuery = void function(WGPURenderPassEncoder renderPassEncoder, uint queryIndex); 303 da_wgpuRenderPassEncoderBeginOcclusionQuery wgpuRenderPassEncoderBeginOcclusionQuery; 304 305 alias da_wgpuRenderPassEncoderBeginPipelineStatisticsQuery = void function(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint queryIndex); 306 da_wgpuRenderPassEncoderBeginPipelineStatisticsQuery wgpuRenderPassEncoderBeginPipelineStatisticsQuery; 307 308 alias da_wgpuRenderPassEncoderDraw = void function(WGPURenderPassEncoder renderPassEncoder, uint vertexCount, uint instanceCount, uint firstVertex, uint firstInstance); 309 da_wgpuRenderPassEncoderDraw wgpuRenderPassEncoderDraw; 310 311 alias da_wgpuRenderPassEncoderDrawIndexed = void function(WGPURenderPassEncoder renderPassEncoder, uint indexCount, uint instanceCount, uint firstIndex, int baseVertex, uint firstInstance); 312 da_wgpuRenderPassEncoderDrawIndexed wgpuRenderPassEncoderDrawIndexed; 313 314 alias da_wgpuRenderPassEncoderDrawIndexedIndirect = void function(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, ulong indirectOffset); 315 da_wgpuRenderPassEncoderDrawIndexedIndirect wgpuRenderPassEncoderDrawIndexedIndirect; 316 317 alias da_wgpuRenderPassEncoderDrawIndirect = void function(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer indirectBuffer, ulong indirectOffset); 318 da_wgpuRenderPassEncoderDrawIndirect wgpuRenderPassEncoderDrawIndirect; 319 320 alias da_wgpuRenderPassEncoderEndOcclusionQuery = void function(WGPURenderPassEncoder renderPassEncoder); 321 da_wgpuRenderPassEncoderEndOcclusionQuery wgpuRenderPassEncoderEndOcclusionQuery; 322 323 alias da_wgpuRenderPassEncoderEndPass = void function(WGPURenderPassEncoder renderPassEncoder); 324 da_wgpuRenderPassEncoderEndPass wgpuRenderPassEncoderEndPass; 325 326 alias da_wgpuRenderPassEncoderEndPipelineStatisticsQuery = void function(WGPURenderPassEncoder renderPassEncoder); 327 da_wgpuRenderPassEncoderEndPipelineStatisticsQuery wgpuRenderPassEncoderEndPipelineStatisticsQuery; 328 329 alias da_wgpuRenderPassEncoderExecuteBundles = void function(WGPURenderPassEncoder renderPassEncoder, uint bundlesCount, const(WGPURenderBundle)* bundles); 330 da_wgpuRenderPassEncoderExecuteBundles wgpuRenderPassEncoderExecuteBundles; 331 332 alias da_wgpuRenderPassEncoderInsertDebugMarker = void function(WGPURenderPassEncoder renderPassEncoder, const(char)* markerLabel); 333 da_wgpuRenderPassEncoderInsertDebugMarker wgpuRenderPassEncoderInsertDebugMarker; 334 335 alias da_wgpuRenderPassEncoderPopDebugGroup = void function(WGPURenderPassEncoder renderPassEncoder); 336 da_wgpuRenderPassEncoderPopDebugGroup wgpuRenderPassEncoderPopDebugGroup; 337 338 alias da_wgpuRenderPassEncoderPushDebugGroup = void function(WGPURenderPassEncoder renderPassEncoder, const(char)* groupLabel); 339 da_wgpuRenderPassEncoderPushDebugGroup wgpuRenderPassEncoderPushDebugGroup; 340 341 alias da_wgpuRenderPassEncoderSetBindGroup = void function(WGPURenderPassEncoder renderPassEncoder, uint groupIndex, WGPUBindGroup group, uint dynamicOffsetCount, const(uint)* dynamicOffsets); 342 da_wgpuRenderPassEncoderSetBindGroup wgpuRenderPassEncoderSetBindGroup; 343 344 alias da_wgpuRenderPassEncoderSetBlendConstant = void function(WGPURenderPassEncoder renderPassEncoder, const(WGPUColor)* color); 345 da_wgpuRenderPassEncoderSetBlendConstant wgpuRenderPassEncoderSetBlendConstant; 346 347 alias da_wgpuRenderPassEncoderSetIndexBuffer = void function(WGPURenderPassEncoder renderPassEncoder, WGPUBuffer buffer, WGPUIndexFormat format, ulong offset, ulong size); 348 da_wgpuRenderPassEncoderSetIndexBuffer wgpuRenderPassEncoderSetIndexBuffer; 349 350 alias da_wgpuRenderPassEncoderSetPipeline = void function(WGPURenderPassEncoder renderPassEncoder, WGPURenderPipeline pipeline); 351 da_wgpuRenderPassEncoderSetPipeline wgpuRenderPassEncoderSetPipeline; 352 353 alias da_wgpuRenderPassEncoderSetScissorRect = void function(WGPURenderPassEncoder renderPassEncoder, uint x, uint y, uint width, uint height); 354 da_wgpuRenderPassEncoderSetScissorRect wgpuRenderPassEncoderSetScissorRect; 355 356 alias da_wgpuRenderPassEncoderSetStencilReference = void function(WGPURenderPassEncoder renderPassEncoder, uint reference); 357 da_wgpuRenderPassEncoderSetStencilReference wgpuRenderPassEncoderSetStencilReference; 358 359 alias da_wgpuRenderPassEncoderSetVertexBuffer = void function(WGPURenderPassEncoder renderPassEncoder, uint slot, WGPUBuffer buffer, ulong offset, ulong size); 360 da_wgpuRenderPassEncoderSetVertexBuffer wgpuRenderPassEncoderSetVertexBuffer; 361 362 alias da_wgpuRenderPassEncoderSetViewport = void function(WGPURenderPassEncoder renderPassEncoder, float x, float y, float width, float height, float minDepth, float maxDepth); 363 da_wgpuRenderPassEncoderSetViewport wgpuRenderPassEncoderSetViewport; 364 365 alias da_wgpuRenderPassEncoderWriteTimestamp = void function(WGPURenderPassEncoder renderPassEncoder, WGPUQuerySet querySet, uint queryIndex); 366 da_wgpuRenderPassEncoderWriteTimestamp wgpuRenderPassEncoderWriteTimestamp; 367 368 // Methods of RenderPipeline 369 alias da_wgpuRenderPipelineGetBindGroupLayout = WGPUBindGroupLayout function(WGPURenderPipeline renderPipeline, uint groupIndex); 370 da_wgpuRenderPipelineGetBindGroupLayout wgpuRenderPipelineGetBindGroupLayout; 371 372 alias da_wgpuRenderPipelineSetLabel = void function(WGPURenderPipeline renderPipeline, const(char)* label); 373 da_wgpuRenderPipelineSetLabel wgpuRenderPipelineSetLabel; 374 375 // Methods of ShaderModule 376 alias da_wgpuShaderModuleSetLabel = void function(WGPUShaderModule shaderModule, const(char)* label); 377 da_wgpuShaderModuleSetLabel wgpuShaderModuleSetLabel; 378 379 // Methods of Surface 380 alias da_wgpuSurfaceGetPreferredFormat = WGPUTextureFormat function(WGPUSurface surface, WGPUAdapter adapter); 381 da_wgpuSurfaceGetPreferredFormat wgpuSurfaceGetPreferredFormat; 382 383 // Methods of SwapChain 384 alias da_wgpuSwapChainGetCurrentTextureView = WGPUTextureView function(WGPUSwapChain swapChain); 385 da_wgpuSwapChainGetCurrentTextureView wgpuSwapChainGetCurrentTextureView; 386 387 alias da_wgpuSwapChainPresent = void function(WGPUSwapChain swapChain); 388 da_wgpuSwapChainPresent wgpuSwapChainPresent; 389 390 // Methods of Texture 391 alias da_wgpuTextureCreateView = WGPUTextureView function(WGPUTexture texture, const(WGPUTextureViewDescriptor)* descriptor); 392 da_wgpuTextureCreateView wgpuTextureCreateView; 393 394 alias da_wgpuTextureDestroy = void function(WGPUTexture texture); 395 da_wgpuTextureDestroy wgpuTextureDestroy; 396 397 // 398 alias da_wgpuDevicePoll = void function(WGPUDevice device, bool force_wait); 399 da_wgpuDevicePoll wgpuDevicePoll; 400 401 alias da_wgpuSetLogCallback = void function(WGPULogCallback callback); 402 da_wgpuSetLogCallback wgpuSetLogCallback; 403 404 alias da_wgpuSetLogLevel = void function(WGPULogLevel level); 405 da_wgpuSetLogLevel wgpuSetLogLevel; 406 407 alias da_wgpuGetVersion = uint function(); 408 da_wgpuGetVersion wgpuGetVersion; 409 410 alias da_wgpuRenderPassEncoderSetPushConstants = void function(WGPURenderPassEncoder encoder, WGPUShaderStage stages, uint offset, uint sizeBytes, const(void)* data); 411 da_wgpuRenderPassEncoderSetPushConstants wgpuRenderPassEncoderSetPushConstants; 412 413 alias da_wgpuBufferDrop = void function(WGPUBuffer buffer); 414 da_wgpuBufferDrop wgpuBufferDrop; 415 416 alias da_wgpuCommandEncoderDrop = void function(WGPUCommandEncoder commandEncoder); 417 da_wgpuCommandEncoderDrop wgpuCommandEncoderDrop; 418 419 alias da_wgpuDeviceDrop = void function(WGPUDevice device); 420 da_wgpuDeviceDrop wgpuDeviceDrop; 421 422 alias da_wgpuQuerySetDrop = void function(WGPUQuerySet querySet); 423 da_wgpuQuerySetDrop wgpuQuerySetDrop; 424 425 alias da_wgpuRenderPipelineDrop = void function(WGPURenderPipeline renderPipeline); 426 da_wgpuRenderPipelineDrop wgpuRenderPipelineDrop; 427 428 alias da_wgpuTextureDrop = void function(WGPUTexture texture); 429 da_wgpuTextureDrop wgpuTextureDrop; 430 431 alias da_wgpuTextureViewDrop = void function(WGPUTextureView textureView); 432 da_wgpuTextureViewDrop wgpuTextureViewDrop; 433 434 alias da_wgpuSamplerDrop = void function(WGPUSampler sampler); 435 da_wgpuSamplerDrop wgpuSamplerDrop; 436 437 alias da_wgpuBindGroupLayoutDrop = void function(WGPUBindGroupLayout bindGroupLayout); 438 da_wgpuBindGroupLayoutDrop wgpuBindGroupLayoutDrop; 439 440 alias da_wgpuPipelineLayoutDrop = void function(WGPUPipelineLayout pipelineLayout); 441 da_wgpuPipelineLayoutDrop wgpuPipelineLayoutDrop; 442 443 alias da_wgpuBindGroupDrop = void function(WGPUBindGroup bindGroup); 444 da_wgpuBindGroupDrop wgpuBindGroupDrop; 445 446 alias da_wgpuShaderModuleDrop = void function(WGPUShaderModule shaderModule); 447 da_wgpuShaderModuleDrop wgpuShaderModuleDrop; 448 449 alias da_wgpuCommandBufferDrop = void function(WGPUCommandBuffer commandBuffer); 450 da_wgpuCommandBufferDrop wgpuCommandBufferDrop; 451 452 alias da_wgpuRenderBundleDrop = void function(WGPURenderBundle renderBundle); 453 da_wgpuRenderBundleDrop wgpuRenderBundleDrop; 454 455 alias da_wgpuComputePipelineDrop = void function(WGPUComputePipeline computePipeline); 456 da_wgpuComputePipelineDrop wgpuComputePipelineDrop; 457 }