GPUDeviceManager constructor
parameters used to create this GPUDeviceManager
Number of times a GPUDevice has been created
The label of the GPUDeviceManager, used to create the GPUDevice for debugging purpose
Flag indicating whether we're running the production mode or not. If not, useful warnings could be logged to the console
The navigator GPU object
The WebGPU GPUAdapter | adapter used
Additional options to use when requesting an GPUAdapter | adapter
The WebGPU GPUDevice | device used
Flag indicating whether the GPUDeviceManager is ready, i.e. its adapter and device have been successfully created
The PipelineManager used to cache GPURenderPipeline and GPUComputePipeline and set them only when appropriate
Array of renderers using that GPUDeviceManager
A Map containing all our created AllowedBindGroups
An array containing all our created GPUBuffer
A Map containing all our created GPUBindGroupLayout indexed by cache keys
A Map containing all our created BufferBinding indexed by cache keys
An array containing all our created Sampler
An array containing all our created DOMTexture
An array to keep track of the newly uploaded DOMTexture and set their sourceUploaded property
Callback to run if there's any error while trying to set up the GPUAdapter | adapter or GPUDevice | device
Callback to run if there's any error while trying to set up the GPUAdapter | adapter or GPUDevice | device
Callback to run whenever the device is lost.
Callback to run whenever the device is lost.
Optional
info: GPUDeviceLostInfoCallback to run whenever the device has been intentionally destroyed.
Callback to run whenever the device has been intentionally destroyed.
Optional
info: GPUDeviceLostInfoGet all the rendered objects (i.e. compute passes, meshes, ping pong planes and shader passes) created by this GPUDeviceManager
GPUAdapter and/or GPUDevice to use if set.
GPUAdapter and/or GPUDevice to use if set.
Set our pipeline manager
Called when the device is lost. Reset all our renderers
Called when the device should be restored. Restore all our renderers.
GPUAdapter and/or GPUDevice to use if set.
Add a bind group to our bind groups array
bind group to add
Remove a bind group from our bind groups array
bind group to remove
Add a GPUBuffer to our our buffers array
Add a DOMTexture to our domTextures array
DOMTexture to add
Upload a texture to the GPU
DOMTexture class object with the texture to upload
Remove a DOMTexture from our domTextures array
DOMTexture to remove
Render everything:
Destroy the GPUDeviceManager and its renderers
Responsible for the WebGPU GPUAdapter | adapter and GPUDevice | device creations, losing and restoration.
It will create all the GPU objects that need a GPUDevice | device to do so, as well as a PipelineManager. It will also keep a track of all the Renderer, bind groups, Sampler, DOMTexture and GPUBuffer | GPU buffers created.
The GPUDeviceManager is also responsible for creating the GPUCommandBuffer, rendering all the Renderer and then submitting the GPUCommandBuffer at each render calls.