Pyrogenesis
trunk
|
#include <Device.h>
Classes | |
struct | ObjectToDestroy |
Public Member Functions | |
~CDevice () override | |
Backend | GetBackend () const override |
const std::string & | GetName () const override |
const std::string & | GetVersion () const override |
const std::string & | GetDriverInformation () const override |
const std::vector< std::string > & | GetExtensions () const override |
void | Report (const ScriptRequest &rq, JS::HandleValue settings) override |
std::unique_ptr< IDeviceCommandContext > | CreateCommandContext () override |
std::unique_ptr< IGraphicsPipelineState > | CreateGraphicsPipelineState (const SGraphicsPipelineStateDesc &pipelineStateDesc) override |
Creates a graphics pipeline state. More... | |
std::unique_ptr< IVertexInputLayout > | CreateVertexInputLayout (const PS::span< const SVertexAttributeFormat > attributes) override |
Creates a vertex input layout. More... | |
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) override |
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) override |
std::unique_ptr< IFramebuffer > | CreateFramebuffer (const char *name, SColorAttachment *colorAttachment, SDepthStencilAttachment *depthStencilAttachment) override |
std::unique_ptr< IBuffer > | CreateBuffer (const char *name, const IBuffer::Type type, const uint32_t size, const bool dynamic) override |
std::unique_ptr< CBuffer > | CreateCBuffer (const char *name, const IBuffer::Type type, const uint32_t size, const bool dynamic) |
std::unique_ptr< IShaderProgram > | CreateShaderProgram (const CStr &name, const CShaderDefines &defines) override |
bool | AcquireNextBackbuffer () override |
Acquires a backbuffer for rendering a frame. More... | |
IFramebuffer * | GetCurrentBackbuffer (const AttachmentLoadOp colorAttachmentLoadOp, const AttachmentStoreOp colorAttachmentStoreOp, const AttachmentLoadOp depthStencilAttachmentLoadOp, const AttachmentStoreOp depthStencilAttachmentStoreOp) override |
Returns a framebuffer for the current backbuffer with the required attachment operations. More... | |
void | Present () override |
Presents the backbuffer to the swapchain queue to be flipped on a screen. More... | |
void | OnWindowResize (const uint32_t width, const uint32_t height) override |
Should be called on window surface resize. More... | |
bool | IsTextureFormatSupported (const Format format) const override |
bool | IsFramebufferFormatSupported (const Format format) const override |
Format | GetPreferredDepthStencilFormat (const uint32_t usage, const bool depth, const bool stencil) const override |
Returns the most suitable format for the usage. More... | |
const Capabilities & | GetCapabilities () const override |
VkDevice | GetVkDevice () |
VmaAllocator | GetVMAAllocator () |
void | ScheduleObjectToDestroy (VkObjectType type, const void *handle, const VmaAllocation allocation) |
void | ScheduleObjectToDestroy (VkObjectType type, const uint64_t handle, const VmaAllocation allocation) |
void | ScheduleTextureToDestroy (const CTexture::UID uid) |
void | SetObjectName (VkObjectType type, const void *handle, const char *name) |
void | SetObjectName (VkObjectType type, const uint64_t handle, const char *name) |
std::unique_ptr< CRingCommandContext > | CreateRingCommandContext (const size_t size) |
const SAvailablePhysicalDevice & | GetChoosenPhysicalDevice () const |
CRenderPassManager & | GetRenderPassManager () |
CSamplerManager & | GetSamplerManager () |
CDescriptorManager & | GetDescriptorManager () |
Public Member Functions inherited from Renderer::Backend::IDevice | |
virtual | ~IDevice () |
Static Public Member Functions | |
static std::unique_ptr< CDevice > | Create (SDL_Window *window) |
Creates the Vulkan device. More... | |
Private Member Functions | |
CDevice () | |
void | RecreateSwapChain () |
bool | IsSwapChainValid () |
void | ProcessObjectToDestroyQueue (const bool ignoreFrameID=false) |
void | ProcessTextureToDestroyQueue (const bool ignoreFrameID=false) |
bool | IsFormatSupportedForUsage (const Format format, const uint32_t usage) const |
|
override |
|
privatedefault |
|
overridevirtual |
Acquires a backbuffer for rendering a frame.
Implements Renderer::Backend::IDevice.
|
static |
Creates the Vulkan device.
|
overridevirtual |
Implements Renderer::Backend::IDevice.
std::unique_ptr< CBuffer > Renderer::Backend::Vulkan::CDevice::CreateCBuffer | ( | const char * | name, |
const IBuffer::Type | type, | ||
const uint32_t | size, | ||
const bool | dynamic | ||
) |
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
overridevirtual |
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.
Implements Renderer::Backend::IDevice.
|
overridevirtual |
Creates a graphics pipeline state.
It's a caller responsibility to guarantee a lifespan of IShaderProgram stored in the description.
Implements Renderer::Backend::IDevice.
std::unique_ptr< CRingCommandContext > Renderer::Backend::Vulkan::CDevice::CreateRingCommandContext | ( | const size_t | size | ) |
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
overridevirtual |
Creates a vertex input layout.
It's recommended to use as few different layouts as posible.
Implements Renderer::Backend::IDevice.
|
inlineoverridevirtual |
Implements Renderer::Backend::IDevice.
|
inlineoverridevirtual |
Implements Renderer::Backend::IDevice.
|
inline |
|
overridevirtual |
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.
Implements Renderer::Backend::IDevice.
|
inline |
|
inlineoverridevirtual |
Implements Renderer::Backend::IDevice.
|
inlineoverridevirtual |
Implements Renderer::Backend::IDevice.
|
inlineoverridevirtual |
Implements Renderer::Backend::IDevice.
|
overridevirtual |
Returns the most suitable format for the usage.
Returns Format::UNDEFINED if there is no such format.
Implements Renderer::Backend::IDevice.
|
inline |
|
inline |
|
inlineoverridevirtual |
Implements Renderer::Backend::IDevice.
|
inline |
|
inline |
|
private |
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
private |
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
overridevirtual |
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.
Implements Renderer::Backend::IDevice.
|
overridevirtual |
Presents the backbuffer to the swapchain queue to be flipped on a screen.
Should be called only if the last AcquireNextBackbuffer call returned true.
Implements Renderer::Backend::IDevice.
|
private |
|
private |
|
private |
|
overridevirtual |
Implements Renderer::Backend::IDevice.
|
inline |
void Renderer::Backend::Vulkan::CDevice::ScheduleObjectToDestroy | ( | VkObjectType | type, |
const uint64_t | handle, | ||
const VmaAllocation | allocation | ||
) |
void Renderer::Backend::Vulkan::CDevice::ScheduleTextureToDestroy | ( | const CTexture::UID | uid | ) |
|
inline |
void Renderer::Backend::Vulkan::CDevice::SetObjectName | ( | VkObjectType | type, |
const uint64_t | handle, | ||
const char * | name | ||
) |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |