|
| | WebGpuContext (const WebGpuContext &other)=delete |
| | WebGpuContext (WGPUInstance instance, WGPUDevice device, WGPUQueue queue) |
| | Creates a new WebGPU context.
|
| | ~WebGpuContext () |
| WGPUDevice | getDevice () const |
| | Returns the WebGPU device.
|
| WGPUInstance | getInstance () const |
| | Returns the WebGPU instance.
|
| WGPUQueue | getQueue () const |
| | Returns the WebGPU queue.
|
| WGPUTexture | getRenderTargetDepthTexture () const |
| | Returns the depth texture that was set as render target, or throw if no render target was set or if no depht texture was configured.
|
| WGPUTextureView | getRenderTargetDepthTextureView () const |
| | Returns the depth texture view that was set as render target, or throw if no render target was set or if no depht texture was configured.
|
| const std::string & | getRenderTargetName () const |
| | Returns the name of the render target that was set, or throw if no render target was set.
|
| WGPUTexture | getRenderTargetTexture () const |
| | Returns the color texture that was set as render target, or throw if no render target was set.
|
| WGPUTextureView | getRenderTargetTextureView () const |
| | Returns the color texture view that was set as render target, or throw if no render target was set.
|
| bool | hasRenderTargetDepthTexture () const |
| | Returns if this object contains a depth texture to render to.
|
| bool | isRenderTargetClearColor () const |
| | Returns whether the color render target is cleared before painting, or its contents are loaded and composited over.
|
| bool | isRenderTargetClearDepth () const |
| | Returns whether the depth render target is cleared before painting, or its contents are loaded and depth tested against.
|
| WebGpuContext & | operator= (const WebGpuContext &other)=delete |
| void | resetRenderTarget () |
| | Resets the render target that was set in setRenderTarget.
|
| void | setRenderTarget (std::string name, WGPUTexture colorTexture, WGPUTextureView colorTextureView) |
| | Sets a color texture to which to render.
|
| void | setRenderTarget (std::string name, WGPUTexture colorTexture, WGPUTextureView colorTextureView, WGPUTexture depthTexture, WGPUTextureView depthTextureView, bool clearColor=true, bool clearDepth=true) |
| | Sets a color texture and depth texture to which to render.
|
An object that contains the WebGPU context that is needed to create a Map::Renderer.
- Since
- 2026.0
| std::vector< WGPUFeatureName > luciad::WebGpuContext::getRequiredFeatures |
( |
WGPUAdapter | adapter | ) |
|
|
static |
Returns the WebGPU features that are necessary for LuciadCPillar to function properly.
This list of features should be passed in the device descriptor used when requesting a WebGPU device.
You may also provide a device with more features (as long as the adapter supports it), but you should never provide a device missing a feature returned by this method.
- Parameters
-
| adapter | the WebGPU adapter. |
- Returns
- the WebGPU features required of the device for LuciadCPillar to work properly.
| WGPULimits luciad::WebGpuContext::getRequiredLimits |
( |
WGPUAdapter | adapter | ) |
|
|
static |
Returns the WebGPU limits that are necessary for LuciadCPillar to function properly.
These limits should be passed in the device descriptor used when requesting a WebGPU device.
You may also provide a device with limits that are higher (as long as the adapter supports it), but you should never provide a device with lower limits than the limits returned by this method.
- Parameters
-
| adapter | the WebGPU adapter. |
- Returns
- the WebGPU limits required of the device for LuciadCPillar to work properly.
- Since
- 2026.1
| void luciad::WebGpuContext::setRenderTarget |
( |
std::string | name, |
|
|
WGPUTexture | colorTexture, |
|
|
WGPUTextureView | colorTextureView, |
|
|
WGPUTexture | depthTexture, |
|
|
WGPUTextureView | depthTextureView, |
|
|
bool | clearColor = true, |
|
|
bool | clearDepth = true ) |
Sets a color texture and depth texture to which to render.
This function is typically called right before Map::Renderer::paint is called. Call resetRenderTarget afterwards.
Use this function when you want to use the depth buffer yourself.
By default the color and depth textures are cleared before the map is painted. Pass false for clearColor or clearDepth to instead load and reuse their existing contents. When the color is loaded, the map is alpha blended over it. When the depth is loaded, map geometry is depth tested against it and the merged depth is written back, so externally rendered geometry and the map occlude each other correctly. The provided textures must hold valid color and depth when they are loaded.
- Parameters
-
| name | the name of the target |
| colorTexture | the color texture to render to |
| colorTextureView | the color texture view to render to |
| depthTexture | the depth texture to render to |
| depthTextureView | the depth texture view to render to |
| clearColor | whether to clear the color texture before painting (true, the default) or to load and composite over its existing contents (false) |
| clearDepth | whether to clear the depth texture before painting (true, the default) or to load and depth test against its existing contents (false) |