Class Pipeline

Inheritance Relationships

Base Type

Class Documentation

class Pipeline : public CE::Rendering::Resources::Pipeline

Declaration: final

Immutable reflected OpenGL pipeline retaining its linked program and reset values.

Construction/playback use the program’s live owner/current context. Complete requests validate before program/image/fixed draw state is changed; native execution after validation is not an atomic transaction.

See also

Rendering guide

Public Functions

Pipeline(CE::Rendering::Pipelines::Definition definition, std::shared_ptr<Program> program, const PipelineBindings &bindings)

Validate common recipe structure and reflect a retained linked program.

Parameters:
  • definition – Owned immutable layout/topology/state/public-parameter contract.

  • program – Nonnull linked executable in its live owner/current context.

  • bindings – Borrowed explicit uniform/attribute mappings copied into resolved native locations. Unknown/duplicate mappings, incompatible active attributes/uniforms, missing required uniforms, uncovered active uniforms or optional uniforms lacking resets/defaults throw invalid_args. Native reflection/allocation failures propagate; no pipeline is published.

inline const ResourceLifetime *resource_domain() const noexcept

Declaration: [[nodiscard]]

Returns:

Borrowed native domain identity of the retained program; it does not prove live/current native access.

void validate_resources(const CE::Rendering::Parameters::Set &values) const

Check image/sampler domains, unit limits and requested mipmap completeness without binding.

Parameters:

values – Stable partial or complete values; this method alone does not validate all parameter keys/types/completeness. Requires the program’s live owner/current context, even when values contain no images. Foreign/non-OpenGL images/samplers, invalid units or mipmapped sampling of an incomplete image throw invalid_args. Inputs/native binding state remain unchanged.

void bind_parameters(const CE::Rendering::Parameters::Set &values) const

Prepare resets, validate a complete request, then select the program and apply values/images/samplers.

Parameters:

values – Complete required values; active optional omissions receive contract defaults or explicit resets. Requires live owner/current context. Validation/allocation failures occur before binding changes; native application has no rollback. This does not apply fixed blend/depth/cull/scissor state or draw geometry.

void draw(const CE::Rendering::Geometry::Buffer2D &geometry, std::size_t first_vertex, std::size_t vertex_count, const CE::Rendering::Parameters::Set &values, const CE::Rendering::Pipelines::PassConstraints2D &constraints) const

Validate and draw an unclipped range, explicitly disabling scissor state.

Parameters:
  • geometry – OpenGL VertexArray in this pipeline’s live native domain.

  • first_vertex – Zero-based first vertex.

  • vertex_count – Nonzero complete-primitive count within the upload.

  • values – Required resolved values plus optional resets/defaults.

  • constraints – Pass-state requirements. Validates CPU metadata, native domain/current owner and complete resource values before changing draw state. Then reapplies fixed state, parameters and geometry in order; no rollback of native execution is promised.

void draw(const CE::Rendering::Geometry::Buffer2D &geometry, std::size_t first_vertex, std::size_t vertex_count, const CE::Rendering::Parameters::Set &values, const CE::Rendering::Pipelines::PassConstraints2D &constraints, const std::optional<ClipRegion2D> &clip, CE::Platform::FramebufferSize framebuffer) const

Draw the same validated range with an optional retained logical clip.

Parameters:
  • geometry – Compatible same-domain OpenGL VertexArray.

  • first_vertex – First vertex index, not bytes.

  • vertex_count – Complete-primitive vertex count.

  • values – Complete request with optional native resets.

  • constraints – Pass-state requirements.

  • clip – Retained logical clip; absent disables scissor.

  • framebuffer – Nonnegative playback pixel extent used only for clip conversion. Clips clamp/round outward and convert top-left edges to native bottom-left scissor. Empty resolved clips return after validation without changing draw state. Errors before native application preserve binding/fixed state; later native execution is not atomic.