Diligent Engine
Loading...
Searching...
No Matches
Diligent::IEngineFactoryWebGPU Struct Referenceabstract

Engine factory for WebGPU rendering backend. More...

#include <EngineFactoryWebGPU.h>

Inheritance diagram for Diligent::IEngineFactoryWebGPU:
Diligent.IEngineFactory Diligent.IObject Diligent::EngineFactoryBase< IEngineFactoryWebGPU > Diligent::EngineFactoryWebGPUImpl

Public Member Functions

virtual void DILIGENT_CALL_TYPE CreateDeviceAndContextsWebGPU (const EngineWebGPUCreateInfo &EngineCI, IRenderDevice **ppDevice, IDeviceContext **ppContexts)=0
 Creates a render device and device contexts for WebGPU-based engine implementation.
virtual void DILIGENT_CALL_TYPE CreateSwapChainWebGPU (IRenderDevice *pDevice, IDeviceContext *pImmediateContext, const SwapChainDesc &SCDesc, const NativeWindow &Window, ISwapChain **ppSwapChain)=0
 Creates a swap chain for WebGPU-based engine implementation.
virtual void DILIGENT_CALL_TYPE AttachToWebGPUDevice (void *wgpuInstance, void *wgpuAdapter, void *wgpuDevice, const EngineWebGPUCreateInfo &EngineCI, IRenderDevice **ppDevice, IDeviceContext **ppContexts)=0
 Attaches to existing WebGPU render device, adapter and instance.
virtual const void *DILIGENT_CALL_TYPE GetProcessTable () const =0
 Return the pointer to DawnProcTable.
Public Member Functions inherited from Diligent.IEngineFactory
virtual const APIInfo &DILIGENT_CALL_TYPE GetAPIInfo () const =0
 Returns API info structure, see Diligent::APIInfo.
virtual void DILIGENT_CALL_TYPE CreateDefaultShaderSourceStreamFactory (const Char *SearchDirectories, struct IShaderSourceInputStreamFactory **ppShaderSourceFactory) const =0
 Creates default shader source input stream factory.
virtual void DILIGENT_CALL_TYPE CreateDataBlob (size_t InitialSize, const void *pData, IDataBlob **ppDataBlob) const =0
 Creates a data blob.
virtual void DILIGENT_CALL_TYPE EnumerateAdapters (Version MinVersion, Uint32 &NumAdapters, GraphicsAdapterInfo *Adapters) const =0
 Enumerates adapters available on this machine.
virtual void DILIGENT_CALL_TYPE CreateDearchiver (const DearchiverCreateInfo &CreateInfo, struct IDearchiver **ppDearchiver) const =0
 Creates a dearchiver object.
virtual void DILIGENT_CALL_TYPE SetMessageCallback (DebugMessageCallbackType MessageCallback) const =0
 Sets a user-provided debug message callback.
virtual void DILIGENT_CALL_TYPE SetBreakOnError (bool BreakOnError) const =0
 Sets whether to break program execution on assertion failure.
virtual void DILIGENT_CALL_TYPE SetMemoryAllocator (IMemoryAllocator *pAllocator) const =0
 Sets the memory allocator to be used by the engine.
Public Member Functions inherited from Diligent.IObject
virtual void DILIGENT_CALL_TYPE QueryInterface (const INTERFACE_ID &IID, IObject **ppInterface)=0
 Queries the specific interface.
template<typename DerivedType, typename = typename std::enable_if<std::is_base_of<IObject, DerivedType>::value>::type>
void QueryInterface (const INTERFACE_ID &IID, DerivedType **ppInterface)
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE AddRef ()=0
 Increments the number of strong references by 1.
virtual ReferenceCounterValueType DILIGENT_CALL_TYPE Release ()=0
virtual IReferenceCounters *DILIGENT_CALL_TYPE GetReferenceCounters () const =0

Detailed Description

Engine factory for WebGPU rendering backend.

Member Function Documentation

◆ AttachToWebGPUDevice()

virtual void DILIGENT_CALL_TYPE Diligent::IEngineFactoryWebGPU::AttachToWebGPUDevice ( void * wgpuInstance,
void * wgpuAdapter,
void * wgpuDevice,
const EngineWebGPUCreateInfo & EngineCI,
IRenderDevice ** ppDevice,
IDeviceContext ** ppContexts )
pure virtual

Attaches to existing WebGPU render device, adapter and instance.

The instance must enable WGPUInstanceFeatureName_TimedWaitAny to use blocking fence, device-idle, or GPU pipeline-compilation waits. Non-blocking operation does not require this feature. Browser waits also require Asyncify or JSPI.

Parameters
[in]wgpuInstance- pointer to the native WebGPU instance.
[in]wgpuAdapter- pointer to the native WebGPU adapter.
[in]wgpuDevice- pointer to the native WebGPU device.
[in]EngineCI- Engine creation info.
[out]ppDevice- Address of the memory location where pointer to the created device will be written.
[out]ppContexts- Address of the memory location where pointers to the contexts will be written. Immediate context goes at position 0. If EngineCI.NumDeferredContexts > 0, pointers to the deferred contexts are written afterwards.

Implemented in Diligent::EngineFactoryWebGPUImpl.

◆ CreateDeviceAndContextsWebGPU()

virtual void DILIGENT_CALL_TYPE Diligent::IEngineFactoryWebGPU::CreateDeviceAndContextsWebGPU ( const EngineWebGPUCreateInfo & EngineCI,
IRenderDevice ** ppDevice,
IDeviceContext ** ppContexts )
pure virtual

Creates a render device and device contexts for WebGPU-based engine implementation.

This synchronous method is not supported on the Web. Create the device asynchronously in JavaScript and use IEngineFactoryWebGPU::AttachToWebGPUDevice() instead.

Parameters
[in]EngineCI- Engine creation info.
[out]ppDevice- Address of the memory location where pointer to the created device will be written.
[out]ppContexts- Address of the memory location where pointers to the contexts will be written. Immediate context goes at position 0. If EngineCI.NumDeferredContexts > 0, pointers to deferred contexts are written afterwards.

Implemented in Diligent::EngineFactoryWebGPUImpl.

◆ CreateSwapChainWebGPU()

virtual void DILIGENT_CALL_TYPE Diligent::IEngineFactoryWebGPU::CreateSwapChainWebGPU ( IRenderDevice * pDevice,
IDeviceContext * pImmediateContext,
const SwapChainDesc & SCDesc,
const NativeWindow & Window,
ISwapChain ** ppSwapChain )
pure virtual

Creates a swap chain for WebGPU-based engine implementation.

Parameters
[in]pDevice- Pointer to the render device.
[in]pImmediateContext- Pointer to the immediate device context.
[in]SCDesc- Swap chain description.
[in]Window- Platform-specific native window description that the swap chain will be associated with:
  • On Win32 platform, this is the window handle (HWND)
  • On Universal Windows Platform, this is the reference to the core window (Windows::UI::Core::CoreWindow)
[out]ppSwapChain- Address of the memory location where pointer to the new swap chain will be written.
Remarks
On the web, an RGBA16Float canvas interprets the application's output in the Display P3 color space and uses extended tone mapping.

Implemented in Diligent::EngineFactoryWebGPUImpl.