|
ObjectivelyGPU
Object oriented graphics framework for SDL3 and C
|
A scoped render pass for recording draw commands into a CommandBuffer. More...
#include <RenderPass.h>
Public Member Functions | |
| void | bindFragmentSamplers (const RenderPass *self, Uint32 firstSlot, const SDL_GPUTextureSamplerBinding *bindings, Uint32 num) |
| Binds texture-sampler pairs for the fragment stage. | |
| void | bindFragmentStorageBuffers (const RenderPass *self, Uint32 firstSlot, SDL_GPUBuffer *const *buffers, Uint32 num) |
| Binds read-only storage buffers for the fragment stage. | |
| void | bindFragmentStorageTextures (const RenderPass *self, Uint32 firstSlot, SDL_GPUTexture *const *textures, Uint32 num) |
| Binds read-only storage textures for the fragment stage. | |
| void | bindIndexBuffer (const RenderPass *self, const SDL_GPUBufferBinding *binding, SDL_GPUIndexElementSize indexElementSize) |
| Binds an index buffer for indexed draw calls. | |
| void | bindPipeline (RenderPass *self, GraphicsPipeline *pipeline) |
| Binds a graphics pipeline for subsequent draw calls. | |
| void | bindVertexBuffers (const RenderPass *self, Uint32 firstSlot, const SDL_GPUBufferBinding *bindings, Uint32 num) |
| Binds vertex buffers for subsequent draw calls. | |
| void | bindVertexSamplers (const RenderPass *self, Uint32 firstSlot, const SDL_GPUTextureSamplerBinding *bindings, Uint32 num) |
| Binds texture-sampler pairs for the vertex stage. | |
| void | bindVertexStorageBuffers (const RenderPass *self, Uint32 firstSlot, SDL_GPUBuffer *const *buffers, Uint32 num) |
| Binds read-only storage buffers for the vertex stage. | |
| void | bindVertexStorageTextures (const RenderPass *self, Uint32 firstSlot, SDL_GPUTexture *const *textures, Uint32 num) |
| Binds read-only storage textures for the vertex stage. | |
| void | beginQuery (const RenderPass *self, QueryPool *pool, Uint32 index) |
Begins a query, accumulating results from subsequent draw calls until endQuery. | |
| void | endQuery (const RenderPass *self, QueryPool *pool, Uint32 index) |
Ends a query begun with beginQuery. | |
| void | drawIndexedPrimitives (const RenderPass *self, Uint32 numIndices, Uint32 numInstances, Uint32 firstIndex, Sint32 vertexOffset, Uint32 firstInstance) |
| Draws indexed primitives. | |
| void | drawIndexedPrimitivesIndirect (const RenderPass *self, SDL_GPUBuffer *buffer, Uint32 offset, Uint32 drawCount) |
| Draws indexed primitives with parameters sourced from a GPU buffer. | |
| void | drawPrimitives (const RenderPass *self, Uint32 numVertices, Uint32 numInstances, Uint32 firstVertex, Uint32 firstInstance) |
| Draws non-indexed primitives. | |
| void | drawPrimitivesIndirect (const RenderPass *self, SDL_GPUBuffer *buffer, Uint32 offset, Uint32 drawCount) |
| Draws non-indexed primitives with parameters sourced from a GPU buffer. | |
| RenderPass * | init (RenderPass *self, CommandBuffer *commands, SDL_GPURenderPass *pass) |
| Initializes this RenderPass wrapping the given SDL render pass. | |
| void | setBlendConstants (RenderPass *self, SDL_FColor blendConstants) |
Sets the blend constants used by SDL_GPU_BLENDFACTOR_CONSTANT_* factors. | |
| void | setScissor (const RenderPass *self, const SDL_Rect *scissor) |
| void | setStencilReference (RenderPass *self, Uint8 reference) |
| Sets the stencil reference value used in stencil tests. | |
| void | setViewport (const RenderPass *self, const SDL_GPUViewport *viewport) |
| Class * | _RenderPass (void) |
| The RenderPass archetype. | |
| void | setScissor (RenderPass *self, const SDL_Rect *scissor) |
| Sets the scissor rectangle. Pass NULL to reset to the full viewport. | |
| void | setViewport (RenderPass *self, const SDL_GPUViewport *viewport) |
| Sets the viewport. Pass NULL to reset to the full render target. | |
Data Fields | |
| Object | object |
| The superclass. | |
| SDL_FColor | blendConstants |
| The current blend constants. | |
| GraphicsPipeline * | pipeline |
The currently bound pipeline, or NULL. | |
| SDL_Rect | scissor |
| The current scissor. | |
| Uint8 | stencilReference |
| The current stencil reference. | |
| SDL_GPUViewport | viewport |
| The current viewport. | |
| ident | data |
| User data. | |
Protected Attributes | |
| RenderPassInterface * | interface |
| The interface. | |
A scoped render pass for recording draw commands into a CommandBuffer.
Obtain a RenderPass from CommandBuffer::beginRenderPass. When all draw commands have been recorded, release the pass — dealloc calls SDL_EndGPURenderPass automatically so no explicit end is required:
| Class * _RenderPass | ( | void | ) |
The RenderPass archetype.
| void beginQuery | ( | const RenderPass * | self, |
| QueryPool * | pool, | ||
| Uint32 | index | ||
| ) |
Begins a query, accumulating results from subsequent draw calls until endQuery.
A no-op when pool is backed by an unsupported SDL3 build; see QueryPool.
| void bindFragmentSamplers | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| const SDL_GPUTextureSamplerBinding * | bindings, | ||
| Uint32 | num | ||
| ) |
Binds texture-sampler pairs for the fragment stage.
| void bindFragmentStorageBuffers | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| SDL_GPUBuffer *const * | buffers, | ||
| Uint32 | num | ||
| ) |
Binds read-only storage buffers for the fragment stage.
| void bindFragmentStorageTextures | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| SDL_GPUTexture *const * | textures, | ||
| Uint32 | num | ||
| ) |
Binds read-only storage textures for the fragment stage.
| void bindIndexBuffer | ( | const RenderPass * | self, |
| const SDL_GPUBufferBinding * | binding, | ||
| SDL_GPUIndexElementSize | indexElementSize | ||
| ) |
Binds an index buffer for indexed draw calls.
| void bindPipeline | ( | RenderPass * | self, |
| GraphicsPipeline * | pipeline | ||
| ) |
Binds a graphics pipeline for subsequent draw calls.
| void bindVertexBuffers | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| const SDL_GPUBufferBinding * | bindings, | ||
| Uint32 | num | ||
| ) |
Binds vertex buffers for subsequent draw calls.
| void bindVertexSamplers | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| const SDL_GPUTextureSamplerBinding * | bindings, | ||
| Uint32 | num | ||
| ) |
Binds texture-sampler pairs for the vertex stage.
| void bindVertexStorageBuffers | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| SDL_GPUBuffer *const * | buffers, | ||
| Uint32 | num | ||
| ) |
Binds read-only storage buffers for the vertex stage.
| void bindVertexStorageTextures | ( | const RenderPass * | self, |
| Uint32 | firstSlot, | ||
| SDL_GPUTexture *const * | textures, | ||
| Uint32 | num | ||
| ) |
Binds read-only storage textures for the vertex stage.
| void drawIndexedPrimitives | ( | const RenderPass * | self, |
| Uint32 | numIndices, | ||
| Uint32 | numInstances, | ||
| Uint32 | firstIndex, | ||
| Sint32 | vertexOffset, | ||
| Uint32 | firstInstance | ||
| ) |
Draws indexed primitives.
| void drawIndexedPrimitivesIndirect | ( | const RenderPass * | self, |
| SDL_GPUBuffer * | buffer, | ||
| Uint32 | offset, | ||
| Uint32 | drawCount | ||
| ) |
Draws indexed primitives with parameters sourced from a GPU buffer.
| void drawPrimitives | ( | const RenderPass * | self, |
| Uint32 | numVertices, | ||
| Uint32 | numInstances, | ||
| Uint32 | firstVertex, | ||
| Uint32 | firstInstance | ||
| ) |
Draws non-indexed primitives.
| void drawPrimitivesIndirect | ( | const RenderPass * | self, |
| SDL_GPUBuffer * | buffer, | ||
| Uint32 | offset, | ||
| Uint32 | drawCount | ||
| ) |
Draws non-indexed primitives with parameters sourced from a GPU buffer.
| void endQuery | ( | const RenderPass * | self, |
| QueryPool * | pool, | ||
| Uint32 | index | ||
| ) |
Ends a query begun with beginQuery.
A no-op when pool is backed by an unsupported SDL3 build; see QueryPool.
| RenderPass * init | ( | RenderPass * | self, |
| CommandBuffer * | commands, | ||
| SDL_GPURenderPass * | pass | ||
| ) |
Initializes this RenderPass wrapping the given SDL render pass.
| self | The RenderPass. |
| commands | The CommandBuffer that created this pass. |
| pass | The SDL render pass to wrap. Must not be NULL. |
| void setBlendConstants | ( | RenderPass * | self, |
| SDL_FColor | blendConstants | ||
| ) |
Sets the blend constants used by SDL_GPU_BLENDFACTOR_CONSTANT_* factors.
| void setScissor | ( | const RenderPass * | self, |
| const SDL_Rect * | scissor | ||
| ) |
| void setScissor | ( | RenderPass * | self, |
| const SDL_Rect * | scissor | ||
| ) |
Sets the scissor rectangle. Pass NULL to reset to the full viewport.
| void setStencilReference | ( | RenderPass * | self, |
| Uint8 | reference | ||
| ) |
Sets the stencil reference value used in stencil tests.
| void setViewport | ( | const RenderPass * | self, |
| const SDL_GPUViewport * | viewport | ||
| ) |
| void setViewport | ( | RenderPass * | self, |
| const SDL_GPUViewport * | viewport | ||
| ) |
Sets the viewport. Pass NULL to reset to the full render target.
| SDL_FColor RenderPass::blendConstants |
The current blend constants.
| ident RenderPass::data |
User data.
|
protected |
The interface.
| Object RenderPass::object |
The superclass.
| GraphicsPipeline* RenderPass::pipeline |
The currently bound pipeline, or NULL.
| SDL_Rect RenderPass::scissor |
The current scissor.
| Uint8 RenderPass::stencilReference |
The current stencil reference.
| SDL_GPUViewport RenderPass::viewport |
The current viewport.