228 float minDepth = 0.0;
235 float maxDepth = 1.0;
246 CE_EXPLICIT(false) inline
Viewport(const
float x, const
float y, const
float width, const
float height) noexcept : origin{x, y}, extent{width, height} {}
250 CE_EXPLICIT(false) inline
Viewport(const
float x, const
float y, const
float width, const
float height, const
float minDepth, const
float maxDepth) noexcept
251 : origin{x, y}, extent{width, height}, minDepth{minDepth}, maxDepth{maxDepth} {}
255 CE_EXPLICIT(
false) inline
Viewport(const TOffset2<
float>& offset, const TExtent2<
float>& extent) noexcept : origin{offset}, extent{extent} {}
260 : origin(0.0, 0.0), extent{extent} {}
265 :
Viewport(TExtent2<
float>(extent)) {}
268 CE_EXPLICIT(
false) inline
Viewport(const TOffset2<
float>& offset, const TExtent2<
float>& extent, const
float minDepth, const
float maxDepth) noexcept
269 : origin{offset}, extent{extent}, minDepth{minDepth}, maxDepth{maxDepth} {}
273 template<
typename Processor>
static constexpr void reflect(Processor&& RTTI) {
310 inline Scissor(
const TOffset2<Int32>& offset,
const TExtent2<Int32>& extent) noexcept
311 : x{offset.x}, y{offset.y}, width{extent.width}, height{extent.height} {}
315 template<
typename Processor>
static constexpr void reflect(Processor&& RTTI) {
339 bool enabled = false;
355 inline
UInt32 getSampleCount() const noexcept {
return (enabled && samples > 1 ? samples : 1); }
359 template<
typename Processor>
static constexpr void reflect(Processor&& RTTI) {
373 bool testEnabled = false;
378 bool writeEnabled = false;
387 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
432 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
449 bool testEnabled = false;
461 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
475 float constantFactor = 0.0f;
480 float slopeFactor = 0.0f;
489 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
501 bool enabled = false;
509 float extraPrimitiveOverestimationSize = 0.0f;
513 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
545 bool frontCCW = false;
550 bool depthClampEnabled = false;
555 bool scissorTestEnabled = false;
560 bool antiAliasedLineEnabled = false;
567 float lineWidth = 1.0f;
571 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
590 bool blendEnabled = false;
621 Vector4b colorMask = {
true,
true,
true,
true};
625 template<
typename Processor>
static constexpr void reflect(Processor&& RTTI) {
645 bool alphaToCoverageEnabled = false;
655 bool independentBlendEnabled = false;
673 Vector4f blendFactor = {0.0f, 0.0f, 0.0f, 0.0f};
684 template<
typename Processor>
static constexpr void reflect(Processor&& RTTI) {
772 template<typename Processor> static constexpr
void reflect(Processor&& RTTI) {
793 using TDeviceObject::TDeviceObject;
831 : mCommandBuffer(&commandBuffer), mGraphicsPipeline(&graphicsPipeline) {
832 mGraphicsPipeline->
begin(*mCommandBuffer);
843 :
Scope(*commandBuffer, *graphicsPipeline) {}
851 if(mGraphicsPipeline !=
nullptr) {
852 mGraphicsPipeline->
end(*mCommandBuffer);
853 mGraphicsPipeline =
nullptr;
854 mCommandBuffer =
nullptr;
866 const Scope scope(commandBuffer, *
this);
#define CE_REFLECT_HASH(T)
Definition Hash.hpp:89
#define CE_REFL_DATA(N)
Definition Macros.hpp:541
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
#define CE_EXPLICIT(EXPR)
Definition Macros.hpp:413
A retain-release type of smart pointer.
Definition SmartPtr.hpp:132
Definition GPUCommandBuffer.hpp:77
A helper class that begins a scoped graphics pipeline recording.
Definition GPUGraphicsPipeline.hpp:818
Scope(GPUCommandBuffer &commandBuffer, GPUGraphicsPipeline &graphicsPipeline)
Creates a new scope and calls begin() on the pipeline.
Definition GPUGraphicsPipeline.hpp:830
Scope(const GPUCommandBufferPtr &commandBuffer, const GPUGraphicsPipelinePtr &graphicsPipeline)
Creates a new scope and calls begin() on the pipeline.
Definition GPUGraphicsPipeline.hpp:842
~Scope() noexcept
Unbound the pipeline from the command buffer.
Definition GPUGraphicsPipeline.hpp:846
Scope(const GPUCommandBufferPtr &commandBuffer, GPUGraphicsPipeline &graphicsPipeline)
Creates a new scope and calls begin() on the pipeline.
Definition GPUGraphicsPipeline.hpp:836
Scope(GPUCommandBuffer &commandBuffer, const GPUGraphicsPipelinePtr &graphicsPipeline)
Creates a new scope and calls begin() on the pipeline.
Definition GPUGraphicsPipeline.hpp:839
void reset()
Unbound the pipeline from the command buffer.
Definition GPUGraphicsPipeline.hpp:850
Definition GPUGraphicsPipeline.hpp:790
decltype(auto) with(GPUCommandBuffer &commandBuffer, Func &&func)
Prepares the pipeline for execution.
Definition GPUGraphicsPipeline.hpp:865
GPUGraphicsPipeline(GPUGraphicsPipeline &&)=delete
Deleted move constructor.
GPUGraphicsPipeline(const GPUGraphicsPipeline &)=delete
Deleted copy constructor.
virtual void end(GPUCommandBuffer &commandBuffer)=0
Finishes the pipeline execution.
GPUGraphicsPipeline & operator=(const GPUGraphicsPipeline &)=delete
GPUGraphicsPipeline & operator=(GPUGraphicsPipeline &&)=delete
virtual void begin(GPUCommandBuffer &commandBuffer)=0
Prepares the pipeline for execution.
Definition Application.hpp:19
GPUPolygonMode
Polygon filling modes enumeration.
Definition GPUGraphicsPipeline.hpp:143
@ Wireframe
Draw triangle edges only.
@ Points
Draw vertex points only.
@ Fill
Draw filled polygon.
GPUCullMode
Polygon culling modes enumeration.
Definition GPUGraphicsPipeline.hpp:153
@ Front
Front face culling.
GPUConservativeRasterizationMode
Specify the conservative rasterization mode.
Definition GPUGraphicsPipeline.hpp:204
@ Underestimate
Specifies that conservative rasterization is enabled in underestimation mode.
@ Overestimate
Specifies that conservative rasterization is enabled in overestimation mode.
constexpr Byte operator<<(const Byte arg, const _IntType shift) noexcept
Definition DataTypes.hpp:44
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
GPUCompareOp
Compare operations enumeration.
Definition GPUGraphicsPipeline.hpp:37
@ NotEqual
Comparison passes if the source data is not equal to the right-hand-side.
@ Less
Comparison passes if the source data is less than the destination data.
@ AlwaysPass
Comparison always passes.
@ GreaterEqual
Comparison passes if the source data is greater than or equal to the right-hand-side.
@ Greater
Comparison passes if the source data is greater than the right-hand-side.
@ NeverPass
Comparison never passes.
@ LessEqual
Comparison passes if the source data is less than or equal to the right-hand-side.
GPUBlendOp
Blending operations enumeration.
Definition GPUGraphicsPipeline.hpp:84
@ DestinationAlpha
Data source is alpha data (A) from a framebuffer.
@ One
Data source is the color white (1, 1, 1, 1).
@ InverseDestinationColor
Data source is inverted color data (1 - RGB) from a framebuffer.
@ InverseDestinationAlpha
Data source is inverted alpha data (1 - A) from a framebuffer.
@ SourceColor
Data source is color data (RGB) from a fragment shader.
@ InverseSourceAlpha
Data source is inverted alpha data (1 - A) from a fragment shader.
@ Source1Color
Data sources are both color data (RGB) from a fragment shader with dual-source color blending.
@ BlendFactor
Data source is the blend factor (RGBA) from the blend state.
@ SourceAlpha
Data source is alpha data (A) from a fragment shader.
@ InverseSource1Color
Data sources are both inverted color data (1 - RGB) from a fragment shader with dual-source color ble...
@ Source1Alpha
Data sources are both alpha data (A) from a fragment shader with dual-source color blending.
@ SourceAlphaSaturate
Data source is alpha data (A) from a fragment shader which is clamped to 1 or less.
@ InverseSourceColor
Data source is inverted color data (1 - RGB) from a fragment shader.
@ DestinationColor
Data source is color data (RGB) from a framebuffer.
@ InverseBlendFactor
Data source is the inverted blend factor (1 - RGBA) from the blend state.
@ InverseSource1Alpha
Data sources are both inverted alpha data (1 - A) from a fragment shader with dual-source color blend...
std::int32_t Int32
Definition DataTypes.hpp:21
struct CeresEngine::GLState state
GPUBlendArithmetic
Blending arithmetic operations enumeration.
Definition GPUGraphicsPipeline.hpp:129
@ ReverseSubtract
Subtract source 2 from source 1.
GPUStencilOp
Stencil operations enumeration.
Definition GPUGraphicsPipeline.hpp:63
@ Keep
Keep the existing stencil data.
@ Replace
Set the stencil data to the reference value.
@ IncrementAndClamp
Increment the stencil value by 1, and clamp the result.
@ IncrementAndWrap
Increment the stencil value by 1, and wrap the result if necessary.
@ DecrementAndWrap
Decrement the stencil value by 1, and wrap the result if necessary.
@ Invert
Invert the stencil data.
@ DecrementAndClamp
Decrement the stencil value by 1, and clamp the result.
@ Zero
Set stencil data to 0.
sfl::small_vector< T, N, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > SmallVector
SmallVector is a sequence container similar to Vector.
Definition SmallVector.hpp:31
std::array< T, N > Array
Array is a container that encapsulates fixed size arrays.
Definition Array.hpp:17
std::uint32_t UInt32
Definition DataTypes.hpp:23
std::function< void()> GPURenderingBlock
A block executed by the render pass implementation when the renderer is ready to receive draw command...
Definition GPUComputePipeline.hpp:60
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::set< Key, Compare, ScopedAllocatorAdaptor< StdAllocator< Key, RawAllocator > > > Set
Set is an associative container that contains a sorted set of unique objects of type Key.
Definition Set.hpp:21
GPULogicOp
Logical pixel operation enumeration.
Definition GPUGraphicsPipeline.hpp:166
@ NOR
Resulting operation: ~(src | dst).
@ OR
Resulting operation: src | dst.
@ ANDReverse
Resulting operation: src & ~dst.
@ NAND
Resulting operation: ~(src & dst).
@ AND
Resulting operation: src & dst.
@ Copy
Resulting operation: src.
@ NoOp
Resulting operation: dst.
@ ORInverted
Resulting operation: ~src | dst.
@ XOR
Resulting operation: src ^ dst.
@ ANDInverted
Resulting operation: ~src & dst.
@ Equivalent
Resulting operation: ~(src ^ dst).
@ ORReverse
Resulting operation: src | ~dst.
@ Clear
Resulting operation: 0.
@ CopyInverted
Resulting operation: ~src.
Blending state descriptor structure.
Definition GPUGraphicsPipeline.hpp:638
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition GPUGraphicsPipeline.hpp:684
Array< GPUBlendTargetDescriptor, 8 > targets
Render-target blend states for the respective color attachments.
Definition GPUGraphicsPipeline.hpp:680
Blend target state descriptor structure.
Definition GPUGraphicsPipeline.hpp:586
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition GPUGraphicsPipeline.hpp:625
Conservative rasterization descriptor structure to control how the GPU should perform conservative ra...
Definition GPUGraphicsPipeline.hpp:498
Depth bias descriptor structure to control fragment depth values.
Definition GPUGraphicsPipeline.hpp:469
Depth state descriptor structure.
Definition GPUGraphicsPipeline.hpp:367
Definition GPUGraphicsPipeline.hpp:721
Graphics pipeline state descriptor structure.
Definition GPUGraphicsPipeline.hpp:694
GPUBlendDescriptor blend
Specifies the blending state descriptor.
Definition GPUGraphicsPipeline.hpp:709
GPURasterizerDescriptor rasterizer
Definition GPUGraphicsPipeline.hpp:705
GPUStencilDescriptor stencil
Specifies the stencil state descriptor.
Definition GPUGraphicsPipeline.hpp:701
GPUDepthDescriptor depth
Specifies the depth state descriptor.
Definition GPUGraphicsPipeline.hpp:697
Multi-sampling descriptor structure.
Definition GPUGraphicsPipeline.hpp:335
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition GPUGraphicsPipeline.hpp:359
Rasterizer state descriptor structure.
Definition GPUGraphicsPipeline.hpp:521
Definition GPUResourceSet.hpp:716
Stencil state descriptor structure.
Definition GPUGraphicsPipeline.hpp:444
Stencil face descriptor structure.
Definition GPUGraphicsPipeline.hpp:395
Primitive topology enumeration.
Definition PrimitiveTopology.hpp:21
Definition GPUGraphicsPipeline.hpp:281
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition GPUGraphicsPipeline.hpp:315
Scissor(const TOffset2< Int32 > &offset, const TExtent2< Int32 > &extent) noexcept
Scissor constructor with offset and extent parameters.
Definition GPUGraphicsPipeline.hpp:310
Definition GPUGraphicsPipeline.hpp:214
static constexpr void reflect(Processor &&RTTI)
Executes the given processor for every field of the struct.
Definition GPUGraphicsPipeline.hpp:273
TExtent2< float > extent
The viewport size.
Definition GPUGraphicsPipeline.hpp:221
TOffset2< float > origin
The viewport origin. By default (0.0, 0.0).
Definition GPUGraphicsPipeline.hpp:216