IRhiCapabilities class
Interface to query the runtime capabilities of the selected RHI backend.
Abstracts access to the version numbers, information strings, integer limits and extension availability flags of the active rendering device, so renderer code can adapt to it without issuing backend queries directly. The values and extensions are the OpenGL ones the render pipeline has always read, named after their GL_ constants (IntValues::MaxTextureSize is GL_MAX_TEXTURE_SIZE); a backend that has no OpenGL context publishes the equivalent limit of its own API under the same name. RhiCapabilitiesBase is the shared implementation every backend derives from, aliased as RHI::Capabilities for the backend selected at compile time.
Derived classes
- class RhiCapabilitiesBase
- Backend-independent part of the RHI capabilities.
Public types
- struct InfoStrings
- Device information strings.
- enum class ApiVersion { Major, Minor, Release }
- API version component.
- enum class IntValues { MaxTextureSize = 0, MaxTextureImageUnits, MaxUniformBlockSize, MaxUniformBlockSizeNormalized, MaxUniformBufferBindings, MaxVertexUniformBlocks, MaxFragmentUniformBlocks, UniformBufferOffsetAlignment, MaxVertexAttribStride, MaxColorAttachments, NumProgramBinaryFormats, MaxBatchSize, Count }
- Queryable runtime integer value.
- enum class ArrayIntValues { ProgramBinaryFormats = 0, Count }
- Queryable runtime integer array value.
- enum class Extensions { KhrDebug = 0, ArbTextureStorage, ArbBufferStorage, ArbGetProgramBinary, ExtTextureCompressionS3tc, AmdCompressedAtcTexture, ImgTextureCompressionPvrtc, KhrTextureCompressionAstcLdr, Count }
- Queryable OpenGL extension, only ever available with the OpenGL family backend.
Constructors, destructors, conversion operators
- ~IRhiCapabilities() pure virtual
Public functions
-
auto GetApiVersion(ApiVersion version) const -> std::
int32_t pure virtual - Returns the specified API version component.
- auto GetInfoStrings() const -> const InfoStrings& pure virtual
- Returns the device information strings.
-
auto GetValue(IntValues valueName) const -> std::
int32_t pure virtual - Returns a runtime integer value.
-
auto GetArrayValue(ArrayIntValues arrayValueName,
std::
uint32_t index) const -> std:: int32_t pure virtual - Returns an element of a runtime integer array value.
- auto HasExtension(Extensions extensionName) const -> bool pure virtual
- Returns
trueif the specified OpenGL extension is available.
Enum documentation
enum class nCine:: RHI:: IRhiCapabilities:: IntValues
Queryable runtime integer value.
| Enumerators | |
|---|---|
| MaxTextureSize |
|
| MaxTextureImageUnits |
|
| MaxUniformBlockSize |
|
| MaxUniformBlockSizeNormalized |
|
| MaxUniformBufferBindings |
|
| MaxVertexUniformBlocks |
|
| MaxFragmentUniformBlocks |
|
| UniformBufferOffsetAlignment |
|
| MaxVertexAttribStride |
|
| MaxColorAttachments |
|
| NumProgramBinaryFormats |
|
| MaxBatchSize |
Instance batch size this backend requires, or 0 to let the uniform block budget decide. The block budget is normally what limits a batch, so most backends leave this at 0 and the batcher sizes itself as "block size / instance stride". Where that derivation does not hold the backend states the count here, and it is applied everywhere a batch is sized - both shader compilation paths and RenderBatcher, which pins its minimum and maximum to it. Two kinds of backend publish one. On the RSX it is a hard ceiling: the instance array reaches the vertex program through its constant registers rather than a bindable buffer, so every batched variant is compiled offline for one fixed count and cannot address more however much block space is published - exceeding it overruns the instance array. Elsewhere it is a deliberate choice: a backend that copies the whole array into the draw rather than binding it would otherwise be handed tens of KB of per-draw uniform data, which is not a shape the hardware is meant to be fed. |
| Count |
|