4#include <unordered_map>
7#include "Rendering/Common.h"
8#include "Rendering/RasterizerState.h"
9#include "Rendering/DepthStencilState.h"
10#include "Rendering/SamplerState.h"
11#include "Rendering/BlendState.h"
13#include "Resources/MaterialOptions.h"
17 class IGraphicsDevice;
21 constexpr uint16_t getDepthState(
DepthMode depthMode,
DepthFunc depthFunc) {
return (uint16_t)depthMode + (uint16_t)DepthMode::Count * (uint16_t)depthFunc; }
23 struct RenderPassOptions;
31 bool reverseDepth =
false;
36 std::vector<Cogs::RasterizerStateHandle> rasterizerStateHandles;
42 } blendStates[size_t(BlendMode::Count)];
44 static constexpr uint16_t defaultDepthStencilState = getDepthState(
DepthMode::Default, DepthFunc::Less);
45 static constexpr uint16_t noWriteDepthStencilState = getDepthState(
DepthMode::NoWrite, DepthFunc::Less);
46 static constexpr uint16_t noDepthStencilState = getDepthState(
DepthMode::Disabled, DepthFunc::Always);
47 static constexpr uint16_t noTestDepthStencilState = getDepthState(
DepthMode::Default, DepthFunc::Always);
48 static constexpr uint16_t leqDepthStencilState = getDepthState(
DepthMode::Default, DepthFunc::LessOrEqual);
66 bool counterClockWise);
68 COGSCORE_DLL_API uint16_t getRasterizerState(
const RasterizerState & rs);
81 std::unordered_map<RasterizerState, RasterizerStateInstance> rasterizerStates;
82 std::unordered_map<DepthStencilState, Cogs::DepthStencilStateHandle> depthStencilStates;
83 std::unordered_map<SamplerState, Cogs::SamplerStateHandle> samplerStates;
Represents a graphics device used to manage graphics resources and issue drawing commands.
DepthMode
Defines common depth stencil modes.
@ NoWrite
Depth test enabled, write disabled.
@ Default
Default, depth test & write enabled.
@ Disabled
Depth test/write disabled.
DepthFunc
Defines common depth functions.
Contains all Cogs related functionality.
Encapsulates blend state for the graphics pipeline in a state object.
static BlendState DefaultState()
Creates a blend state object initialized with the default settings.
Encapsulates state for depth buffer usage and stencil buffer usage in a state object.
static const Handle_t NoHandle
Represents a handle to nothing.
Encapsulates state for primitive rasterization in a state object.
CullMode
Culling modes for triangle rasterization.
Encapsulates state for texture sampling in a state object.