Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
GPUState Class Reference

Internal GPU state ; not all API options are exposed, only these that can be toggled in Rendu. More...

#include <GPUTypes.hpp>

Classes

struct  RenderPass
 Current rendering pass information. More...
 

Public Member Functions

 GPUState ()=default
 Constructor.
 
bool isGraphicsEquivalent (const GPUState &other) const
 
bool isComputeEquivalent (const GPUState &other) const
 

Public Attributes

glm::vec4 blendColor {0.0f}
 Blend color for constant blend mode.
 
glm::bvec4 colorWriteMask {true}
 Which channels should be written to when rendering.
 
BlendFunction blendSrcRGB = BlendFunction::ONE
 Blending source type for RGB channels.
 
BlendFunction blendSrcAlpha = BlendFunction::ONE
 Blending source type for alpha channel.
 
BlendFunction blendDstRGB = BlendFunction::ONE
 Blending destination type for RGB channels.
 
BlendFunction blendDstAlpha = BlendFunction::ONE
 Blending destination type for alpha channel.
 
BlendEquation blendEquationRGB = BlendEquation::ADD
 Blending equation for RGB channels.
 
BlendEquation blendEquationAlpha = BlendEquation::ADD
 Blending equation for alpha channel.
 
Faces cullFaceMode = Faces::BACK
 Which faces should be culled.
 
PolygonMode polygonMode = PolygonMode::FILL
 How should polygons be processed.
 
TestFunction depthFunc = TestFunction::LESS
 Depth test function.
 
TestFunction stencilFunc = TestFunction::ALWAYS
 Stencil test function.
 
StencilOp stencilFail = StencilOp::KEEP
 Operation when the stencil test fails.
 
StencilOp stencilPass = StencilOp::KEEP
 Operation when the stencil test passes but the depth test fails.
 
StencilOp stencilDepthPass = StencilOp::KEEP
 Operation when the stencil and depth tests passes.
 
uint patchSize = 3
 Tessellation patch size.
 
uchar stencilValue = 0
 Stencil reference value.
 
bool stencilTest = false
 Is the stencil test enabled or not.
 
bool stencilWriteMask = true
 should stencil be written to the stencil buffer or not.
 
bool depthTest = false
 Is depth test enabled or not.
 
bool depthWriteMask = true
 Should depth be written to the depth buffer or not.
 
bool cullFace = false
 Is backface culling enabled or not.
 
bool blend = false
 Blending enabled or not.
 
bool sentinel = false
 Used to delimit the parameters that can be directly compared in memory.
 
ProgramgraphicsProgram = nullptr
 The current graphics program.
 
const GPUMeshmesh = nullptr
 The current mesh.
 
RenderPass pass
 The current attachments formats.
 
std::array< const Texture *, 4 > colors = {nullptr, nullptr, nullptr, nullptr}
 The current attached color textures.
 
const TexturedepthStencil {nullptr}
 The current attached depth texture.
 
ProgramcomputeProgram = nullptr
 The current compute program.
 

Detailed Description

Internal GPU state ; not all API options are exposed, only these that can be toggled in Rendu.

Note
This is only provided as a read-only state. Modifying attributes won't affect the current GPU state.

Member Function Documentation

◆ isComputeEquivalent()

bool GPUState::isComputeEquivalent ( const GPUState other) const

Test if this state is equivalent (in a Vulkan compute pipeline state sense) to another.

Parameters
otherthe state to compare to
Returns
true if they are compatible

◆ isGraphicsEquivalent()

bool GPUState::isGraphicsEquivalent ( const GPUState other) const

Test if this state is equivalent (in a Vulkan graphics pipeline state sense) to another.

Parameters
otherthe state to compare to
Returns
true if they are compatible

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