Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
|
#include <IDevice.h>
Classes | |
struct | Capabilities |
Public Member Functions | |
virtual | ~IDevice () |
virtual Backend | GetBackend () const =0 |
virtual const std::string & | GetName () const =0 |
virtual const std::string & | GetVersion () const =0 |
virtual const std::string & | GetDriverInformation () const =0 |
virtual const std::vector< std::string > & | GetExtensions () const =0 |
virtual void | Report (const ScriptRequest &rq, JS::HandleValue settings)=0 |
virtual std::unique_ptr< IDeviceCommandContext > | CreateCommandContext ()=0 |
virtual std::unique_ptr< IGraphicsPipelineState > | CreateGraphicsPipelineState (const SGraphicsPipelineStateDesc &pipelineStateDesc)=0 |
Creates a graphics pipeline state. More... | |
virtual std::unique_ptr< IComputePipelineState > | CreateComputePipelineState (const SComputePipelineStateDesc &pipelineStateDesc)=0 |
Creates a compute pipeline state. More... | |
virtual std::unique_ptr< IVertexInputLayout > | CreateVertexInputLayout (const PS::span< const SVertexAttributeFormat > attributes)=0 |
Creates a vertex input layout. More... | |
virtual std::unique_ptr< ITexture > | CreateTexture (const char *name, const ITexture::Type type, const uint32_t usage, const Format format, const uint32_t width, const uint32_t height, const Sampler::Desc &defaultSamplerDesc, const uint32_t MIPLevelCount, const uint32_t sampleCount)=0 |
virtual std::unique_ptr< ITexture > | CreateTexture2D (const char *name, const uint32_t usage, const Format format, const uint32_t width, const uint32_t height, const Sampler::Desc &defaultSamplerDesc, const uint32_t MIPLevelCount=1, const uint32_t sampleCount=1)=0 |
virtual std::unique_ptr< IFramebuffer > | CreateFramebuffer (const char *name, SColorAttachment *colorAttachment, SDepthStencilAttachment *depthStencilAttachment)=0 |
virtual std::unique_ptr< IBuffer > | CreateBuffer (const char *name, const IBuffer::Type type, const uint32_t size, const uint32_t usage)=0 |
virtual std::unique_ptr< IShaderProgram > | CreateShaderProgram (const CStr &name, const CShaderDefines &defines)=0 |
virtual bool | AcquireNextBackbuffer ()=0 |
Acquires a backbuffer for rendering a frame. More... | |
virtual IFramebuffer * | GetCurrentBackbuffer (const AttachmentLoadOp colorAttachmentLoadOp, const AttachmentStoreOp colorAttachmentStoreOp, const AttachmentLoadOp depthStencilAttachmentLoadOp, const AttachmentStoreOp depthStencilAttachmentStoreOp)=0 |
Returns a framebuffer for the current backbuffer with the required attachment operations. More... | |
virtual void | Present ()=0 |
Presents the backbuffer to the swapchain queue to be flipped on a screen. More... | |
virtual void | OnWindowResize (const uint32_t width, const uint32_t height)=0 |
Should be called on window surface resize. More... | |
virtual bool | IsTextureFormatSupported (const Format format) const =0 |
virtual bool | IsFramebufferFormatSupported (const Format format) const =0 |
virtual Format | GetPreferredDepthStencilFormat (const uint32_t usage, const bool depth, const bool stencil) const =0 |
Returns the most suitable format for the usage. More... | |
virtual const Capabilities & | GetCapabilities () const =0 |
|
inlinevirtual |
|
pure virtual |
Acquires a backbuffer for rendering a frame.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Creates a compute pipeline state.
It's a caller responsibility to guarantee a lifespan of IShaderProgram stored in the description.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
The color attachment and the depth-stencil attachment should not be nullptr at the same time. There should not be many different clear colors along all color attachments for all framebuffers created for the device.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
Creates a graphics pipeline state.
It's a caller responsibility to guarantee a lifespan of IShaderProgram stored in the description.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Creates a vertex input layout.
It's recommended to use as few different layouts as posible.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Returns a framebuffer for the current backbuffer with the required attachment operations.
It should not be called if the last AcquireNextBackbuffer call returned false.
It's guaranteed that for the same acquired backbuffer this function returns a framebuffer with the same attachments and properties except load and store operations.
Implemented in Renderer::Backend::GL::CDevice, Renderer::Backend::Vulkan::CDevice, and Renderer::Backend::Dummy::CDevice.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Returns the most suitable format for the usage.
Returns Format::UNDEFINED if there is no such format.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
Should be called on window surface resize.
It's the device owner responsibility to call that function. Shouldn't be called during rendering to an acquired backbuffer.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |
Presents the backbuffer to the swapchain queue to be flipped on a screen.
Should be called only if the last AcquireNextBackbuffer call returned true.
Implemented in Renderer::Backend::Dummy::CDevice, Renderer::Backend::GL::CDevice, and Renderer::Backend::Vulkan::CDevice.
|
pure virtual |