Cogs.Core
|
Public Member Functions | |
GraphicsDeviceWebGPU (RenderingAllocatorInfo *=nullptr) | |
virtual bool | initialize () override |
Initializes the graphics device with the settings previous set through calling setSettings. | |
void | initialize_adapter (WGPUAdapter adapter) |
void | initialize_device (WGPUDevice device) |
virtual bool | isInitializationFinished () override |
Check if async initialization is finished. | |
void | destroy () |
virtual void | releaseResources () override |
Release all resources allocated. | |
virtual void | setSize (int width, int height) override |
Set the size of the main drawing buffer used by the graphics device in pixels. | |
virtual bool | getSize (int &w, int &h) const override |
Retrieve the size previously set by setSize. | |
virtual void | waitForCommandSync () override |
Wait for any GPU commands on the current device to finish before returning. | |
virtual void | beginFrame () override |
Signal the beginning of a new frame to the graphics device. | |
virtual void | endFrame (uint32_t=0, uint32_t=PresentFlags::None) override |
Signal the end of a frame to the graphics device. | |
virtual std::string | getIdentifier () const override |
Get the graphics device identifier. | |
virtual GraphicsDeviceType | getType () const override |
Get the type of the graphics device. | |
virtual IContext * | getImmediateContext () override |
Get a pointer to the immediate context used to issue commands to the graphics device. | |
virtual IBuffers * | getBuffers () override |
Get a pointer to the buffer management interface. | |
virtual ITextures * | getTextures () override |
Get a pointer to the texture management interface. | |
virtual IRenderTargets * | getRenderTargets () override |
Get a pointer to the render target management interface. | |
virtual IEffects * | getEffects () override |
Get a pointer to the effect management interface. | |
virtual IPipelineStates * | getPipelineStates () override |
Get a pointer to the pipeline state management interface. | |
virtual ICapabilities * | getCapabilities () override |
Get a pointer to the capability management interface used to query the graphics device capability flags. | |
virtual ISyncObjects * | getSyncObjects () override |
Get a pointer to the sync object management interface. | |
virtual ISwapChain * | getDefaultSwapChain () override |
Get a pointer to the default swap chain for this graphics device. | |
virtual void * | getNativeDevice () override |
![]() | |
virtual | ~IGraphicsDevice ()=default |
Destructor. | |
virtual bool | initializeThread () |
Initialize the graphics device for operation on the current thread. | |
virtual SharedGraphicsContext * | createSharedContext () |
Create a shared graphics context that can be used to activate another thread for rendering. | |
virtual void | activateSharedContext (SharedGraphicsContext *) |
Activates the given shared context on the calling thread. | |
virtual void | releaseSharedContext (SharedGraphicsContext *) |
Releases the given shared context. | |
virtual bool | initialize ()=0 |
Initializes the graphics device with the settings previous set through calling setSettings. | |
virtual bool | isInitializationFinished () |
Check if async initialization is finished. | |
virtual ResourceStatistics | getResourceStatistics () |
virtual std::string | getIdentifier () const |
Get the graphics device identifier. | |
virtual GraphicsDeviceType | getType () const |
Get the type of the graphics device. | |
virtual void | setSize (int width, int height)=0 |
Set the size of the main drawing buffer used by the graphics device in pixels. | |
virtual bool | getSize (int &width, int &height) const =0 |
Retrieve the size previously set by setSize. | |
virtual void | beginFrame ()=0 |
Signal the beginning of a new frame to the graphics device. | |
virtual void | endFrame (uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None)=0 |
Signal the end of a frame to the graphics device. | |
virtual void | waitForCommandSync () |
Wait for any GPU commands on the current device to finish before returning. | |
virtual void | releaseResources ()=0 |
Release all resources allocated. | |
virtual ISwapChain * | createSwapChain (struct WindowData *) |
Create a new swap chain for the specified window. | |
virtual void | deleteSwapChain (ISwapChain *) |
Deletes the specified swap chain. | |
virtual IContext * | getImmediateContext ()=0 |
Get a pointer to the immediate context used to issue commands to the graphics device. | |
virtual IBuffers * | getBuffers ()=0 |
Get a pointer to the buffer management interface. | |
virtual ITextures * | getTextures ()=0 |
Get a pointer to the texture management interface. | |
virtual IRenderTargets * | getRenderTargets ()=0 |
Get a pointer to the render target management interface. | |
virtual IEffects * | getEffects ()=0 |
Get a pointer to the effect management interface. | |
virtual IPipelineStates * | getPipelineStates ()=0 |
Get a pointer to the pipeline state management interface. | |
virtual ICapabilities * | getCapabilities ()=0 |
Get a pointer to the capability management interface used to query the graphics device capability flags. | |
virtual ISwapChain * | getDefaultSwapChain ()=0 |
Get a pointer to the default swap chain for this graphics device. | |
virtual ISyncObjects * | getSyncObjects ()=0 |
Get a pointer to the sync object management interface. | |
virtual void * | getNativeDevice () |
virtual bool | setSettings (const GraphicsDeviceSettings &newSettings) |
Updates the settings associated with this device. | |
const GraphicsDeviceSettings & | getSettings () const |
Public Attributes | |
bool | has_device = false |
CapabilitiesWebGPU | capabilities |
ContextWebGPU | context |
BuffersWebGPU | buffers |
EffectsWebGPU | effects |
PipelineStatesWebGPU | pipeline_states |
RenderTargetsWebGPU | renderTargets |
SyncObjectsCommon | syncObjects |
TexturesWebGPU | textures |
SwapChainWebGPU | defaultSwapChain |
WGPUInstance | instance = {} |
WGPUSurface | surface = {} |
WGPUAdapter | adapter = {} |
WGPUDevice | device = {} |
WGPUQueue | queue = {} |
WGPUCommandEncoder | commandEncoder = {} |
Additional Inherited Members | |
![]() | |
static void | fillGraphicsSettings (struct WindowData *windowData, int requestedSampleCount) |
Set platform specific graphics settings used for window creation e.g.: XVisualInfo on Linux. | |
![]() | |
GraphicsDeviceSettings | settings |
std::vector< ISwapChain * > | swapChains |
Definition at line 19 of file GraphicsDeviceWebGPU.h.
Cogs::GraphicsDeviceWebGPU::GraphicsDeviceWebGPU | ( | RenderingAllocatorInfo * | = nullptr | ) |
Definition at line 120 of file GraphicsDeviceWebGPU.cpp.
Cogs::GraphicsDeviceWebGPU::~GraphicsDeviceWebGPU | ( | ) |
Definition at line 130 of file GraphicsDeviceWebGPU.cpp.
|
overridevirtual |
Signal the beginning of a new frame to the graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 499 of file GraphicsDeviceWebGPU.cpp.
References Cogs::SwapChainWebGPU::beginFrame().
void Cogs::GraphicsDeviceWebGPU::destroy | ( | ) |
Definition at line 476 of file GraphicsDeviceWebGPU.cpp.
|
overridevirtual |
Signal the end of a frame to the graphics device.
When the graphics device itself is responsible for managing the device context (e.g in D3D11), and the PresentFlags::NoSwap flag is not set, this will swap the back buffer to make the result of previous drawing visible.
syncInterval | Synchronization interval.
|
presentFlags | A combination of PresentFlags controlling the presentation of the rendered frame. |
Implements Cogs::IGraphicsDevice.
Definition at line 525 of file GraphicsDeviceWebGPU.cpp.
References Cogs::SwapChainWebGPU::endFrame().
|
inlineoverridevirtual |
Get a pointer to the buffer management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 47 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the capability management interface used to query the graphics device capability flags.
Implements Cogs::IGraphicsDevice.
Definition at line 52 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the default swap chain for this graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 54 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the effect management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 50 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get the graphics device identifier.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 44 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the immediate context used to issue commands to the graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 46 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 56 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the pipeline state management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 51 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the render target management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 49 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Retrieve the size previously set by setSize.
Implements Cogs::IGraphicsDevice.
Definition at line 34 of file GraphicsDeviceWebGPU.h.
References Cogs::SwapChainWebGPU::getHeight(), and Cogs::SwapChainWebGPU::getWidth().
Referenced by Cogs::ContextWebGPU::setScissor().
|
inlineoverridevirtual |
Get a pointer to the sync object management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 53 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get a pointer to the texture management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 48 of file GraphicsDeviceWebGPU.h.
|
inlineoverridevirtual |
Get the type of the graphics device.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 45 of file GraphicsDeviceWebGPU.h.
References Cogs::WebGPU.
|
overridevirtual |
Initializes the graphics device with the settings previous set through calling setSettings.
Implements Cogs::IGraphicsDevice.
Definition at line 135 of file GraphicsDeviceWebGPU.cpp.
References Cogs::GraphicsDeviceSettings::ioHandler, Cogs::EffectsCommon::setIOHandler(), and Cogs::GraphicsDeviceSettings::windowData.
void Cogs::GraphicsDeviceWebGPU::initialize_adapter | ( | WGPUAdapter | adapter | ) |
Definition at line 209 of file GraphicsDeviceWebGPU.cpp.
void Cogs::GraphicsDeviceWebGPU::initialize_device | ( | WGPUDevice | device | ) |
Definition at line 398 of file GraphicsDeviceWebGPU.cpp.
|
inlineoverridevirtual |
Check if async initialization is finished.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 27 of file GraphicsDeviceWebGPU.h.
|
overridevirtual |
Release all resources allocated.
Implements Cogs::IGraphicsDevice.
Definition at line 491 of file GraphicsDeviceWebGPU.cpp.
References Cogs::BuffersWebGPU::releaseResources(), Cogs::EffectsWebGPU::releaseResources(), Cogs::RenderTargetsWebGPU::releaseResources(), and Cogs::TexturesWebGPU::releaseResources().
|
inlineoverridevirtual |
Set the size of the main drawing buffer used by the graphics device in pixels.
width | Width of the drawing buffer in pixels. |
height | Height of the drawing buffer in pixels. |
Implements Cogs::IGraphicsDevice.
Definition at line 30 of file GraphicsDeviceWebGPU.h.
References Cogs::SwapChainWebGPU::setSize().
|
inlineoverridevirtual |
Wait for any GPU commands on the current device to finish before returning.
After this command returns, any commands issued to the graphics device should be finished, and results from these ready to use.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 40 of file GraphicsDeviceWebGPU.h.
WGPUAdapter Cogs::GraphicsDeviceWebGPU::adapter = {} |
Definition at line 72 of file GraphicsDeviceWebGPU.h.
BuffersWebGPU Cogs::GraphicsDeviceWebGPU::buffers |
Definition at line 62 of file GraphicsDeviceWebGPU.h.
CapabilitiesWebGPU Cogs::GraphicsDeviceWebGPU::capabilities |
Definition at line 60 of file GraphicsDeviceWebGPU.h.
WGPUCommandEncoder Cogs::GraphicsDeviceWebGPU::commandEncoder = {} |
Definition at line 76 of file GraphicsDeviceWebGPU.h.
ContextWebGPU Cogs::GraphicsDeviceWebGPU::context |
Definition at line 61 of file GraphicsDeviceWebGPU.h.
SwapChainWebGPU Cogs::GraphicsDeviceWebGPU::defaultSwapChain |
Definition at line 68 of file GraphicsDeviceWebGPU.h.
WGPUDevice Cogs::GraphicsDeviceWebGPU::device = {} |
Definition at line 73 of file GraphicsDeviceWebGPU.h.
EffectsWebGPU Cogs::GraphicsDeviceWebGPU::effects |
Definition at line 63 of file GraphicsDeviceWebGPU.h.
bool Cogs::GraphicsDeviceWebGPU::has_device = false |
Definition at line 58 of file GraphicsDeviceWebGPU.h.
WGPUInstance Cogs::GraphicsDeviceWebGPU::instance = {} |
Definition at line 70 of file GraphicsDeviceWebGPU.h.
PipelineStatesWebGPU Cogs::GraphicsDeviceWebGPU::pipeline_states |
Definition at line 64 of file GraphicsDeviceWebGPU.h.
WGPUQueue Cogs::GraphicsDeviceWebGPU::queue = {} |
Definition at line 74 of file GraphicsDeviceWebGPU.h.
RenderTargetsWebGPU Cogs::GraphicsDeviceWebGPU::renderTargets |
Definition at line 65 of file GraphicsDeviceWebGPU.h.
WGPUSurface Cogs::GraphicsDeviceWebGPU::surface = {} |
Definition at line 71 of file GraphicsDeviceWebGPU.h.
SyncObjectsCommon Cogs::GraphicsDeviceWebGPU::syncObjects |
Definition at line 66 of file GraphicsDeviceWebGPU.h.
TexturesWebGPU Cogs::GraphicsDeviceWebGPU::textures |
Definition at line 67 of file GraphicsDeviceWebGPU.h.