1 /* 2 Copyright (c) 2019-2023 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 import bindbc.wgpu.types2; 33 34 /* 35 * Function definitions from webgpu.h 36 */ 37 38 __gshared 39 { 40 WGPUProcCreateInstance wgpuCreateInstance; 41 WGPUProcGetProcAddress wgpuGetProcAddress; 42 43 // Methods of Adapter 44 WGPUProcAdapterEnumerateFeatures wgpuAdapterEnumerateFeatures; 45 WGPUProcAdapterGetLimits wgpuAdapterGetLimits; 46 WGPUProcAdapterGetProperties wgpuAdapterGetProperties; 47 WGPUProcAdapterHasFeature wgpuAdapterHasFeature; 48 WGPUProcAdapterRequestDevice wgpuAdapterRequestDevice; 49 WGPUProcAdapterReference wgpuAdapterReference; 50 WGPUProcAdapterRelease wgpuAdapterRelease; 51 52 // Methods of BindGroup 53 WGPUProcBindGroupSetLabel wgpuBindGroupSetLabel; 54 WGPUProcBindGroupReference wgpuBindGroupReference; 55 WGPUProcBindGroupRelease wgpuBindGroupRelease; 56 57 // Methods of BindGroupLayout 58 WGPUProcBindGroupLayoutSetLabel wgpuBindGroupLayoutSetLabel; 59 WGPUProcBindGroupLayoutReference wgpuBindGroupLayoutReference; 60 WGPUProcBindGroupLayoutRelease wgpuBindGroupLayoutRelease; 61 62 // Methods of Buffer 63 WGPUProcBufferDestroy wgpuBufferDestroy; 64 WGPUProcBufferGetConstMappedRange wgpuBufferGetConstMappedRange; 65 WGPUProcBufferGetMapState wgpuBufferGetMapState; 66 WGPUProcBufferGetMappedRange wgpuBufferGetMappedRange; 67 WGPUProcBufferGetSize wgpuBufferGetSize; 68 WGPUProcBufferGetUsage wgpuBufferGetUsage; 69 WGPUProcBufferMapAsync wgpuBufferMapAsync; 70 WGPUProcBufferSetLabel wgpuBufferSetLabel; 71 WGPUProcBufferUnmap wgpuBufferUnmap; 72 WGPUProcBufferReference wgpuBufferReference; 73 WGPUProcBufferRelease wgpuBufferRelease; 74 75 // Methods of CommandBuffer 76 WGPUProcCommandBufferSetLabel wgpuCommandBufferSetLabel; 77 WGPUProcCommandBufferReference wgpuCommandBufferReference; 78 WGPUProcCommandBufferRelease wgpuCommandBufferRelease; 79 80 // Methods of CommandEncoder 81 WGPUProcCommandEncoderBeginComputePass wgpuCommandEncoderBeginComputePass; 82 WGPUProcCommandEncoderBeginRenderPass wgpuCommandEncoderBeginRenderPass; 83 WGPUProcCommandEncoderClearBuffer wgpuCommandEncoderClearBuffer; 84 WGPUProcCommandEncoderCopyBufferToBuffer wgpuCommandEncoderCopyBufferToBuffer; 85 WGPUProcCommandEncoderCopyBufferToTexture wgpuCommandEncoderCopyBufferToTexture; 86 WGPUProcCommandEncoderCopyTextureToBuffer wgpuCommandEncoderCopyTextureToBuffer; 87 WGPUProcCommandEncoderCopyTextureToTexture wgpuCommandEncoderCopyTextureToTexture; 88 WGPUProcCommandEncoderFinish wgpuCommandEncoderFinish; 89 WGPUProcCommandEncoderInsertDebugMarker wgpuCommandEncoderInsertDebugMarker; 90 WGPUProcCommandEncoderPopDebugGroup wgpuCommandEncoderPopDebugGroup; 91 WGPUProcCommandEncoderPushDebugGroup wgpuCommandEncoderPushDebugGroup; 92 WGPUProcCommandEncoderResolveQuerySet wgpuCommandEncoderResolveQuerySet; 93 WGPUProcCommandEncoderSetLabel wgpuCommandEncoderSetLabel; 94 WGPUProcCommandEncoderWriteTimestamp wgpuCommandEncoderWriteTimestamp; 95 WGPUProcCommandEncoderReference wgpuCommandEncoderReference; 96 WGPUProcCommandEncoderRelease wgpuCommandEncoderRelease; 97 98 // Methods of ComputePassEncoder 99 WGPUProcComputePassEncoderDispatchWorkgroups wgpuComputePassEncoderDispatchWorkgroups; 100 WGPUProcComputePassEncoderDispatchWorkgroupsIndirect wgpuComputePassEncoderDispatchWorkgroupsIndirect; 101 WGPUProcComputePassEncoderEnd wgpuComputePassEncoderEnd; 102 WGPUProcComputePassEncoderInsertDebugMarker wgpuComputePassEncoderInsertDebugMarker; 103 WGPUProcComputePassEncoderPopDebugGroup wgpuComputePassEncoderPopDebugGroup; 104 WGPUProcComputePassEncoderPushDebugGroup wgpuComputePassEncoderPushDebugGroup; 105 WGPUProcComputePassEncoderSetBindGroup wgpuComputePassEncoderSetBindGroup; 106 WGPUProcComputePassEncoderSetLabel wgpuComputePassEncoderSetLabel; 107 WGPUProcComputePassEncoderSetPipeline wgpuComputePassEncoderSetPipeline; 108 WGPUProcComputePassEncoderReference wgpuComputePassEncoderReference; 109 WGPUProcComputePassEncoderRelease wgpuComputePassEncoderRelease; 110 111 // Methods of ComputePipeline 112 WGPUProcComputePipelineGetBindGroupLayout wgpuComputePipelineGetBindGroupLayout; 113 WGPUProcComputePipelineSetLabel wgpuComputePipelineSetLabel; 114 WGPUProcComputePipelineReference wgpuComputePipelineReference; 115 WGPUProcComputePipelineRelease wgpuComputePipelineRelease; 116 117 // Methods of Device 118 WGPUProcDeviceCreateBindGroup wgpuDeviceCreateBindGroup; 119 WGPUProcDeviceCreateBindGroupLayout wgpuDeviceCreateBindGroupLayout; 120 WGPUProcDeviceCreateBuffer wgpuDeviceCreateBuffer; 121 WGPUProcDeviceCreateCommandEncoder wgpuDeviceCreateCommandEncoder; 122 WGPUProcDeviceCreateComputePipeline wgpuDeviceCreateComputePipeline; 123 WGPUProcDeviceCreateComputePipelineAsync wgpuDeviceCreateComputePipelineAsync; 124 WGPUProcDeviceCreatePipelineLayout wgpuDeviceCreatePipelineLayout; 125 WGPUProcDeviceCreateQuerySet wgpuDeviceCreateQuerySet; 126 WGPUProcDeviceCreateRenderBundleEncoder wgpuDeviceCreateRenderBundleEncoder; 127 WGPUProcDeviceCreateRenderPipeline wgpuDeviceCreateRenderPipeline; 128 WGPUProcDeviceCreateRenderPipelineAsync wgpuDeviceCreateRenderPipelineAsync; 129 WGPUProcDeviceCreateSampler wgpuDeviceCreateSampler; 130 WGPUProcDeviceCreateShaderModule wgpuDeviceCreateShaderModule; 131 WGPUProcDeviceCreateTexture wgpuDeviceCreateTexture; 132 WGPUProcDeviceDestroy wgpuDeviceDestroy; 133 WGPUProcDeviceEnumerateFeatures wgpuDeviceEnumerateFeatures; 134 WGPUProcDeviceGetLimits wgpuDeviceGetLimits; 135 WGPUProcDeviceGetQueue wgpuDeviceGetQueue; 136 WGPUProcDeviceHasFeature wgpuDeviceHasFeature; 137 WGPUProcDevicePopErrorScope wgpuDevicePopErrorScope; 138 WGPUProcDevicePushErrorScope wgpuDevicePushErrorScope; 139 //WGPUProcDeviceSetDeviceLostCallback wgpuDeviceSetDeviceLostCallback; 140 WGPUProcDeviceSetLabel wgpuDeviceSetLabel; 141 WGPUProcDeviceSetUncapturedErrorCallback wgpuDeviceSetUncapturedErrorCallback; 142 WGPUProcDeviceReference wgpuDeviceReference; 143 WGPUProcDeviceRelease wgpuDeviceRelease; 144 145 // Methods of Instance 146 WGPUProcInstanceCreateSurface wgpuInstanceCreateSurface; 147 WGPUProcInstanceProcessEvents wgpuInstanceProcessEvents; 148 WGPUProcInstanceRequestAdapter wgpuInstanceRequestAdapter; 149 WGPUProcInstanceReference wgpuInstanceReference; 150 WGPUProcInstanceRelease wgpuInstanceRelease; 151 152 // Methods of PipelineLayout 153 WGPUProcPipelineLayoutSetLabel wgpuPipelineLayoutSetLabel; 154 WGPUProcPipelineLayoutReference wgpuPipelineLayoutReference; 155 WGPUProcPipelineLayoutRelease wgpuPipelineLayoutRelease; 156 157 // Methods of QuerySet 158 WGPUProcQuerySetDestroy wgpuQuerySetDestroy; 159 WGPUProcQuerySetGetCount wgpuQuerySetGetCount; 160 WGPUProcQuerySetGetType wgpuQuerySetGetType; 161 WGPUProcQuerySetSetLabel wgpuQuerySetSetLabel; 162 WGPUProcQuerySetReference wgpuQuerySetReference; 163 WGPUProcQuerySetRelease wgpuQuerySetRelease; 164 165 // Methods of Queue 166 WGPUProcQueueOnSubmittedWorkDone wgpuQueueOnSubmittedWorkDone; 167 WGPUProcQueueSetLabel wgpuQueueSetLabel; 168 WGPUProcQueueSubmit wgpuQueueSubmit; 169 WGPUProcQueueWriteBuffer wgpuQueueWriteBuffer; 170 WGPUProcQueueWriteTexture wgpuQueueWriteTexture; 171 WGPUProcQueueReference wgpuQueueReference; 172 WGPUProcQueueRelease wgpuQueueRelease; 173 174 // Methods of RenderBundleEncoder 175 WGPUProcRenderBundleSetLabel wgpuRenderBundleSetLabel; 176 WGPUProcRenderBundleReference wgpuRenderBundleReference; 177 WGPUProcRenderBundleRelease wgpuRenderBundleRelease; 178 179 // Methods of RenderBundleEncoder 180 WGPUProcRenderBundleEncoderDraw wgpuRenderBundleEncoderDraw; 181 WGPUProcRenderBundleEncoderDrawIndexed wgpuRenderBundleEncoderDrawIndexed; 182 WGPUProcRenderBundleEncoderDrawIndexedIndirect wgpuRenderBundleEncoderDrawIndexedIndirect; 183 WGPUProcRenderBundleEncoderDrawIndirect wgpuRenderBundleEncoderDrawIndirect; 184 WGPUProcRenderBundleEncoderFinish wgpuRenderBundleEncoderFinish; 185 WGPUProcRenderBundleEncoderInsertDebugMarker wgpuRenderBundleEncoderInsertDebugMarker; 186 WGPUProcRenderBundleEncoderPopDebugGroup wgpuRenderBundleEncoderPopDebugGroup; 187 WGPUProcRenderBundleEncoderPushDebugGroup wgpuRenderBundleEncoderPushDebugGroup; 188 WGPUProcRenderBundleEncoderSetBindGroup wgpuRenderBundleEncoderSetBindGroup; 189 WGPUProcRenderBundleEncoderSetIndexBuffer wgpuRenderBundleEncoderSetIndexBuffer; 190 WGPUProcRenderBundleEncoderSetLabel wgpuRenderBundleEncoderSetLabel; 191 WGPUProcRenderBundleEncoderSetPipeline wgpuRenderBundleEncoderSetPipeline; 192 WGPUProcRenderBundleEncoderSetVertexBuffer wgpuRenderBundleEncoderSetVertexBuffer; 193 WGPUProcRenderBundleEncoderReference wgpuRenderBundleEncoderReference; 194 WGPUProcRenderBundleEncoderRelease wgpuRenderBundleEncoderRelease; 195 196 // Methods of RenderPassEncoder 197 WGPUProcRenderPassEncoderBeginOcclusionQuery wgpuRenderPassEncoderBeginOcclusionQuery; 198 WGPUProcRenderPassEncoderDraw wgpuRenderPassEncoderDraw; 199 WGPUProcRenderPassEncoderDrawIndexed wgpuRenderPassEncoderDrawIndexed; 200 WGPUProcRenderPassEncoderDrawIndexedIndirect wgpuRenderPassEncoderDrawIndexedIndirect; 201 WGPUProcRenderPassEncoderDrawIndirect wgpuRenderPassEncoderDrawIndirect; 202 WGPUProcRenderPassEncoderEnd wgpuRenderPassEncoderEnd; 203 WGPUProcRenderPassEncoderEndOcclusionQuery wgpuRenderPassEncoderEndOcclusionQuery; 204 WGPUProcRenderPassEncoderExecuteBundles wgpuRenderPassEncoderExecuteBundles; 205 WGPUProcRenderPassEncoderInsertDebugMarker wgpuRenderPassEncoderInsertDebugMarker; 206 WGPUProcRenderPassEncoderPopDebugGroup wgpuRenderPassEncoderPopDebugGroup; 207 WGPUProcRenderPassEncoderPushDebugGroup wgpuRenderPassEncoderPushDebugGroup; 208 WGPUProcRenderPassEncoderSetBindGroup wgpuRenderPassEncoderSetBindGroup; 209 WGPUProcRenderPassEncoderSetBlendConstant wgpuRenderPassEncoderSetBlendConstant; 210 WGPUProcRenderPassEncoderSetIndexBuffer wgpuRenderPassEncoderSetIndexBuffer; 211 WGPUProcRenderPassEncoderSetLabel wgpuRenderPassEncoderSetLabel; 212 WGPUProcRenderPassEncoderSetPipeline wgpuRenderPassEncoderSetPipeline; 213 WGPUProcRenderPassEncoderSetScissorRect wgpuRenderPassEncoderSetScissorRect; 214 WGPUProcRenderPassEncoderSetStencilReference wgpuRenderPassEncoderSetStencilReference; 215 WGPUProcRenderPassEncoderSetVertexBuffer wgpuRenderPassEncoderSetVertexBuffer; 216 WGPUProcRenderPassEncoderSetViewport wgpuRenderPassEncoderSetViewport; 217 WGPUProcRenderPassEncoderReference wgpuRenderPassEncoderReference; 218 WGPUProcRenderPassEncoderRelease wgpuRenderPassEncoderRelease; 219 220 // Methods of RenderPipeline 221 WGPUProcRenderPipelineGetBindGroupLayout wgpuRenderPipelineGetBindGroupLayout; 222 WGPUProcRenderPipelineSetLabel wgpuRenderPipelineSetLabel; 223 WGPUProcRenderPipelineReference wgpuRenderPipelineReference; 224 WGPUProcRenderPipelineRelease wgpuRenderPipelineRelease; 225 226 // Methods of Sampler 227 WGPUProcSamplerSetLabel wgpuSamplerSetLabel; 228 WGPUProcSamplerReference wgpuSamplerReference; 229 WGPUProcSamplerRelease wgpuSamplerRelease; 230 231 // Methods of ShaderModule 232 WGPUProcShaderModuleGetCompilationInfo wgpuShaderModuleGetCompilationInfo; 233 WGPUProcShaderModuleSetLabel wgpuShaderModuleSetLabel; 234 WGPUProcShaderModuleReference wgpuShaderModuleReference; 235 WGPUProcShaderModuleRelease wgpuShaderModuleRelease; 236 237 // Methods of Surface 238 WGPUProcSurfaceConfigure wgpuSurfaceConfigure; 239 WGPUProcSurfaceGetCapabilities wgpuSurfaceGetCapabilities; 240 WGPUProcSurfaceGetCurrentTexture wgpuSurfaceGetCurrentTexture; 241 WGPUProcSurfaceGetPreferredFormat wgpuSurfaceGetPreferredFormat; 242 WGPUProcSurfacePresent wgpuSurfacePresent; 243 WGPUProcSurfaceUnconfigure wgpuSurfaceUnconfigure; 244 WGPUProcSurfaceReference wgpuSurfaceReference; 245 WGPUProcSurfaceRelease wgpuSurfaceRelease; 246 247 // Methods of SurfaceCapabilities 248 WGPUProcSurfaceCapabilitiesFreeMembers wgpuSurfaceCapabilitiesFreeMembers; 249 250 // Methods of Texture 251 WGPUProcTextureCreateView wgpuTextureCreateView; 252 WGPUProcTextureDestroy wgpuTextureDestroy; 253 WGPUProcTextureGetDepthOrArrayLayers wgpuTextureGetDepthOrArrayLayers; 254 WGPUProcTextureGetDimension wgpuTextureGetDimension; 255 WGPUProcTextureGetFormat wgpuTextureGetFormat; 256 WGPUProcTextureGetHeight wgpuTextureGetHeight; 257 WGPUProcTextureGetMipLevelCount wgpuTextureGetMipLevelCount; 258 WGPUProcTextureGetSampleCount wgpuTextureGetSampleCount; 259 WGPUProcTextureGetUsage wgpuTextureGetUsage; 260 WGPUProcTextureGetWidth wgpuTextureGetWidth; 261 WGPUProcTextureSetLabel wgpuTextureSetLabel; 262 WGPUProcTextureReference wgpuTextureReference; 263 WGPUProcTextureRelease wgpuTextureRelease; 264 265 // Methods of TextureView 266 WGPUProcTextureViewSetLabel wgpuTextureViewSetLabel; 267 WGPUProcTextureViewReference wgpuTextureViewReference; 268 WGPUProcTextureViewRelease wgpuTextureViewRelease; 269 270 // 271 WGPUProcGenerateReport wgpuGenerateReport; 272 WGPUProcInstanceEnumerateAdapters wgpuInstanceEnumerateAdapters; 273 WGPUProcQueueSubmitForIndex wgpuQueueSubmitForIndex; 274 WGPUProcDevicePoll wgpuDevicePoll; 275 WGPUProcSetLogCallback wgpuSetLogCallback; 276 WGPUProcSetLogLevel wgpuSetLogLevel; 277 WGPUProcGetVersion wgpuGetVersion; 278 WGPUProcRenderPassEncoderSetPushConstants wgpuRenderPassEncoderSetPushConstants; 279 WGPUProcRenderPassEncoderMultiDrawIndirect wgpuRenderPassEncoderMultiDrawIndirect; 280 WGPUProcRenderPassEncoderMultiDrawIndexedIndirect wgpuRenderPassEncoderMultiDrawIndexedIndirect; 281 WGPUProcRenderPassEncoderMultiDrawIndirectCount wgpuRenderPassEncoderMultiDrawIndirectCount; 282 WGPUProcRenderPassEncoderMultiDrawIndexedIndirectCount wgpuRenderPassEncoderMultiDrawIndexedIndirectCount; 283 WGPUProcComputePassEncoderBeginPipelineStatisticsQuery wgpuComputePassEncoderBeginPipelineStatisticsQuery; 284 WGPUProcComputePassEncoderEndPipelineStatisticsQuery wgpuComputePassEncoderEndPipelineStatisticsQuery; 285 WGPUProcRenderPassEncoderBeginPipelineStatisticsQuery wgpuRenderPassEncoderBeginPipelineStatisticsQuery; 286 WGPUProcRenderPassEncoderEndPipelineStatisticsQuery wgpuRenderPassEncoderEndPipelineStatisticsQuery; 287 }