|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Immutable description of a draw pipeline. Equality keys the pipeline cache, so two draws with the same description share one PipelineHandle. More...
#include <PipelineState.hpp>
Public Member Functions | |
| bool | operator== (const PipelineDesc &) const =default |
Public Attributes | |
| ShaderHandle | program = ShaderHandle::Invalid |
| VertexLayoutHandle | vertexLayout = VertexLayoutHandle::Invalid |
| BlendMode | blend = BlendMode::Normal |
| bool | blendEnabled = true |
| bool | depthTest = false |
| bool | depthWrite = false |
| GfxStencilMode | stencil = GfxStencilMode::Off |
| bool | cullEnabled = false |
| bool | cullFront = false |
| i16 | depthBias = 0 |
| bool | alphaToCoverage = false |
| GfxTopology | topology = GfxTopology::Triangles |
| bool | gbuffer = false |
| bool | albedo = false |
| bool | colorWrite = true |
| False writes no colour, to either attachment: a depth-only pass, whose surfaces are then drawn again with colour. | |
| bool | depthEqual = false |
| bool | layerAlpha = false |
Immutable description of a draw pipeline. Equality keys the pipeline cache, so two draws with the same description share one PipelineHandle.
Definition at line 61 of file PipelineState.hpp.
|
default |
| bool esengine::PipelineDesc::albedo = false |
With gbuffer: the shader also writes the surface's diffuse colour (location 2) into the target's third attachment. A gbuffer shader that predates it writes two outputs and leaves the third alone.
Definition at line 85 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), and esengine::DrawList::execute().
| bool esengine::PipelineDesc::alphaToCoverage = false |
Output alpha becomes multisample coverage (a cutout's feathered edge). Only meaningful on an opaque draw into a multisampled target; ignored elsewhere.
Definition at line 77 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), and esengine::DrawList::execute().
| BlendMode esengine::PipelineDesc::blend = BlendMode::Normal |
Definition at line 64 of file PipelineState.hpp.
Referenced by esengine::applyMeshPipeline(), esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), and esengine::DrawList::execute().
| bool esengine::PipelineDesc::blendEnabled = true |
Definition at line 65 of file PipelineState.hpp.
Referenced by esengine::applyMeshPipeline(), esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), and esengine::DrawList::execute().
| bool esengine::PipelineDesc::colorWrite = true |
False writes no colour, to either attachment: a depth-only pass, whose surfaces are then drawn again with colour.
Definition at line 87 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), and esengine::DrawList::execute().
| bool esengine::PipelineDesc::cullEnabled = false |
Definition at line 69 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), and esengine::DrawList::execute().
| bool esengine::PipelineDesc::cullFront = false |
Definition at line 70 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), and esengine::DrawList::execute().
| i16 esengine::PipelineDesc::depthBias = 0 |
How far toward the eye this surface is pushed, in units of the depth buffer's resolution — the only way to say which of two COPLANAR surfaces wins. Drives both the constant and the slope-scaled term.
Definition at line 74 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), esengine::DrawList::execute(), and esengine::webgpu::toWGPUDepthStencil().
| bool esengine::PipelineDesc::depthEqual = false |
Passes where the depth is EQUAL to what the buffer holds, not only where it is less: a surface drawn a second time, after a pass that wrote its depth, must land on itself.
Definition at line 90 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), esengine::DrawList::execute(), and esengine::webgpu::toWGPUDepthStencil().
| bool esengine::PipelineDesc::depthTest = false |
Definition at line 66 of file PipelineState.hpp.
Referenced by esengine::applyMeshPipeline(), esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), esengine::DrawList::execute(), and esengine::webgpu::toWGPUDepthStencil().
| bool esengine::PipelineDesc::depthWrite = false |
Definition at line 67 of file PipelineState.hpp.
Referenced by esengine::applyMeshPipeline(), esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), esengine::DrawList::execute(), and esengine::webgpu::toWGPUDepthStencil().
| bool esengine::PipelineDesc::gbuffer = false |
The shader writes a second colour output (location 1) and the target's second attachment is to receive it. A pipeline without it draws into a target that has one and leaves it alone: WebGPU wants that said in the pipeline, and GL wants the draw buffers set to match.
Definition at line 82 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), and esengine::DrawList::execute().
| bool esengine::PipelineDesc::layerAlpha = false |
Definition at line 91 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), and esengine::DrawList::execute().
| ShaderHandle esengine::PipelineDesc::program = ShaderHandle::Invalid |
Definition at line 62 of file PipelineState.hpp.
Referenced by esengine::applyMeshPipeline(), esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), esengine::DrawList::execute(), esengine::ImmediateDraw::flushDeferred(), esengine::ImmediateDraw::init(), and esengine::GfxDevice::setPipeline().
| GfxStencilMode esengine::PipelineDesc::stencil = GfxStencilMode::Off |
Definition at line 68 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), esengine::DrawList::execute(), and esengine::webgpu::toWGPUDepthStencil().
| GfxTopology esengine::PipelineDesc::topology = GfxTopology::Triangles |
Definition at line 78 of file PipelineState.hpp.
Referenced by esengine::GLDevice::backendSetPipeline(), and esengine::DrawList::execute().
| VertexLayoutHandle esengine::PipelineDesc::vertexLayout = VertexLayoutHandle::Invalid |
Definition at line 63 of file PipelineState.hpp.
Referenced by esengine::applyMeshPipeline(), esengine::GLDevice::backendSetPipeline(), esengine::draw_meshWithMaterial(), and esengine::DrawList::execute().