Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Static Public Member Functions | List of all members
castor3d::RenderSystem Class Reference

#include <RenderSystem.hpp>

Inheritance diagram for castor3d::RenderSystem:
Inheritance graph
[legend]
Collaboration diagram for castor3d::RenderSystem:
Collaboration graph
[legend]

Public Member Functions

C3D_API RenderSystem (Engine &engine, AshPluginDescription desc, Extensions instanceExtensions={}, Extensions deviceExtensions={})
 Constructor. More...
 
C3D_API RenderSystem (Engine &engine, Renderer renderer, Extensions deviceExtensions={})
 Constructor. More...
 
C3D_API void pushScene (Scene *scene)
 Pushes a scene on the stack. More...
 
C3D_API void popScene ()
 Pops a scene from the stack. More...
 
C3D_API ScenegetTopScene () const
 
C3D_API SpirVShader compileShader (VkShaderStageFlagBits stage, castor::String const &name, ast::Shader const &shader) const
 Compiles a shader module to the necessary shader language. More...
 
C3D_API SpirVShader compileShader (VkShaderStageFlagBits stage, castor::String const &name, castor::String const &glsl) const
 Compiles a shader module to the necessary shader language. More...
 
C3D_API SpirVShader compileShader (ShaderModule const &module) const
 Compiles a shader module to the necessary shader language. More...
 
C3D_API castor::Matrix4x4f getFrustum (float left, float right, float bottom, float top, float zNear, float zFar) const
 Computes an frustum projection matrix. More...
 
C3D_API castor::Matrix4x4f getPerspective (castor::Angle const &fovy, float aspect, float zNear, float zFar) const
 
C3D_API castor::Matrix4x4f getOrtho (float left, float right, float bottom, float top, float zNear, float zFar) const
 Computes an orthographic projection matrix. More...
 
C3D_API castor::Matrix4x4f getInfinitePerspective (float radiansFovY, float aspect, float zNear) const
 

Getters.

AshPluginDescription const & getDescription () const
 
GpuInformations const & getGpuInformations () const
 
castor::String getRendererType () const
 
bool hasDevice () const
 
RenderDevice const & getRenderDevice () const
 
OverlayRendererSPtr getOverlayRenderer () const
 
castor::Nanoseconds const & getGpuTime () const
 
bool hasSsbo () const
 
ashes::Instance const & getInstance () const
 
VkPhysicalDeviceProperties const & getProperties () const
 
VkPhysicalDeviceMemoryProperties const & getMemoryProperties () const
 
VkPhysicalDeviceFeatures const & getFeatures () const
 
ashes::PhysicalDevice const & getPhysicalDevice () const
 
bool hasFeature (GpuFeature feature) const
 
bool hasStereoRendering () const
 
bool hasShaderStorageBuffers () const
 
bool hasShaderType (VkShaderStageFlagBits type) const
 
uint32_t getValue (GpuMin index) const
 
uint32_t getValue (GpuMax index) const
 
bool hasLLPV () const
 
template<class Rep , class Period >
void incGpuTime (std::chrono::duration< Rep, Period > const &time)
 
void resetGpuTime ()
 

Static Public Member Functions

static C3D_API ashes::InstancePtr createInstance (Engine &engine, AshPluginDescription const &desc, Extensions &instanceExtensions)
 Creates a Vulkan instance usable with Castor3D. More...
 
static C3D_API void completeLayerNames (Engine const &engine, ashes::VkLayerPropertiesArray const &layers, ashes::StringArray &names)
 Adds the instance layers names to the given names. More...
 

Constructor & Destructor Documentation

◆ RenderSystem() [1/2]

C3D_API castor3d::RenderSystem::RenderSystem ( Engine engine,
AshPluginDescription  desc,
Extensions  instanceExtensions = {},
Extensions  deviceExtensions = {} 
)

Constructor.

Parameters
[in]engineThe engine.
[in]descThe Ashes plugin description.
[in]instanceExtensionsThe instance extensions.
[in]deviceExtensionsThe device extensions.

◆ RenderSystem() [2/2]

C3D_API castor3d::RenderSystem::RenderSystem ( Engine engine,
Renderer  renderer,
Extensions  deviceExtensions = {} 
)

Constructor.

Parameters
[in]engineThe engine.
[in]rendererThe selected renderer.
[in]deviceExtensionsThe device extensions.

Member Function Documentation

◆ compileShader() [1/3]

C3D_API SpirVShader castor3d::RenderSystem::compileShader ( ShaderModule const &  module) const

Compiles a shader module to the necessary shader language.

Parameters
[in]moduleThe shader to compile.
Returns
The compiled shader.

◆ compileShader() [2/3]

C3D_API SpirVShader castor3d::RenderSystem::compileShader ( VkShaderStageFlagBits  stage,
castor::String const &  name,
ast::Shader const &  shader 
) const

Compiles a shader module to the necessary shader language.

Parameters
[in]stageThe shader stage.
[in]nameThe shader name.
[in]shaderThe shader to compile.
Returns
The compiled shader.

◆ compileShader() [3/3]

C3D_API SpirVShader castor3d::RenderSystem::compileShader ( VkShaderStageFlagBits  stage,
castor::String const &  name,
castor::String const &  glsl 
) const

Compiles a shader module to the necessary shader language.

Parameters
[in]stageThe shader stage.
[in]nameThe shader name.
[in]glslThe shader to compile.
Returns
The compiled shader.

◆ completeLayerNames()

static C3D_API void castor3d::RenderSystem::completeLayerNames ( Engine const &  engine,
ashes::VkLayerPropertiesArray const &  layers,
ashes::StringArray &  names 
)
static

Adds the instance layers names to the given names.

Parameters
[in]engineThe engine.
[in]layersThe available layers.
[in,out]namesThe liste to fill.

◆ createInstance()

static C3D_API ashes::InstancePtr castor3d::RenderSystem::createInstance ( Engine engine,
AshPluginDescription const &  desc,
Extensions instanceExtensions 
)
static

Creates a Vulkan instance usable with Castor3D.

Parameters
[in]engineThe engine.
[in]descThe Ashes plugin description.
[in]instanceExtensionsThe instance extensions.

◆ getDescription()

AshPluginDescription const & castor3d::RenderSystem::getDescription ( ) const
inline

References castor3d::Renderer::desc.

Referenced by getRendererType(), and hasSsbo().

Here is the caller graph for this function:

◆ getFeatures()

VkPhysicalDeviceFeatures const & castor3d::RenderSystem::getFeatures ( ) const
inline

◆ getFrustum()

C3D_API castor::Matrix4x4f castor3d::RenderSystem::getFrustum ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
) const

Computes an frustum projection matrix.

Parameters
[in]left,rightThe left and right planes position.
[in]top,bottomThe top and bottom planes position.
[in]zNear,zFarThe near and far planes position.

◆ getGpuInformations()

GpuInformations const & castor3d::RenderSystem::getGpuInformations ( ) const
inline

◆ getGpuTime()

castor::Nanoseconds const & castor3d::RenderSystem::getGpuTime ( ) const
inline

◆ getInfinitePerspective()

C3D_API castor::Matrix4x4f castor3d::RenderSystem::getInfinitePerspective ( float  radiansFovY,
float  aspect,
float  zNear 
) const

Computes a perspective projection matrix with no far plane clipping.

Parameters
[in]radiansFovYThe vertical aperture angle.
[in]aspectThe width / height ratio.
[in]zNearThe near plane position.

◆ getInstance()

ashes::Instance const & castor3d::RenderSystem::getInstance ( ) const
inline

◆ getMemoryProperties()

VkPhysicalDeviceMemoryProperties const & castor3d::RenderSystem::getMemoryProperties ( ) const
inline

◆ getOrtho()

C3D_API castor::Matrix4x4f castor3d::RenderSystem::getOrtho ( float  left,
float  right,
float  bottom,
float  top,
float  zNear,
float  zFar 
) const

Computes an orthographic projection matrix.

Parameters
[in]left,rightThe left and right planes position.
[in]top,bottomThe top and bottom planes position.
[in]zNear,zFarThe near and far planes position.

◆ getOverlayRenderer()

OverlayRendererSPtr castor3d::RenderSystem::getOverlayRenderer ( ) const
inline

◆ getPerspective()

C3D_API castor::Matrix4x4f castor3d::RenderSystem::getPerspective ( castor::Angle const &  fovy,
float  aspect,
float  zNear,
float  zFar 
) const

Computes a perspective projection matrix.

Parameters
[in]fovyThe vertical aperture angle.
[in]aspectThe width / height ratio.
[in]zNearThe near plane position.
[in]zFarThe far plane position.

◆ getPhysicalDevice()

ashes::PhysicalDevice const & castor3d::RenderSystem::getPhysicalDevice ( ) const
inline

◆ getProperties()

VkPhysicalDeviceProperties const & castor3d::RenderSystem::getProperties ( ) const
inline

◆ getRenderDevice()

RenderDevice const & castor3d::RenderSystem::getRenderDevice ( ) const
inline

References hasDevice().

Here is the call graph for this function:

◆ getRendererType()

castor::String castor3d::RenderSystem::getRendererType ( ) const
inline

References getDescription().

Here is the call graph for this function:

◆ getTopScene()

C3D_API Scene * castor3d::RenderSystem::getTopScene ( ) const
Returns
The top scene from the stack, nullptr if the stack is empty.

◆ getValue() [1/2]

uint32_t castor3d::RenderSystem::getValue ( GpuMax  index) const
inline

References castor3d::GpuInformations::getValue().

Here is the call graph for this function:

◆ getValue() [2/2]

uint32_t castor3d::RenderSystem::getValue ( GpuMin  index) const
inline

References castor3d::GpuInformations::getValue().

Here is the call graph for this function:

◆ hasDevice()

bool castor3d::RenderSystem::hasDevice ( ) const
inline

Referenced by getRenderDevice().

Here is the caller graph for this function:

◆ hasFeature()

bool castor3d::RenderSystem::hasFeature ( GpuFeature  feature) const
inline

References castor3d::GpuInformations::hasFeature().

Here is the call graph for this function:

◆ hasLLPV()

bool castor3d::RenderSystem::hasLLPV ( ) const
inline

◆ hasShaderStorageBuffers()

bool castor3d::RenderSystem::hasShaderStorageBuffers ( ) const
inline

References castor3d::GpuInformations::hasShaderStorageBuffers().

Here is the call graph for this function:

◆ hasShaderType()

bool castor3d::RenderSystem::hasShaderType ( VkShaderStageFlagBits  type) const
inline

References castor3d::GpuInformations::hasShaderType().

Here is the call graph for this function:

◆ hasSsbo()

bool castor3d::RenderSystem::hasSsbo ( ) const
inline

References getDescription().

Here is the call graph for this function:

◆ hasStereoRendering()

bool castor3d::RenderSystem::hasStereoRendering ( ) const
inline

References castor3d::GpuInformations::hasStereoRendering().

Here is the call graph for this function:

◆ incGpuTime()

template<class Rep , class Period >
void castor3d::RenderSystem::incGpuTime ( std::chrono::duration< Rep, Period > const &  time)
inline

name Mutators.

◆ popScene()

C3D_API void castor3d::RenderSystem::popScene ( )

Pops a scene from the stack.

◆ pushScene()

C3D_API void castor3d::RenderSystem::pushScene ( Scene scene)

Pushes a scene on the stack.

Parameters
[in]sceneThe scene

◆ resetGpuTime()

void castor3d::RenderSystem::resetGpuTime ( )
inline

The documentation for this class was generated from the following file: