Class Sampler

Inheritance Relationships

Base Type

Class Documentation

class Sampler : public CE::Rendering::Sampling::Sampler

Declaration: final

Immutable native sampler object; separate from image pixels/default sampling.

See also

Rendering guide

Public Functions

Sampler(std::shared_ptr<ResourceLifetime> lifetime, const CE::Rendering::Sampling::Options &options)

Create native sampling state in a live owner/current-context lifetime.

Parameters:
  • lifetime – Required domain retained by its Handle.

  • options – Valid immutable request; MaximumSupported resolves to the available maximum or 1. Malformed options/domain or native/allocation failures reject construction; no image is retained or mutated.

virtual void bind(std::uint32_t unit) const override

Bind the sampler object to one validated unit.

Parameters:

unit – Zero-based supported texture unit. Requires live owner/current context; does not select an image or alter its default policy. Pipeline validation separately checks compatible image mipmaps/domain.

void require_binding(std::uint32_t unit) const

Validate active owner/current context and zero-based unit range without binding.

Parameters:

unit – Unit below the construction-context limit. Invalid units throw invalid_args; stopped/foreign/noncurrent access throws failed_operation.

inline const ResourceLifetime *resource_domain() const noexcept

Declaration: [[nodiscard]]

Returns:

Borrowed native lifetime identity while this sampler is retained; no activity/current-context check occurs.