Graphics rendering pipeline for ossia score. More...
Detailed Description
Graphics rendering pipeline for ossia score.
Compile-time detection and dispatch for the QRhi indirect APIs that are newer than this project's Qt floor:
Qt 6.12: QRhi::DrawIndirect / DrawIndirectMulti, QRhiCommandBuffer::drawIndirect / drawIndexedIndirect Qt 6.13: QRhi::DispatchIndirect / DrawIndirectCount, QRhiCommandBuffer::dispatchIndirect, drawIndirectCount / drawIndexedIndirectCount
Detection is by member/enumerator rather than QT_VERSION_CHECK(6, 13, 0): the ossia SDK pins the Qt 6.12 branch and cherry-picks the dev (6.13) indirect changes on top (sdk common/clone-qt.sh: refs/changes/11/738611, 12/738612, 69/761469). On those builds QT_VERSION says 6.12 while the 6.13 API is present, so a version gate would silently compile the features out of the reference builds. A stock 6.12 lacks the API entirely, and CI's floor is 6.4. Member/enumerator detection is right on all three tiers; version macros are right on only two.
SCORE_GFX_SIMULATE_QT612: this compile flag forces every 6.13-era detection below to false even when the API exists, so the "Qt 6.12: multi-draw indirect but no count, no indirect dispatch" tier can be built and run against a newer Qt when no stock 6.12 build is reachable. The runtime equivalents are the SCORE_GFX_NO_GPU_INDIRECT* environment kill switches in RenderList.cpp.
This namespace provides a rendering pipeline for GPU visuals, by the way of a rendering graph. The implementation uses the Qt RHI:
https://www.qt.io/blog/graphics-in-qt-6.0-qrhi-qt-quick-qt-quick-3d
It is mainly designed for rendering a succession of visual effects, not rendering arbitrary 3D. Shaders are written in the usual glslang -> spirv-cross fashion, with GLSL version 450. They are then translated automatically to SPIRV, Metal, GLSL or D3D11 shaders.
The overall design is as follows :
- Elements to render are represented as nodes to a graph: score::gfx::Node
- Input ports are the uniforms and input textures & audio data.
- Output ports generally are just the texture we are rendering to.
- score::gfx::Graph contains all the nodes, and relationships between these nodes.
- For each output sink (a window surface, an NDI or Spout output...), a score::gfx::RenderList is created. It contains all the nodes to render for a given output.
- For each score::gfx::Node, the score::gfx::RenderList creates a score::gfx::NodeRenderer which contains the actual GPU resource handles for the sink.
Given the following graph :
Two render lists are created, the first being
and the second being
Rendering for these two RenderList is entirely independent - they can render at different sizes and potentially use different graphic APIs, e.g. one OpenGL and the other Vulkan. This is also done to enable threaded rendering for each of these.
We provide the most essential nodes for building interesting visual effects:
- A window output node (score::gfx::ScreenNode).
- Shader filters using Interactive Shader Format (https://isf.video).
- Video (score::gfx::VideoNode) and image (score::gfx::ImagesNode) renderers.
- The video renderer tries to do as much of the decoding as possible on the GPU: for instance YUV420, HAP, ... are decoded on the GPU. Otherwises it falls back on libavcodec to guarantee compatibility with a wide range of video formats.
Other plug-ins may provide other useful things, such as NDI I/O or particle effects.
See GfxPlugins for information on how to create your custom nodes, visual effects and video decoders.
Namespaces | |
| namespace | RhiClearBuffer |
| Fill (a sub-range of) a QRhiBuffer with a 4-byte pattern. | |
Classes | |
| struct | ArrayParseResult |
| struct | AudioTexture |
| Data model for audio data being sent to the GPU. More... | |
| struct | AudioTextureUpload |
| struct | BackgroundNode |
| struct | BasicMesh |
| struct | BayerDecoder |
| Demosaics a single-channel colour-filter-array frame into RGB. More... | |
| struct | BayerExternalOESDecoder |
| struct | BGRAComputeEncoder |
| Compute-shader RGBA -> BGRA (NTV2_FBF_ARGB byte order) encoder targeting an external SSBO. More... | |
| struct | BGRAEncoder |
| Cross-backend RGBA -> BGRA byte-order encoder. More... | |
| struct | BitField |
| One channel's placement inside the packed container. More... | |
| struct | BufferCopyRegion |
| Region-based GPU buffer copy for strided / gather patterns. More... | |
| struct | BufferRange |
| struct | BufferView |
| struct | CameraUBOData |
| struct | CaptureAdjust |
| Sensor-side corrections, in the order the shader applies them. More... | |
| class | CaptureAdjustSlot |
| Cross-thread handoff for CaptureAdjust. More... | |
| struct | CaptureMaterialUBO |
| The capture path's material block: the shared one, plus corrections. More... | |
| struct | ComputeEncoder |
| Base interface for compute-shader RGBA -> AJA-format encoders. More... | |
| struct | CudaFunctions |
| Runtime-loaded CUDA driver-API table. Owns the libcuda handle. More... | |
| class | CustomMesh |
| struct | DecodedImage |
| struct | DefaultShaderMaterial |
| Utility to represent a shader material following score conventions. More... | |
| class | DirectVideoNodeRenderer |
| Renderer for intra-only video codecs with instant seeking. More... | |
| struct | DirectVideoOutputBackend |
Vendor playout backend. Constructed with its vendor-specific settings (video format, pixel format, channel, link, HDR, ...); open() then brings the device up. The node queries geometry/format/planes and drives playout through the registrar + GPU-direct candidates + pacing hooks. More... | |
| class | DirectVideoOutputNode |
| class | DisplayVSyncClock |
| Wraps ScreenNode's swap-chain vsync callback path (clock #1, push). More... | |
| struct | DMACaptureBackend |
| Vendor seam for a DMA capture card's input path. More... | |
| struct | DMACaptureInputNode |
ProcessNode base for DMA capture-card inputs. One Image output port; its renderer is the generic DMACaptureRenderer. More... | |
| struct | DrawCall |
| struct | DrawCommandRange |
| struct | DummyMesh |
| struct | DXVDecoder |
| Decodes DXV DXT1/DXT5 (Resolume) format to GPU. More... | |
| struct | DXVYCoCgDecoder |
| Decodes DXV YCG6/YG10 (YCoCg) format to GPU. More... | |
| struct | Edge |
| Connection between two score::gfx::Port. More... | |
| struct | EmptyDecoder |
| Default decoder when we do not know what to render. More... | |
| struct | EnvParamsUBO |
| class | ExternalGenlockClock |
| Hardware-genlock render clock (opt-in): a card's output VBI. More... | |
| struct | FallbackBindingPlan |
| struct | FlatScene |
| class | FlattenedSceneFilterNode |
| struct | FlattenVisitor |
| struct | FullScreenImageNode |
| struct | GaussianSplatNode |
| Gaussian Splat rendering node. More... | |
| class | GaussianSplatRenderer |
| Renderer for GaussianSplatNode. More... | |
| class | GenericNodeRenderer |
| Generic renderer. More... | |
| struct | geometry |
| struct | geometry_input_port_vis |
| class | GeometryFilterNode |
| Data model for geometry filters. More... | |
| struct | GeometryFilterNodeRenderer |
| class | GPUBufferScatter |
| GPU-side buffer format conversion (scatter). More... | |
| class | GPUIndexWiden |
| Widens 16-bit indices in a GPU buffer into 32-bit ones in another. More... | |
| class | GpuResourceRegistry |
| Per-RenderList arena store for GPU-resident scene data. More... | |
| class | GPUStridedCopy |
Copies count elements between two GPU buffers with different strides, in one compute dispatch. More... | |
| class | GpuTimings |
| Named-bucket GPU timing collector. More... | |
| class | GPUVideoDecoder |
| Processes and renders a video frame on the GPU. More... | |
| struct | GPUVideoEncoder |
| Base class for GPU-side video format conversion (RGBA to YUV). More... | |
| struct | Graph |
| Represents a graph of renderers. More... | |
| struct | GraphicsSSBO |
| One SSBO attached to a graphics pipeline. More... | |
| struct | GraphicsStorageImage |
| One storage image attached to a graphics pipeline. More... | |
| struct | GraphicsStorageResources |
| Aggregate of all graphics-visible storage resources for a node. More... | |
| struct | GraphicsUBO |
| One UBO sourced from an upstream Buffer port (uniform_input). More... | |
| struct | HAPDecoder |
| Base class for HAP ((c) Vidvox) decoding. More... | |
| struct | HAPDefaultDecoder |
| Decodes HAP basic format. More... | |
| struct | HAPMDecoder |
| Decodes HAP-M (HAP + alpha channel) More... | |
| struct | HWTransferDecoder |
| Fallback hardware decoder that transfers HW frames to CPU via av_hwframe_transfer_data(), then delegates to a software GPU decoder. More... | |
| struct | I420Encoder |
| GPU RGBA->I420 encoder (planar 4:2:0). More... | |
| struct | image |
| struct | Image |
| Image data and metadata. More... | |
| struct | ImagesNode |
| A node that renders an image to screen. More... | |
| class | IndirectCountClamp |
| The draw-count rung, emulated with compute for backends without it. More... | |
| struct | InstanceKey |
| struct | InstanceKeyHash |
| struct | is_output |
| struct | isf_input_port_count_vis |
| struct | isf_input_port_vis |
| struct | isf_input_size_vis |
| class | ISFNode |
| class | KmsOutputNode |
| OutputNode scanning out directly through DRM/KMS. More... | |
| struct | KmsOutputSettings |
| struct | LayoutResult |
| struct | MaterialExtensionsGPU |
| struct | MaterialGPU |
| struct | MatrixShape |
| class | MergeGeometriesNode |
| struct | Mesh |
| Data model for meshes. More... | |
| struct | MeshBuffers |
| struct | MeshUBO |
| struct | Message |
| struct | ModelCameraUBO |
| UBO shared across all entities shown with the same camera. More... | |
| struct | ModelDisplayNode |
| A node that renders a model to screen. More... | |
| class | ModelSceneDrawer |
| struct | ModelSceneView |
| What a frame of a Model Display shows its scene with. More... | |
| struct | MultiWindowNode |
| class | MultiWindowRenderer |
| struct | no_delay_edges |
| class | Node |
| Root data model for visual nodes. More... | |
| class | NodeModel |
| Common base class for most single-pass, simple nodes. More... | |
| class | NodeRenderer |
| Renderer for a given node. More... | |
| struct | NV12Decoder |
| Decodes NV12 videos. More... | |
| struct | NV12Encoder |
| GPU RGBA->NV12 encoder (semi-planar 4:2:0). More... | |
| struct | NV12ExternalOESDecoder |
| struct | NV16Decoder |
| Decodes NV16 semi-planar 4:2:2 8-bit videos. More... | |
| struct | NV24Decoder |
| Decodes NV24 / NV42 semi-planar 4:4:4 8-bit videos. More... | |
| struct | OffscreenFrame |
| RAII bracket for QRhi::beginOffscreenFrame / endOffscreenFrame. More... | |
| struct | OutputConfiguration |
| class | OutputNode |
| Base class for sink nodes (QWindow, spout, syphon, NDI output, ...) More... | |
| class | OutputNodeRenderer |
| struct | OutputUBO |
| UBO shared across all entities shown on the same output. More... | |
| struct | P010Decoder |
| Decodes P010 videos. More... | |
| struct | P010Encoder |
| GPU RGBA -> p010le encoder (semi-planar 4:2:0, 10-bit). More... | |
| struct | P016Decoder |
| Decodes P016 videos. More... | |
| struct | P210Decoder |
| Decodes P210 and P216 semi-planar 4:2:2 videos. More... | |
| struct | P216Encoder |
| GPU RGBA -> p216 encoder (semi-planar 4:2:2, 16-bit). More... | |
| struct | P216PackedEncoder |
| GPU RGBA -> p216, as ONE texture holding the whole framestore. More... | |
| struct | P410Decoder |
| Decodes P410 semi-planar 4:4:4 10-bit videos. More... | |
| struct | PA16Decoder |
| NDI PA16: P216 with a full-resolution 16-bit alpha plane after it. More... | |
| struct | PackedBitfieldLayout |
| struct | PackedBitfieldYUVDecoder |
| struct | PackedBitfieldYUVLayout |
| struct | PackedDecoder |
| struct | PackedRectDecoder |
| struct | PackedRGBEncoder |
| Generic packed-pixel RGB/byte encoder for AJA framebuffer formats. More... | |
| struct | PAL8Decoder |
| Decodes 8-bit palettized video (AV_PIX_FMT_PAL8): GIF, QuickTime and MS RLE, and the screen and game codecs of the 90s. More... | |
| struct | Pass |
| struct | PersistSampler |
| struct | Pipeline |
| Useful abstraction for storing a graphics pipeline and associated resource bindings. More... | |
| struct | PixelFormatInfo |
| struct | PlainMesh |
| A mesh with only position attributes. More... | |
| struct | PlainTriangle |
| A triangle mesh with only positions. More... | |
| struct | PlanarDecoder |
| struct | PlanarYUVDecoder |
| Decodes planar YUV of any subsampling, at 8 or 16 bits, with or without alpha. More... | |
| struct | PlanarYUVLayout |
| The shape of a planar YUV format: chroma subsampling, sample size, and an optional alpha plane. More... | |
| struct | PointerState |
| struct | Port |
| Port of a score::gfx::Node. More... | |
| struct | port_counts |
| struct | port_indices |
| struct | PreviewHubNode |
| The output that renders, for the editor's previews, the nodes no output of the patch renders. More... | |
| class | PreviewNode |
| class | PreviewRenderer |
| class | PreviewRendererInvertY |
| struct | PreviewTap |
| A preview of what a node outputs, read back by a render list that already renders the node. More... | |
| class | ProcessNode |
| Common base class for nodes that map to score processes. More... | |
| struct | ProcessUBO |
| UBO specific to individual processes / nodes. More... | |
| struct | Quirks |
| Defects of the driver in use, to be worked around. More... | |
| struct | R210Decoder |
| Decodes 10-bit RGB packed in r210 (DeckLink bmdFormat10BitRGB). More... | |
| struct | RawCameraData |
| struct | RawLightData |
| struct | RawLocalTransform |
| struct | ReadbackStats |
| struct | ReadbackTarget |
| struct | RefcountedFrame |
| class | RenderClock |
| Abstract render clock. More... | |
| struct | RenderedCSFNode |
| struct | RenderedFlattenedSceneFilterNode |
| struct | RenderedISFNode |
| struct | RenderedMergeGeometriesNode |
| struct | RenderedRawRasterPipelineNode |
| struct | RenderedSceneFilterNode |
| struct | RenderedScenePreprocessorNode |
| class | RenderList |
| List of nodes to be rendered to an output. More... | |
| struct | RenderState |
| Global state associated to a rendering context. More... | |
| struct | RenderTargetSpecs |
| struct | RGB24Decoder |
| struct | RGB48Decoder |
| struct | RGBA64Decoder |
| struct | Sampler |
| Stores a sampler and the texture currently associated with it. More... | |
| struct | ScatterSource |
| class | SceneFilterNode |
| Tree-level filter on a scene_spec. More... | |
| class | ScenePreprocessorNode |
Bridge from scene_spec (hierarchical, CPU) to geometry_spec (flat, GPU-resident). More... | |
| struct | SceneUBO |
| class | ScopedGpuTimer |
| RAII helper that brackets a named pass region for GPU frame-debug. More... | |
| struct | ScreenNode |
| This node is used for rendering to a score::gfx::Window. More... | |
| struct | ShaderCache |
| Cache of baked QShader instances. More... | |
| struct | ShadowCascadesUBO |
| struct | ShownTexture |
| struct | SimpleRenderedISFNode |
| struct | SimpleRenderedVSANode |
| class | SinkNode |
| An output that draws nowhere. More... | |
| struct | SkeletonGPU |
| struct | Std430TypeInfo |
| struct | SwapChainFrameGuard |
| Closes a swapchain frame if the scope is left without presenting it. More... | |
| struct | TexgenNode |
| struct | TextNode |
| A node that renders text to screen. More... | |
| class | TextureCache |
| struct | TexturedMesh |
| A mesh with positions and texture coordinates. More... | |
| struct | TexturedQuad |
| A quad mesh with positions and texture coordinates. More... | |
| struct | TexturedTriangle |
| A triangle mesh with positions and texture coordinates. More... | |
| struct | TextureRenderTarget |
| Useful abstraction for storing all the data related to a render target. More... | |
| struct | TextureShape |
| class | TextureShare |
| GPU-only triple-buffered texture sharing between two QRhi instances in different threads. More... | |
| class | TextureShareBackend |
| Backend-specific implementation interface for GPU-only texture sharing. More... | |
| class | TextureShareBackendBase |
| class | TimerClock |
| Wraps GfxContext's shared wall-timer (clock #2, the default). More... | |
| struct | Timings |
| Messages sent from the execution thread to the rendering thread. More... | |
| struct | TouchHistoryNode |
The pointers of an output as a texture: vertexshaderart's touch history (greggman/vertexshaderart, src/js/main.js). More... | |
| class | TouchHistoryRenderer |
| class | TripleBufferIndex |
| struct | UYVADecoder |
| NDI UYVA: a UYVY 4:2:2 plane, then a full-resolution alpha plane. More... | |
| struct | UYVY422Decoder |
| Decodes UYVY422 video, mostly used for NDI. More... | |
| struct | UYVYComputeEncoder |
| Compute-shader RGBA -> UYVY (2vuy) encoder targeting an external SSBO. More... | |
| struct | UYVYEncoder |
| GPU RGBA->UYVY encoder (packed 4:2:2). More... | |
| struct | V210ComputeEncoder |
| Compute-shader RGBA -> v210 encoder targeting an external SSBO. More... | |
| struct | V210Decoder |
| Decodes 10-bit 4:2:2 YCbCr packed in v210 (SMPTE ST 2110-20 / SDI native). More... | |
| struct | V210Encoder |
| Cross-backend RGBA -> v210 encoder. More... | |
| class | VertexFallbackPool |
| struct | VertexFallbackSpec |
| struct | VideoFrameReader |
| struct | VideoFrameShare |
| struct | VideoMaterialUBO |
| UBO shared across all video objects. More... | |
| class | VideoNode |
| Model for rendering a video. More... | |
| class | VideoNodeBase |
| class | VideoNodeRenderer |
| class | VideoOwnTexture |
| The decoded frame, converted to RGBA into a texture of the renderer's own. More... | |
| struct | VUYADecoder |
| Decodes VUYA / VUYX packed 4:4:4 8-bit videos. More... | |
| class | Window |
| A platform window in which the content is going to be rendered. More... | |
| struct | WorldTransformEmit |
| struct | WorldTransformMat4 |
| struct | XV30Decoder |
| Decodes XV30 packed 4:4:4 10-bit videos. More... | |
| struct | XYZ12Decoder |
| Decodes XYZ12LE, the DCDM X'Y'Z' of JPEG 2000 DCPs. More... | |
| struct | Y210Decoder |
| Decodes Y210 packed 4:2:2 10-bit videos. More... | |
| struct | YUV420Decoder |
| Decodes YUV420 videos. More... | |
| struct | YUV420P10Decoder |
| Decodes YUV420 videos. More... | |
| struct | YUV420P12Decoder |
| Decodes YUV420 videos. More... | |
| struct | Yuv420PackedEncoder |
| GPU RGBA -> NV12 / I420 / YV12, one texture holding the framestore. More... | |
| struct | YUV422Decoder |
| Decodes YUV422 videos. More... | |
| struct | YUV422P10Decoder |
| Decodes YUV422 videos. More... | |
| struct | YUV422P10Encoder |
| GPU RGBA -> yuv422p10le encoder (planar 4:2:2, 10-bit). More... | |
| struct | YUV422P12Decoder |
| Decodes YUV422 videos. More... | |
| struct | YUV440Decoder |
| Decodes YUV440P planar 4:4:0 8-bit videos. More... | |
| struct | YUV444Decoder |
| Decodes YUV444P videos. More... | |
| struct | YUV444P10Decoder |
| Decodes YUV444P10 videos. More... | |
| struct | YUV444P12Decoder |
| Decodes YUV444P12 videos. More... | |
| struct | YUVA420Decoder |
| Decodes YUVA420P videos. More... | |
| struct | YUVA444Decoder |
| Decodes YUVA444P videos. More... | |
| struct | YUVA444P10Decoder |
| Decodes YUVA444P10 videos. More... | |
| struct | YUVA444P12Decoder |
| Decodes YUVA444P12 videos. More... | |
| struct | YUVPlanarEncoder |
| Generic 3-plane planar YCbCr encoder (8 or 10 bit, 4:2:2 or 4:2:0). More... | |
| struct | YUY2Encoder |
| GPU RGBA->YUY2 encoder (packed 4:2:2, NTV2_FBF_8BIT_YCBCR_YUY2). More... | |
| struct | YUYV422Decoder |
| Decodes YUYV422 video. More... | |
Typedefs | |
| using | Vertex = score::gfx::Node * |
| using | GraphImpl = boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, Vertex, Process::CableType > |
| using | VertexMap = ossia::hash_map< score::gfx::Node *, GraphImpl::vertex_descriptor > |
| using | EdgeSet = ossia::hash_set< const score::gfx::Edge * > |
| using | FunctionMessage = std::function< void(score::gfx::Node &)> |
| using | gfx_input = ossia::variant< ossia::monostate, ossia::value, ossia::audio_vector, ossia::render_target_spec, ossia::transform3d, FunctionMessage, ossia::buffer_spec > |
| using | PassMap = ossia::small_vector< std::pair< Edge *, Pass >, 2 > |
| using | PassOutput = ossia::variant< PersistSampler, TextureRenderTarget > |
Enumerations | |
| enum class | CameraProjectionMode : int { Perspective = 0 , Orthographic = 1 , Fulldome = 2 } |
| enum | ImageMode { Single , Clamped , Tiled , Mirrored } |
| enum class | OutputDepth { None , Texture , DepthStencil } |
| The depth attachment of an output's render target. More... | |
| enum | GraphicsApi { Null , OpenGL , Vulkan , D3D11 , Metal , D3D12 } |
| Available graphics APIs to use. | |
| enum class | SharedDeviceMode { Owned , Cached } |
| Who owns the imported Vulkan device behind a RenderState. More... | |
| enum class | BufferCopyBarrier { Auto , None } |
| Copy the contents of one GPU buffer to another. More... | |
| enum class | ReadbackPath { Unsupported , HostCopy , Import } |
| enum | ScaleMode { Original , BlackBars , Fill , Stretch } |
| How to resize a texture to adapt it to a viewport. | |
| enum | PlaybackMode { AutoPlayback , Direct , FrameQueue } |
| How to choose the video renderer. | |
| enum class | TextureKind : uint8_t { Texture2D , Texture3D , Array , Cube } |
| enum class | TextureLayout : uint8_t { Single , Overview } |
| enum class | Types : int8_t { Empty , Int , Float , Vec2 , Vec3 , Vec4 , Image , Audio , Camera , Geometry , Buffer , Scene } |
| enum class | Flag : uint32_t { GrabsFromSource = (1 << 0) , SamplableDepth = (1 << 1) , TextureArray = (1 << 2) , StorageImage = (1 << 3) , IndirectDraw = (1 << 4) , MultiView = (1 << 5) , DepthOnly = (1 << 6) , UniformBuffer = (1 << 7) , ThreeDimensional = (1 << 8) , Cubemap = (1 << 9) , SingleCable = (1 << 10) } |
Functions | |
| void | packCameraUBO (CameraUBOData &out, const ossia::camera_component &cam, const QMatrix4x4 &worldTransform, QSize renderSize, float timeSeconds, float aspectOverride) |
| constexpr int64_t | cameraAuxByteSize (std::size_t cameraCount) noexcept |
| constexpr std::size_t | cameraPackIndex (std::size_t slot, std::size_t count, int active) noexcept |
| void | writeMat4 (float dst[16], const QMatrix4x4 &src) |
| void | setReverseZPerspective (QMatrix4x4 &out, float fovYDeg, float aspect, float nearPlane, float farPlane) |
| void | setReverseZOrthographic (QMatrix4x4 &out, float halfWidth, float halfHeight, float nearPlane, float farPlane) |
| void | applyTo (const CaptureAdjust &a, CaptureMaterialUBO &ubo) noexcept |
Fills the correction half of ubo. The geometry half is the caller's. | |
| void | adjustCaptureReference (const CaptureAdjust &a, float rgb[3]) noexcept |
| The corrections, on the CPU, in the same order the shader applies them. | |
| bool | buftrace_enabled () |
| float | videoFieldMode (Video::Interlacing interlacing, Video::Deinterlace deinterlace, bool partnerValid) noexcept |
| Which mode score_tc should run, as a uniform value. | |
| std::unique_ptr< GPUVideoDecoder > | createGPUVideoDecoder (Video::ImageFormat &format, const std::string &filter={}) |
| Creates the appropriate GPUVideoDecoder for a given pixel format. | |
| bool | nv12ExternalOesUsable (QRhi::Implementation backend) noexcept |
| QByteArray | toExternalSamplerEssl (QByteArray glsl) |
| QString | packedBitfieldFilter (const PackedBitfieldLayout &l) |
| std::unique_ptr< GPUVideoDecoder > | makePackedBitfieldDecoder (const PackedBitfieldLayout &l, Video::ImageFormat &d) |
| Convenience: the decoder for a packed-bitfield format. | |
| std::unique_ptr< GPUVideoDecoder > | makeWireDecoder (Video::VideoPixelFormat fmt, Video::ImageFormat &d) |
| std::unique_ptr< GPUVideoEncoder > | makeWireEncoder (Video::VideoPixelFormat fmt, bool contiguousFramestore=false) |
Render (fragment-shader) encoder producing fmt's exact on-wire bytes. | |
| std::unique_ptr< ComputeEncoder > | makeWireComputeEncoder (Video::VideoPixelFormat fmt) |
| bool | wireComputeSupports (Video::VideoPixelFormat fmt, int width) |
| ossia::geometry_spec | filterFlattenedScene (const ossia::geometry_spec &in, int mode, int match, const std::string &match_str) |
| Per-pass filter on a flattened scene: geometry_spec → geometry_spec. | |
| std::vector< uint32_t > | triangleFanToList (std::span< const uint32_t > order) |
| bool | lowerTriangleFan (ossia::geometry &g) |
| template<typename Graph_T , typename IO > | |
| void | print_graph (Graph_T &g, IO &stream) |
| std::string | hwCodecName (const char *codec_name, AVHWDeviceType device) |
| Delegates to Video::hwCodecName (score-plugin-gfx wrapper) | |
| bool | codecSupportsHWPixelFormat (AVCodecID codec_id, AVPixelFormat pix_fmt) |
| Delegates to Video::codecSupportsHWPixelFormat (score-plugin-gfx wrapper) | |
| AVPixelFormat | selectHardwareAcceleration (score::gfx::GraphicsApi api, AVCodecID codec_id, QRhi *rhi=nullptr) |
| Picks the best HW accel for the given API/codec, using QRhi for vendor detection. | |
| std::unique_ptr< TextureShareBackend > | createTextureShareBackend (QRhi *producer, QRhi *consumer) |
| int64_t | glslTypeSizeBytes (std::string_view type) noexcept |
| Byte size of a single GLSL primitive type as used for SSBO element strides in this codebase. | |
| int64_t | std430ArrayStride (std::string_view type) noexcept |
std430 array stride for a GLSL primitive type when laid out as T array[] inside a shader storage block. | |
| int64_t | std430LayoutSize (const std::vector< isf::storage_input::layout_field > &layout) noexcept |
Compute the std430 element size of a layout (vector of {name,type} field entries), each field rounded up to 16 bytes per the array-of-struct alignment rule. Used by AUXILIARY blocks and by the user-defined struct lookup in glslTypeSizeBytes. | |
| int64_t | glslTypeSizeBytes (std::string_view type, const isf::descriptor &d) noexcept |
Same as glslTypeSizeBytes, but resolves user-defined types from the descriptor's TYPES section. Falls back to the built-in size table for primitives, then to descriptor.types lookup for struct names. The std430 size of a struct is the sum of its fields' sizes, each rounded up to a 16-byte boundary (matching the array-of-struct alignment rule already used by std430LayoutSize for AUXILIARY blocks). Returns 16 (the lenient default) for unresolved names. | |
| int64_t | std430ArrayStride (std::string_view type, const isf::descriptor &d) noexcept |
Same as std430ArrayStride, but resolves user-defined struct names against the descriptor's TYPES section. Falls back to glslTypeSizeBytes(type, d) for non-vec3 primitives and structs. | |
| QRhiShaderResourceBinding::StageFlags | visibilityToStages (std::string_view visibility) noexcept |
| Decode an isf::storage_input::visibility string to Qt RHI stage flags. | |
| int | graphicsStorageImageBindingCount (const isf::descriptor &desc) noexcept |
Number of bindings the graphics-visible csf_image_input's of desc take, _prev slots included. | |
| std::vector< int > | storageImageInputSamplers (const isf::descriptor &desc, const std::vector< Port * > &ports, int firstInlet=0) |
Indices, in the list initInputSamplers() returns for ports, of the samplers it creates for the input ports of read_only csf_image_input's. | |
| void | collectGraphicsStorageResources (const isf::descriptor &desc, int firstBinding, GraphicsStorageResources &out, int firstInlet=0, int firstImageBinding=-1) |
Walk desc.inputs once and populate out with the storage buffers and images declared by the shader. | |
| void | ensureStorageResources (QRhi &rhi, QRhiResourceUpdateBatch &res, const RenderList &renderer, const isf::descriptor &desc, GraphicsStorageResources &store, QSize renderSize, const std::function< QSize(const GraphicsStorageImage &, QSize)> &imageSize={}) |
| Create missing buffers and textures. | |
| QVarLengthArray< QRhiShaderResourceBinding, 8 > | buildExtraBindings (const GraphicsStorageResources &store) |
| Produce the QRhiShaderResourceBinding list for the graphics pipeline. | |
| bool | resizeCountedStorage (QRhi &rhi, QRhiResourceUpdateBatch &res, const std::vector< Port * > &inputPorts, const isf::descriptor &desc, GraphicsStorageResources &store) |
| Resize the owned flexible-array SSBOs whose size control changed. | |
| void | bindUpstreamBuffers (RenderList &renderer, const std::vector< Port * > &inputPorts, GraphicsStorageResources &store, QRhiShaderResourceBindings *srb=nullptr) |
| Wire read-only SSBOs to upstream geometry buffers. | |
| void | bindUpstreamImagesFromGeometry (GraphicsStorageResources &store, const ossia::geometry &geometry, QRhiShaderResourceBindings *srb=nullptr) |
| Wire read-only csf_image_input storage images to an upstream geometry's published auxiliary_textures. | |
| void | bindUpstreamBuffersFromGeometry (QRhi &rhi, QRhiResourceUpdateBatch &res, GraphicsStorageResources &store, const ossia::geometry &geometry, QRhiShaderResourceBindings *srb=nullptr) |
| Wire INPUTS storage_input / uniform_input bindings to upstream geometry's published auxiliary_buffers list (name-match). | |
| void | swapPersistentSSBOsState (GraphicsStorageResources &store) |
Swap current/prev pointers in store without touching any SRB. | |
| void | reapplyStorageBindings (const GraphicsStorageResources &store, QRhiShaderResourceBindings &srb) |
| Re-apply the current persistent-storage state to a single SRB. | |
| void | swapPersistentSSBOs (GraphicsStorageResources &store, QRhiShaderResourceBindings &srb) |
| Swap current/prev for all persistent SSBOs and storage images, then update the SRB. | |
| std::atomic< uint64_t > & | sizeExpressionCompilations () noexcept |
| Data model for Interactive Shader Format filters. | |
| bool | is_texture_dimension (double v) noexcept |
| template<typename F > | |
| void | walk_descriptor_inputs (const isf::descriptor &desc, port_counts start, F &&fn) |
| template<typename F > | |
| void | walk_descriptor_inputs (const isf::descriptor &desc, F &&fn) |
| int | storage_array_size_port (const isf::descriptor &desc, std::string_view name) |
| template<typename S > | |
| std::vector< S > | samplersInInputOrder (const isf::descriptor &desc, std::span< const S > image, std::span< const S > audio) |
| std::vector< ossia::geometry > | bakeGeometryTransform (const std::vector< ossia::geometry > &meshes, const ossia::transform3d &transform) |
| Concatenates up to N upstream geometry_specs into one. | |
| void | noteZeroCountSlotsSkipped (int skipped) noexcept |
| uint64_t | zeroCountSlotsSkippedTotal () noexcept |
| void | drawMeshWithOptionalIndirect (const Mesh &mesh, const MeshBuffers &bufs, QRhiCommandBuffer &cb) noexcept |
| Draw a mesh, using indirect multi-draw when available in MeshBuffers. | |
| bool | bufferSizeIsExpressible (int64_t byte_size) noexcept |
| bool | drawCommandPaints (const ossia::geometry::draw_command &cmd) noexcept |
| Q_DECLARE_OPERATORS_FOR_FLAGS (Mesh::Flags) | |
| void | generateMipsIfAny (QRhiResourceUpdateBatch &res, QRhiTexture *tex) |
| RenderTargetSpecs | toRenderTargetSpecs (const ossia::render_target_spec &in) noexcept |
| bool | isUnsetSamplerField (auto v) noexcept |
| void | resolveSamplerFields (RenderTargetSpecs &spec, const isf::sampler_config &cfg) noexcept |
| void | drawMeshWithPlan (const Mesh &mesh, const MeshBuffers &bufs, QRhiCommandBuffer &cb, const FallbackBindingPlan &plan) noexcept |
| void | defaultPassesInit (PassMap &passes, const std::vector< Edge * > &edges, RenderList &renderer, const Mesh &mesh, const QShader &v, const QShader &f, QRhiBuffer *processUBO, QRhiBuffer *matUBO, std::span< const Sampler > samplers, std::span< QRhiShaderResourceBinding > additionalBindings) |
| void | defaultPassesInit (PassMap &passes, const std::vector< Edge * > &edges, RenderList &renderer, const Mesh &mesh, const QShader &v, const QShader &f, QRhiBuffer *processUBO, QRhiBuffer *matUBO, std::span< const Sampler > samplers, const QRhiGraphicsPipeline::TargetBlend &blend, std::span< QRhiShaderResourceBinding > additionalBindings) |
| void | defaultRenderPass (RenderList &renderer, const Mesh &mesh, const MeshBuffers &bufs, QRhiCommandBuffer &cb, Edge &edge, PassMap &passes) |
| void | quadRenderPass (RenderList &renderer, const MeshBuffers &bufs, QRhiCommandBuffer &cb, Edge &edge, PassMap &passes) |
| TextureRenderTarget | createOutputRenderTarget (RenderState &state, QRhiTexture &texture, OutputDepth depth=OutputDepth::None, int samples=0) |
| The render target an offscreen output's input is drawn into. | |
| void | releaseOutputRenderTarget (RenderState &state, TextureRenderTarget &target, bool deferred=false) noexcept |
| Frees what createOutputRenderTarget allocated, but not the texture. | |
| QRhiGraphicsPipeline::CompareOp | toCompareOp (std::string_view s) noexcept |
| float | depthClearForCompare (QRhiGraphicsPipeline::CompareOp compare) noexcept |
| float | depthClearForState (const isf::pipeline_state &state) noexcept |
| QRhiGraphicsPipeline::CullMode | toCullMode (std::string_view s) noexcept |
| QRhiGraphicsPipeline::FrontFace | toFrontFace (std::string_view s) noexcept |
| QRhiGraphicsPipeline::PolygonMode | toPolygonMode (std::string_view s) noexcept |
| QRhiGraphicsPipeline::PolygonMode | supportedPolygonMode (QRhiGraphicsPipeline::PolygonMode requested, bool nonFillSupported) noexcept |
| bool | triangleFanSupported (const QRhi &rhi) noexcept |
| QRhiGraphicsPipeline::Topology | supportedTopology (const QRhi &rhi, QRhiGraphicsPipeline::Topology requested) noexcept |
| void | setSupportedTopology (QRhiGraphicsPipeline &ps, QRhiGraphicsPipeline::Topology requested) noexcept |
| bool | drawsUnsupportedFan (const QRhiGraphicsPipeline &ps) noexcept |
| QRhiGraphicsPipeline::Topology | toTopology (std::string_view s) noexcept |
| QRhiGraphicsPipeline::BlendFactor | toBlendFactor (std::string_view s) noexcept |
| QRhiGraphicsPipeline::BlendOp | toBlendOp (std::string_view s) noexcept |
| QRhiGraphicsPipeline::StencilOp | toStencilOp (std::string_view s) noexcept |
| QRhiGraphicsPipeline::ColorMask | toColorMask (std::string_view s) noexcept |
| QRhiGraphicsPipeline::TargetBlend | toTargetBlend (const isf::blend_attachment &b) noexcept |
| QRhiGraphicsPipeline::TargetBlend | premultipliedOverBlend () noexcept |
| QRhiGraphicsPipeline::TargetBlend | straightOverBlend () noexcept |
| QRhiGraphicsPipeline::TargetBlend | blendFor (isf::alpha_mode alpha, isf::composite_mode composite) noexcept |
| QRhiGraphicsPipeline::TargetBlend | layerBlendFor (isf::alpha_mode alpha, isf::composite_mode composite) noexcept |
| QVarLengthArray< QRhiGraphicsPipeline::TargetBlend, 4 > | outputBlends (const isf::descriptor &desc, int colorAttachmentCount, bool ownTargets) |
| QRhiGraphicsPipeline::TargetBlend | copyBlendFor (const isf::descriptor &desc, const isf::output_declaration *out) noexcept |
| const isf::output_declaration * | colorOutputDeclaration (const isf::descriptor &desc, const Node &node, const Port &output) |
| bool | formatSupportsBlending (QRhiTexture::Format f) noexcept |
| QRhiGraphicsPipeline::StencilOpState | toStencilOpState (const isf::stencil_op_state &s) noexcept |
| isf::pipeline_state | mergeState (isf::pipeline_state base, const isf::pipeline_state &over) |
| bool | stateAffectsPipeline (const isf::pipeline_state &s) noexcept |
| bool | declaresDepthWrite (const isf::pipeline_state &state) noexcept |
| isf::pipeline_state | depthCopyState (const isf::pipeline_state &source) |
| void | dropStencilWithoutAttachment (QRhiGraphicsPipeline &pip, bool stencilAttachmentAvailable, std::string_view what) noexcept |
| void | applyPipelineState (const QRhi &rhi, QRhiGraphicsPipeline &pip, const isf::pipeline_state &state, int colorAttachmentCount, bool depthAttachmentAvailable, bool wantsDepthByDefault) noexcept |
| std::shared_ptr< RenderState > | importRenderState (QSize sz, QRhi *rhi) |
| bool | previewFirstRowIsPictureBottom (QRhi &rhi) noexcept |
| ReadbackStats & | readbackStats () noexcept |
| decltype(ossia::geometry::attribute::format) | csfAttributeFormat (std::string_view type) noexcept |
| void | describeCsfAttribute (ossia::geometry::attribute &attr, std::string_view type, const isf::descriptor &d) noexcept |
| QString | csfAttributeRefusal (const ossia::geometry::attribute &upstream, std::string_view type, const isf::descriptor &d) |
| constexpr int | persistentTextureIndex (int writerPass, int readerPass, int frameParity) noexcept |
| std::vector< Sampler > | initAudioTextures (RenderList &renderer, std::list< AudioTexture > &textures) |
| bool | advanceFrameIndex (int32_t &frameIndex, int64_t &lastFrame, int64_t frame) noexcept |
| std::atomic< uint64_t > & | iterationAttachmentAllocations () noexcept |
| QRhiTexture::Format | imageTextureFormat (const QRhi &rhi) noexcept |
| Texture format to use for images uploaded from the CPU. | |
| QImage | adaptImageFormat (QImage img, QRhiTexture::Format fmt) |
| Put an image in the byte order imageTextureFormat() asks for. | |
| std::shared_ptr< RenderState > | createRenderState (GraphicsApi graphicsApi, QSize sz, QWindow *window, SharedDeviceMode deviceMode=SharedDeviceMode::Owned) |
| QRhiBuffer::UsageFlags | compatibleBufferUsage (QRhi &rhi, QRhiBuffer::UsageFlags usage) noexcept |
| Drop a StorageBuffer usage the backend cannot actually honour. | |
| bool | indirectDrawBreaksMultiView (GraphicsApi api, int multiViewCount) noexcept |
| Whether a GPU indirect draw silently loses multiview on this backend. | |
| bool | drawIndirectCountUsable (GraphicsApi api, int multiViewCount, bool pipelineBindsTextures) noexcept |
| Whether the GPU-count draw path (drawIndexedIndirectCount) is usable for a pipeline. | |
| bool | shadersBindTextures (std::initializer_list< const QShader * > shaders) noexcept |
| bool | numWorkGroupsThroughUniform (GraphicsApi api) noexcept |
| Whether a compute shader reads gl_NumWorkGroups from the NUMWORKGROUPS_ uniform rather than the built-in. | |
| bool | viewIndexNeedsPassIndexFallback (GraphicsApi api, const QShaderVersion &version, int multiViewCount) noexcept |
| Whether MULTIVIEW must be emulated with one pass per view. | |
| bool | clearBufferMetal (QRhi &, QRhiCommandBuffer &, QRhiBuffer *, quint32, quint32, quint32) |
| void | copyBufferMetal (QRhi &, QRhiCommandBuffer &, QRhiBuffer *, QRhiBuffer *, int, int, int) |
| void | copyBufferRegionsMetal (QRhi &, QRhiCommandBuffer &, QRhiBuffer *, QRhiBuffer *, const BufferCopyRegion *, int) |
| void | insertComputeBarrier (QRhi &rhi, QRhiCommandBuffer &cb) |
| Insert a compute-to-compute memory barrier. | |
| bool | dispatchComputeLayeredImages (QRhi &rhi, QRhiCommandBuffer &cb, QRhiShaderResourceBindings &srb, int x, int y, int z) |
| Dispatch a compute pass, working around Qt's non-layered bind of layered (3D / cube / array) storage images on the OpenGL backend. | |
| void | beginBufferCopyBarrier (QRhi &rhi, QRhiCommandBuffer &cb) |
| void | endBufferCopyBarrier (QRhi &rhi, QRhiCommandBuffer &cb) |
| void | copyBuffer (QRhi &rhi, QRhiCommandBuffer &cb, QRhiBuffer *src, QRhiBuffer *dst, int size, int srcOffset, int dstOffset, BufferCopyBarrier barrier) |
| void | copyBufferRegions (QRhi &rhi, QRhiCommandBuffer &cb, QRhiBuffer *src, QRhiBuffer *dst, const BufferCopyRegion *regions, int count, BufferCopyBarrier barrier) |
| template<typename R = QRhi> | |
| bool | rhiSupportsDrawIndirectCount (R &rhi) noexcept |
| template<typename R = QRhi> | |
| bool | rhiSupportsDispatchIndirect (R &rhi) noexcept |
| QRhi::DispatchIndirect reported by the device; same convention as above. | |
| template<typename CB = QRhiCommandBuffer> | |
| bool | drawIndirectCountCompat (CB &cb, bool indexed, QRhiBuffer *indirectBuffer, quint32 indirectOffset, QRhiBuffer *countBuffer, quint32 countOffset, quint32 maxDrawCount, quint32 stride) noexcept |
| QRhiGraphicsPipeline::Flags | indirectDrawPipelineFlags (const QRhi &rhi) noexcept |
| QRhiRenderBuffer::Flags | depthStencilRenderBufferFlags (const QRhi &rhi) noexcept |
| template<typename CB = QRhiCommandBuffer> | |
| bool | dispatchIndirectCompat (CB &cb, QRhiBuffer *argsBuffer, quint32 argsOffset) noexcept |
| ReadbackPath | readbackPath (QRhi &rhi) noexcept |
| bool | canReadbackToHostMemory (QRhi &rhi) noexcept |
| std::size_t | readbackHostMemoryAlignment (QRhi &rhi) noexcept |
| bool | readbackTextureSupported (QRhi &rhi, QRhiTexture &src, std::size_t dstBytes) noexcept |
| ReadbackTarget * | createReadbackTarget (QRhi &rhi, void *dst, std::size_t bytes) |
| void | destroyReadbackTarget (ReadbackTarget *t) |
| std::size_t | readbackDstOffsetAlignment (QRhi &rhi, QRhiTexture &src) noexcept |
| bool | readbackTextureToHost (QRhi &rhi, QRhiCommandBuffer &cb, QRhiTexture &src, ReadbackTarget &t, std::size_t dstOffset) |
| bool | finishReadbackToHost (QRhi &rhi, ReadbackTarget &t) |
| bool | uploadReversesRows (const QRhi &rhi) noexcept |
| void | copyRowsReversed (void *dst, const void *src, qsizetype rowBytes, int rows) noexcept |
| dst = src with its rows in reverse order: one memcpy per row. | |
| QByteArray | bytesInPublishedRowOrder (const QRhi &rhi, QByteArray bytes, int rows) |
| QImage | imageInPublishedRowOrder (const QRhi &rhi, QImage img) |
img in the published row order: flipped where uploads reverse rows. | |
| ossia::scene_spec | filterScene (const ossia::scene_spec &in, int mode, std::string_view pattern) |
| The Scene Filter's rewrite of a scene, for a mode and a name pattern. | |
| std::shared_ptr< ossia::geometry > | primitiveToGeometry (const ossia::mesh_primitive &prim) |
| MaterialGPU | packMaterial (const ossia::material_component &mc) |
| MaterialExtensionsGPU | packMaterialExtensions (const ossia::material_component &mc) |
| void | flattenScene (const ossia::scene_spec &scene, FlatScene &out, float aspectRatio, const GpuResourceRegistry *registry) |
| constexpr uint32_t | tex_ref_none () |
| constexpr uint32_t | tex_ref_static (uint32_t bucket, uint32_t layer) |
| constexpr uint32_t | tex_ref_dynamic (uint32_t slot) |
| bool | copiesGpuIndices (QRhi::Implementation backend, ossia::index_format format) noexcept |
| Whether the Scene Preprocessor can copy a GPU index buffer of this index size into its uint32 index stream on this backend. | |
| bool | widensGpuIndices (QRhi::Implementation backend, ossia::index_format format) noexcept |
| Whether GPU indices of this size are widened to uint32 by a compute pass instead of copied: uint16 ones where copiesGpuIndices refuses. | |
| void | forceGpuIndexWidening (bool force) noexcept |
| Widen uint16 GPU indices with the compute pass on every backend, so that the Metal path can be tested elsewhere. | |
| QByteArray | renameHlslReservedIdentifiers (const QByteArray &src) |
| QByteArray | renameMslReservedIdentifiers (const QByteArray &src) |
| QByteArray | renameGlslReservedIdentifiers (const QByteArray &src) |
| QByteArray | renameReservedIdentifiers (const QByteArray &src, GraphicsApi api) |
| Rename the identifiers of a GLSL source that the target language of a bake reserves, and that SPIRV-Cross leaves alone. | |
| QString | shownTextureGlsl (TextureKind kind, int binding, const char *name) |
| std::optional< DecodedImage > | decodeImageFromPath (const QString &path) |
| std::optional< DecodedImage > | decodeImageFromMemory (const QByteArray &bytes, const QString &mime_hint) |
| bool | bleedTransparentColor (QImage &image) |
| QRhiTexture * | uploadImageToTexture (QRhi &rhi, QRhiResourceUpdateBatch &batch, const QImage &img, bool srgb, const QString &debug_name) |
| QRhiTexture * | loadAndUploadTexture (QRhi &rhi, QRhiResourceUpdateBatch &batch, const QString &path, bool srgb) |
| QRhiTexture * | loadAndUploadTexture (QRhi &rhi, QRhiResourceUpdateBatch &batch, const QByteArray &bytes, const QString &mime_hint, bool srgb) |
| TextureRenderTarget | createRenderTarget (const RenderState &state, QRhiTexture *tex, int samples, bool depth, bool samplableDepth=false) |
| Create a render target from a texture. | |
| bool | zeroTexture (QRhi &rhi, QRhiResourceUpdateBatch &res, QRhiTexture &tex) |
| Queue zeros into every level, layer, face and slice of a texture. | |
| TextureRenderTarget | createRenderTarget (const RenderState &state, QRhiTexture::Format fmt, QSize sz, int samples, bool depth, bool samplableDepth=false, QRhiTexture::Flags flags={}) |
| Create a render target from a texture format and size. | |
| TextureRenderTarget | createRenderTarget (const RenderState &state, std::span< QRhiTexture *const > colorTextures, QRhiTexture *depthTexture, int samples) |
| Create a render target with multiple color attachments and optional sampleable depth. | |
| void | replaceBuffer (std::vector< QRhiShaderResourceBinding > &tmp, int binding, QRhiBuffer *newBuffer) |
| BufferRange | bindableRange (const QRhiBuffer *buf, int64_t offset, int64_t size, const char *who, bool uniform) noexcept |
| QString | blockRefusal (const QRhiBuffer *buf, bool uniform, int64_t offset, int64_t range, int64_t declared) |
| void | replaceBuffer (std::vector< QRhiShaderResourceBinding > &tmp, int binding, QRhiBuffer *newBuffer, BufferRange range) |
| void | replaceBuffer (QRhiShaderResourceBindings &, int binding, QRhiBuffer *newBuffer, BufferRange range) |
| replaceBuffer, also setting the bound range. | |
| void | replaceSampler (std::vector< QRhiShaderResourceBinding > &tmp, int binding, QRhiSampler *newSampler) |
| void | replaceTexture (std::vector< QRhiShaderResourceBinding > &tmp, int binding, QRhiTexture *newTexture) |
| void | replaceTextureElement (std::vector< QRhiShaderResourceBinding > &, int binding, int element, QRhiTexture *newTexture) |
| Replace one element of a multi-element texture binding. | |
| void | replaceTextureElement (QRhiShaderResourceBindings &srb, int binding, int element, QRhiTexture *newTexture) |
| void | replaceBuffer (QRhiShaderResourceBindings &srb, int binding, QRhiBuffer *newBuffer) |
| void | replaceSampler (QRhiShaderResourceBindings &srb, int binding, QRhiSampler *newSampler) |
| void | replaceTexture (QRhiShaderResourceBindings &srb, int binding, QRhiTexture *newTexture) |
| void | replaceSampler (QRhiShaderResourceBindings &, QRhiSampler *oldSampler, QRhiSampler *newSampler) |
| Replace a sampler. | |
| void | replaceSamplerAndTexture (QRhiShaderResourceBindings &, QRhiSampler *oldSampler, QRhiSampler *newSampler, QRhiTexture *newTexture) |
| Replace both sampler and texture in a SRC. | |
| void | replaceTexture (QRhiShaderResourceBindings &, QRhiSampler *sampler, QRhiTexture *newTexture) |
| Replace the texture currently bound to a sampler. | |
| void | replaceTexture (QRhiShaderResourceBindings &srb, QRhiTexture *old_tex, QRhiTexture *new_tex) |
| Replace a texture by another in a set of bindings. | |
| const ossia::geometry::attribute * | findGeometryAttribute (const ossia::geometry &geom, std::string_view name, std::string_view semantic_key) |
| Match a (name, semantic) request to an upstream geometry attribute. | |
| bool | remapPipelineVertexInputs (QRhiGraphicsPipeline &pip, const QShader &vertexShader, const ossia::geometry &geom, FallbackBindingPlan *outPlan=nullptr, QRhi *rhi=nullptr) |
| Remap a pipeline's vertex input layout using semantic matching. | |
| bool | remapPipelineVertexInputs (QRhiGraphicsPipeline &pip, const QShader &vertexShader, const ossia::geometry &geom, const isf::descriptor &desc, QRhi &rhi, VertexFallbackPool &pool, QRhiResourceUpdateBatch &batch, FallbackBindingPlan &outPlan) |
| Fallback-aware overload: the strict-matching behaviour of the overload above, extended so VERTEX_INPUTS entries with "REQUIRED": false silently resolve to a shared identity buffer from the pool when their semantic is absent upstream. | |
| void | dropTrailingOrphanVertexBindings (QRhiVertexInputLayout &layout) noexcept |
| void | warnOrphanVertexBindings (const QRhiVertexInputLayout &layout, const char *where) noexcept |
| QRhiShaderResourceBindings * | createDefaultBindings (const RenderList &renderer, const TextureRenderTarget &rt, QRhiBuffer *processUBO, QRhiBuffer *materialUBO, std::span< const Sampler > samplers, std::span< QRhiShaderResourceBinding > additionalBindings={}, int firstSamplerBinding=3, int sampleCount=0) |
| Create bindings following the score conventions for shaders and materials. | |
| Pipeline | buildPipeline (const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiShaderResourceBindings *srb) |
| Lower-level buildPipeline variant: bring your own SRB. | |
| Pipeline | buildPipeline (const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiShaderResourceBindings *srb, const QRhiGraphicsPipeline::TargetBlend &blend) |
| Pipeline | buildPipeline (const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiBuffer *processUBO, QRhiBuffer *materialUBO, std::span< const Sampler > samplers, std::span< QRhiShaderResourceBinding > additionalBindings={}) |
| Create a render pipeline following the score conventions for shaders and materials. | |
| Pipeline | buildPipeline (const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiBuffer *processUBO, QRhiBuffer *materialUBO, std::span< const Sampler > samplers, const QRhiGraphicsPipeline::TargetBlend &blend, std::span< QRhiShaderResourceBinding > additionalBindings={}) |
| buildPipeline with an explicit blend on every colour attachment. | |
| Pipeline | buildPipelineWithState (const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiBuffer *processUBO, QRhiBuffer *materialUBO, std::span< const Sampler > samplers, std::span< QRhiShaderResourceBinding > extraBindings, const isf::pipeline_state &state, int multiViewCount=0, bool useShadingRate=false, int firstSamplerBinding=3, std::span< const QRhiGraphicsPipeline::TargetBlend > seedBlends={}) |
| Create a render pipeline applying pipeline_state from an ISF descriptor. | |
| std::pair< QShader, QShader > | makeShaders (const RenderState &v, QString vert, QString frag, int multiViewCount=0) |
| Get a pair of compiled vertex / fragment shaders from GLSL 4.5 sources. | |
| QShader | makeCompute (const RenderState &v, QString compt) |
| Compile a compute shader. | |
| QSize | resizeTextureSize (QSize img, int min, int max) noexcept |
| Resize the size of a texture to fit within GPU limits. | |
| QImage | resizeTexture (const QImage &img, int min, int max) noexcept |
| Resize a texture to fit within GPU limits. | |
| QSizeF | computeScaleForMeshSizing (score::gfx::ScaleMode mode, QSizeF viewport, QSizeF texture) |
| Compute the scale to apply to a texture so that it fits in a GL viewport. | |
| QSizeF | computeScaleForTexcoordSizing (score::gfx::ScaleMode mode, QSizeF viewport, QSizeF texture) |
| Compute the scale to apply to a texture rendered to a quad the size of viewport. | |
| std::vector< Sampler > | initInputSamplers (const score::gfx::Node &node, RenderList &renderer, const std::vector< Port * > &ports, const isf::descriptor *desc) |
| void | updateInputSamplerFilter (std::span< Sampler > samplers, const score::gfx::Node &node, const Port &input, const RenderTargetSpecs &spec) |
Give the sampler initInputSamplers() created for input, one of node's input ports, the filter and address modes of spec. | |
| TextureRenderTarget | createDepthOnlyRenderTarget (const RenderState &state, QSize sz, int samples, bool samplableDepth=true, QRhiTexture::Format depthFmt=QRhiTexture::D32F) |
| Create a depth-only render target. | |
| TextureRenderTarget | createLayeredRenderTarget (const RenderState &state, QRhiTexture *colorTextureArray, int renderLayer, QRhiTexture *depthTexture, int samples) |
| Create a render target that targets a single layer of a texture array. | |
| TextureRenderTarget | createMultiViewRenderTarget (const RenderState &state, QRhiTexture *colorTextureArray, int multiViewCount, QRhiTexture *depthTextureArray, int samples) |
| Create a multiview render target (single RT drawing N views at once). | |
| TextureRenderTarget | createDepthOnlyRenderTarget (const RenderState &state, QRhiTexture *externalDepthTexture, int samples, bool samplableDepth=true) |
| Create a depth-only render target around an EXTERNAL depth texture. | |
| TextureRenderTarget | createLayeredRenderTarget (const RenderState &state, std::span< QRhiTexture *const > colorTextures, int renderLayer, QRhiTexture *depthTexture, int samples) |
| Multi-attachment (MRT) layered render target. | |
| TextureRenderTarget | createMultiViewRenderTarget (const RenderState &state, std::span< QRhiTexture *const > colorTextures, int multiViewCount, QRhiTexture *depthTextureArray, int samples) |
| Multi-attachment (MRT) multiview render target. | |
| QRhiTexture::Format | parseOutputFormat (const std::string &fmt, QRhiTexture::Format fallback) noexcept |
| Map an ISF/CSF FORMAT string to a QRhiTexture::Format. | |
| bool | applySetSamplerFields (QRhiSampler &sampler, const RenderTargetSpecs &spec) noexcept |
| const isf::sampler_config * | inputSamplerConfig (const isf::input &inp) noexcept |
| bool | declaresSampler (const isf::sampler_config &cfg) noexcept |
| bool | declaresCompare (const isf::sampler_config &cfg) noexcept |
| QRhiSampler * | makeSampler (QRhi &rhi, const isf::sampler_config &cfg) |
| Build a QRhiSampler from an isf::sampler_config. | |
| bool | retargetSampler (Sampler &s, QRhiTexture *tex) |
| bool | followTextureMips (QRhiSampler &sampler, const QRhiTexture &texture) |
| int | storageImageUnitLimit (QRhi &rhi) |
| Number of storage image units the backend binds by binding number: GL_MAX_IMAGE_UNITS on OpenGL (8 when it cannot be queried), unlimited elsewhere. | |
| int64_t | storageBufferSizeLimit (QRhi &rhi) |
| Largest storage buffer the device binds, in bytes: Vulkan maxStorageBufferRange, GL MAX_SHADER_STORAGE_BLOCK_SIZE. Elsewhere the QRhi limit (QRhi::newBuffer takes a quint32 size): a buffer the device refuses below it fails in create(). | |
| int64_t | bufferOffsetAlignment (QRhi &rhi, bool uniform) |
| The byte multiple a buffer binding's offset must be on this device: QRhi::ubufAlignment() for a uniform buffer; for a storage buffer Vulkan minStorageBufferOffsetAlignment, GL SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, else 256 (the largest either allows). Queried once per QRhi. | |
| int | maxStorageImageBinding (QStringView glsl) |
Highest binding of a storage image declared in glsl, -1 if none. | |
| bool | warnStorageImageUnits (QRhi &rhi, const char *kind, std::initializer_list< const QString * > sources) |
Warn once per shader when a storage image in sources has a binding the OpenGL backend cannot bind (at or above storageImageUnitLimit()). | |
| QRhiTexture::Format | imageFormatFromQualifier (std::string_view qualifier) noexcept |
| QRhi format for a GLSL image format qualifier ("rgba8", "r32ui", ...); RGBA8 when unknown. | |
| QRhiTexture * | createStorageImagePlaceholder (QRhi &rhi, QRhiResourceUpdateBatch &res, std::string_view qualifier, int dimensions, bool array, bool cube, QSize size={1, 1}, int extent=1) |
A zero-filled texture a storage image binding declared with qualifier can take when nothing is bound: same format, the shape of the declaration, usable with image load/store. Owned by the caller. | |
| bool | outputGrabbedBySink (const Port &output) noexcept |
| QRhiBuffer::Type | bufferTypeFor (QRhiBuffer::UsageFlags usage, QRhiBuffer::Type nonDynamic=QRhiBuffer::Immutable) noexcept |
| The QRhi buffer type a usage flag is allowed to be created with. | |
| void | copyMatrix (const QMatrix4x4 &mat, float *ptr) noexcept |
| void | copyMatrix (const QMatrix3x3 &mat, float *ptr) noexcept |
| void | updateDynamicBufferWithStoredData (QRhiResourceUpdateBatch *ub, QRhiBuffer *buf, int offset, int64_t bytesize, const char *data) |
| Schedule a Dynamic buffer update when we can guarantee the buffer outlives the frame. | |
| void | updateDynamicBufferWithStoredData (QRhiResourceUpdateBatch *ub, QRhiBuffer *buf, int offset, QByteArray b) |
| void | uploadStaticBufferWithStoredData (QRhiResourceUpdateBatch *ub, QRhiBuffer *buf, int offset, int64_t bytesize, const char *data) |
| Schedule a Static buffer update when we can guarantee the buffer outlives the frame. | |
| void | uploadStaticBufferWithStoredData (QRhiResourceUpdateBatch *ub, QRhiBuffer *buf, int offset, QByteArray b) |
| QRhi * | resourceRhi (const QRhiResource &r) noexcept |
| std::optional< VertexFallbackSpec > | resolveVertexFallback (ossia::attribute_semantic semantic, std::string_view decl_type, const std::vector< double > &user_default) noexcept |
| uint64_t | hashVertexFallback (const VertexFallbackSpec &spec) noexcept |
| bool | videoDecoderNeedsRebuild (bool hasDecoder, const Video::ImageFormat &built, const Video::ImageFormat &src, AVPixelFormat fmt, int w, int h) noexcept |
| Whether the GPU decoder has to be rebuilt for this frame. | |
| ossia::aabb | geometryPositionBounds (const ossia::geometry &g) noexcept |
Variables | |
| constexpr int | unsetSamplerField = 3 |
| constexpr bool | rhiHasDrawIndirectCount = detail::rhi_has_indirect_count<QRhiCommandBuffer>::value |
| constexpr bool | rhiHasDispatchIndirect = detail::rhi_has_dispatch_indirect<QRhiCommandBuffer>::value |
| constexpr bool | rhiHasIndirectCommandBufferFlags |
| constexpr int | texture_kind_count = 4 |
Enumeration Type Documentation
◆ BufferCopyBarrier
|
strong |
Copy the contents of one GPU buffer to another.
Performs a GPU-side buffer-to-buffer copy of size bytes from src + srcOffset to dst + dstOffset. Both buffers must already be created and large enough to satisfy the requested region. Must be called between beginExternal() and endExternal(), outside any render or compute pass (Metal opens its own MTLBlitCommandEncoder, and only one encoder may be open on a command buffer).
The source and destination buffers must NOT overlap (the copy is unordered when src == dst).
Per-backend behaviour:
- Vulkan : vkCmdCopyBuffer
- OpenGL : glCopyBufferSubData
- D3D12 : CopyBufferRegion
- D3D11 : CopySubresourceRegion (offsets supported via D3D11_BOX)
- Metal : MTLBlitCommandEncoder copyFromBuffer
◆ OutputDepth
|
strong |
◆ ReadbackPath
|
strong |
How the backend reaches caller-owned memory. Vulkan and D3D12 import the pages and the GPU writes them directly; OpenGL and D3D11 have no import and must land in a driver buffer that is then memcpy'd, with the fence wait falling on the render thread.
This is a performance property, not a capability one, and it decides the default: against plain QRhi staging, Import is cheaper per frame, while HostCopy is a small regression.
| Enumerator | |
|---|---|
| HostCopy | driver buffer + memcpy + fence on the render thread |
| Import | caller pages imported; GPU writes them directly |
◆ SharedDeviceMode
|
strong |
Who owns the imported Vulkan device behind a RenderState.
Owned is the default: one vkCreateDevice per RenderState, one vkDestroyDevice when it goes away. Cached takes a reference on the process-wide SharedVulkanDeviceCache instead, so a create/destroy pair is not paid every time the state is rebuilt. Only the shader previews opt in — they are rebuilt on every selection, whereas outputs and encoders are long-lived.
◆ TextureKind
|
strong |
What a texture holds: one image, or several of the same size. A texture port does not say it; the texture a producer hands out does, through its flags.
◆ TextureLayout
|
strong |
How the views show a texture that holds several images: one of them, or as many as fit side by side.
Function Documentation
◆ adaptImageFormat()
| SCORE_PLUGIN_GFX_EXPORT QImage score::gfx::adaptImageFormat | ( | QImage | img, |
| QRhiTexture::Format | fmt | ||
| ) |
Put an image in the byte order imageTextureFormat() asks for.
QRhi uploads a QImage's bits as-is, so the two have to agree. Premultiplication is preserved: only the channel order changes.
◆ adjustCaptureReference()
|
inlinenoexcept |
The corrections, on the CPU, in the same order the shader applies them.
This is the specification: CaptureAdjustGLSL.hpp implements it on the GPU, and a test can only check the two agree if one of them is checkable. Keep them in step – a divergence shows up as the picture changing when the capture rung changes, which looks like a capture bug.
◆ advanceFrameIndex()
|
inlinenoexcept |
Advances a shader's FRAMEINDEX once per RenderList frame, however many output edges update the node in it; a fresh node starts at 0. Returns whether this is the node's first update of frame.
◆ applySetSamplerFields()
|
noexcept |
Sets on sampler the fields spec says its inlet set (filter, mipmap mode, address modes); true when that changed it, which then needs create() again.
◆ bakeGeometryTransform()
| SCORE_PLUGIN_GFX_EXPORT std::vector< ossia::geometry > score::gfx::bakeGeometryTransform | ( | const std::vector< ossia::geometry > & | meshes, |
| const ossia::transform3d & | transform | ||
| ) |
Concatenates up to N upstream geometry_specs into one.
Intended use: combine independently-flattened scene partitions (static environment + animated characters + CSF-produced particles) into a single geometry_spec that a single downstream renderer can draw in one pass. Inputs without a transform share their buffers; only the top-level mesh_list is rebuilt. An input with a transform gets baked copies: on the CPU for CPU-resident attributes, and through a compute pass into buffers owned by the renderer for GPU-resident ones.
For v1, up to 8 input geometry ports are exposed. Unconnected ports contribute nothing.
Inputs:
- Port 0..7: Geometry (Types::Geometry)
Outputs:
- Port 0: Geometry (Types::Geometry)
Copies of the meshes with a model transform applied to their CPU position, normal, tangent and bitangent attributes and to their bounds.
GPU-resident buffers are left as they are.
◆ beginBufferCopyBarrier()
| void score::gfx::beginBufferCopyBarrier | ( | QRhi & | rhi, |
| QRhiCommandBuffer & | cb | ||
| ) |
Emit the {compute,transfer}→transfer barrier that must precede a buffer copy. The compute half orders the copy after a compute shader that just produced the data; the transfer half orders it after the staging copies QRhi emits for a QRhiResourceUpdateBatch submitted earlier in the same command buffer. That second half is not optional: these helpers record through beginExternal(), so QRhi's own per-buffer barrier tracking never sees them and cannot order them against its own uploads. Pair with endBufferCopyBarrier(). No-op on backends that handle the transition implicitly (D3D11, Metal).
◆ bindUpstreamBuffers()
| void score::gfx::bindUpstreamBuffers | ( | RenderList & | renderer, |
| const std::vector< Port * > & | inputPorts, | ||
| GraphicsStorageResources & | store, | ||
| QRhiShaderResourceBindings * | srb = nullptr |
||
| ) |
Wire read-only SSBOs to upstream geometry buffers.
When a storage_input is declared as read_only AND the upstream node supplies a buffer on the port, the binding is rewired to point at the upstream's QRhiBuffer (no allocation needed). Called each frame to track port changes.
◆ bindUpstreamBuffersFromGeometry()
| void score::gfx::bindUpstreamBuffersFromGeometry | ( | QRhi & | rhi, |
| QRhiResourceUpdateBatch & | res, | ||
| GraphicsStorageResources & | store, | ||
| const ossia::geometry & | geometry, | ||
| QRhiShaderResourceBindings * | srb = nullptr |
||
| ) |
Wire INPUTS storage_input / uniform_input bindings to upstream geometry's published auxiliary_buffers list (name-match).
SSBO/UBO sibling of bindUpstreamImagesFromGeometry. ScenePreprocessor publishes scene_lights / world_transforms / per_draws / scene_materials / scene_counts / scene_light_indices / camera UBO / env UBO as named aux buffers travelling along the geometry edge — flattened-scene shaders (classic_pbr et al.) declare matching INPUTS storage_input/uniform_input blocks and the runtime resolves them by name.
Without this, INPUTS storage_input/uniform_input that go through the m_storage path stay at the 16-byte placeholder allocated by ensureStorageResources for owned SSBOs — vertices read a zero PerDraw, multiply by a zero world_transforms matrix, and collapse to origin. (Indirect-draw storage_inputs are skipped — they have no shader binding.)
For CPU-backed aux buffers a fresh QRhiBuffer is allocated and the data uploaded immediately into res; the entry's owned flag is updated so release() cleans up correctly. For GPU-backed aux buffers we just adopt the upstream handle (owned=false).
Patches the SRB in-place when a target SRB is provided; idempotent so multi-SRB callers can invoke once per SRB without re-running the lookup.
< Of the published range in handle (U42).
◆ bindUpstreamImagesFromGeometry()
| void score::gfx::bindUpstreamImagesFromGeometry | ( | GraphicsStorageResources & | store, |
| const ossia::geometry & | geometry, | ||
| QRhiShaderResourceBindings * | srb = nullptr |
||
| ) |
Wire read-only csf_image_input storage images to an upstream geometry's published auxiliary_textures.
Symmetric to bindUpstreamBuffers for SSBOs: when a csf_image_input is declared read_only AND the upstream geometry publishes a storage image with the same name (e.g. an upstream CSF wrote to it via image_input with write_only/read_write), this swaps the storage image's texture pointer to the upstream's published handle and frees the auto-allocated placeholder we created in ensureStorageResources.
Without this, every read_only csf_image_input INPUTS in a downstream RawRaster / ISF stage reads from its OWN zero-initialised texture instead of the upstream's actual contents — silently broken.
Called per-frame; idempotent. When srb is non-null, patches the binding in-place via replaceTexture. The lookup is purely by name match against geometry.auxiliary_textures (the same name-match pattern used by RawRaster's m_auxTextureSamplers rebind path).
◆ blockRefusal()
| QString score::gfx::blockRefusal | ( | const QRhiBuffer * | buf, |
| bool | uniform, | ||
| int64_t | offset, | ||
| int64_t | range, | ||
| int64_t | declared | ||
| ) |
Why buf cannot back a shader block, or an empty string when it can (shader board U42, plan step 3). A uniform block needs UniformBuffer usage and a published range of at least the block's declared size; a storage block needs StorageBuffer usage. range is the published byte size, 0 for the whole buffer from offset; declared 0 skips the extent check. An offset the device cannot bind a buffer at is refused too.
◆ bufferTypeFor()
|
inlinenoexcept |
The QRhi buffer type a usage flag is allowed to be created with.
A uniform buffer must be Dynamic on D3D11: QD3D11Buffer::create() rejects anything else outright ("UniformBuffer must always be combined with Dynamic
on D3D11"), leaves its ID3D11Buffer null and returns false. OpenGL ES says the same thing through the NonDynamicUniformBuffers feature. Every UBO this plugin allocates from a literal is already Dynamic; this exists for the few places that pick the usage at RUNTIME from a shader's declaration, where an unconditional Immutable would silently give a null-backed buffer on D3D11 and bind it anyway. Everything else keeps nonDynamic, which for a storage or vertex buffer is what it wants (and Dynamic + StorageBuffer is itself rejected).
◆ buildExtraBindings()
| QVarLengthArray< QRhiShaderResourceBinding, 8 > score::gfx::buildExtraBindings | ( | const GraphicsStorageResources & | store | ) |
Produce the QRhiShaderResourceBinding list for the graphics pipeline.
Call this from inside addOutputPass() after buildPipeline() has been set up. The result is concatenated with the standard bindings (sampler, material, processUBO, etc.) via the additionalBindings span in createDefaultBindings.
◆ buildPipeline() [1/2]
| Pipeline score::gfx::buildPipeline | ( | const RenderList & | renderer, |
| const Mesh & | mesh, | ||
| const QShader & | vertexS, | ||
| const QShader & | fragmentS, | ||
| const TextureRenderTarget & | rt, | ||
| QRhiBuffer * | processUBO, | ||
| QRhiBuffer * | materialUBO, | ||
| std::span< const Sampler > | samplers, | ||
| const QRhiGraphicsPipeline::TargetBlend & | blend, | ||
| std::span< QRhiShaderResourceBinding > | additionalBindings = {} |
||
| ) |
buildPipeline with an explicit blend on every colour attachment.
The variants above composite a straight-alpha output "over" the target (straightOverBlend()); copies of textures that already hold premultiplied colour pass premultipliedOverBlend().
◆ buildPipeline() [2/2]
| Pipeline score::gfx::buildPipeline | ( | const RenderList & | renderer, |
| const Mesh & | mesh, | ||
| const QShader & | vertexS, | ||
| const QShader & | fragmentS, | ||
| const TextureRenderTarget & | rt, | ||
| QRhiShaderResourceBindings * | srb | ||
| ) |
Lower-level buildPipeline variant: bring your own SRB.
The returned Pipeline::srb equals the srb you passed — no ownership transfer. Useful when the caller wants to share a pipeline across multiple Passes that each have their own SRB (layout-compatible with this one per QRhi contract); the pipeline's stored SRB is only used for layout extraction at create() time and never dereferenced at draw time.
◆ buildPipelineWithState()
| Pipeline score::gfx::buildPipelineWithState | ( | const RenderList & | renderer, |
| const Mesh & | mesh, | ||
| const QShader & | vertexS, | ||
| const QShader & | fragmentS, | ||
| const TextureRenderTarget & | rt, | ||
| QRhiBuffer * | processUBO, | ||
| QRhiBuffer * | materialUBO, | ||
| std::span< const Sampler > | samplers, | ||
| std::span< QRhiShaderResourceBinding > | extraBindings, | ||
| const isf::pipeline_state & | state, | ||
| int | multiViewCount = 0, |
||
| bool | useShadingRate = false, |
||
| int | firstSamplerBinding = 3, |
||
| std::span< const QRhiGraphicsPipeline::TargetBlend > | seedBlends = {} |
||
| ) |
Create a render pipeline applying pipeline_state from an ISF descriptor.
Depth test / depth write and the anyNodeRequiresDepth() fallback are all driven by state here. When state is empty (all fields nullopt), behaviour matches the variant above exactly.
seedBlends is the blend of each colour attachment unless state declares BLEND (the last entry repeats); empty means straightOverBlend().
extraBindings is typically the result of IsfBindingsBuilder::buildExtraBindings(). multiViewCount >= 2 activates multiview rendering (requires state.caps.multiview).
When useShadingRate == true AND renderer.state.caps.variableRateShading == true, the pipeline gets QRhiGraphicsPipeline::UsesShadingRate. The shading-rate texture / per-draw rate itself is supplied elsewhere (via the render-target attachment's setShadingRateMap or the command- buffer's setShadingRate). Presets opt in; silent no-op when the backend doesn't support VRS.
◆ bytesInPublishedRowOrder()
|
inline |
A tightly packed, top-row-first image of rows rows in the published row order. Returns bytes untouched where uploads keep their rows.
◆ canReadbackToHostMemory()
|
noexcept |
Whether this backend can read a texture straight into caller-owned host memory. Stable per QRhi; query once.
◆ collectGraphicsStorageResources()
| void score::gfx::collectGraphicsStorageResources | ( | const isf::descriptor & | desc, |
| int | firstBinding, | ||
| GraphicsStorageResources & | out, | ||
| int | firstInlet = 0, |
||
| int | firstImageBinding = -1 |
||
| ) |
Walk desc.inputs once and populate out with the storage buffers and images declared by the shader.
Bindings are assigned sequentially starting from firstBinding. Persistent SSBOs consume TWO consecutive bindings. With firstImageBinding >= 0 the storage images are numbered from there instead, as isf.cpp does for ISF and raw raster shaders. firstInlet is the node's input port index of the first desc.inputs port: 1 for a raw raster, whose port 0 is its geometry input.
No GPU resources are allocated here — call ensureStorageResources() later.
◆ compatibleBufferUsage()
|
inlinenoexcept |
Drop a StorageBuffer usage the backend cannot actually honour.
QGles2Buffer::create() picks the target it will run every glBufferData / glBufferSubData through from the usage flags, and StorageBuffer outranks both VertexBuffer and IndirectBuffer (qrhigles2.cpp):
targetForDataOps = GL_ARRAY_BUFFER; if (usage & IndexBuffer) targetForDataOps = GL_ELEMENT_ARRAY_BUFFER; else if (usage & StorageBuffer) targetForDataOps = GL_SHADER_STORAGE_BUFFER; else if (usage & IndirectBuffer) targetForDataOps = GL_DRAW_INDIRECT_BUFFER;
GL_SHADER_STORAGE_BUFFER arrived with GL 4.3 / GLES 3.1. macOS caps desktop OpenGL at 4.1, so on Apple's driver the bind and every upload against that target raise GL_INVALID_ENUM and do nothing: glGenBuffers still hands out a name, create() still returns true, and the object never receives a data store or a single byte of content. Nothing in score can see that, because the only thing it can check – create() – succeeded.
The damage lands at draw time and looks like two unrelated bugs:
- bound as a VERTEX buffer, Apple's GL walks the storeless object and faults inside gleRunVertexSubmitImmediate, EXC_BAD_ACCESS at the attribute's own byte offset (0x0, 0x40, ...);
- bound as an INDIRECT buffer, the draw reads zeros and rasterises nothing, silently and with an empty error string. Mesa and the NVIDIA driver expose 4.6, so the same code is correct on Linux/OpenGL, which is what makes this look platform-specific rather than backend-specific.
A buffer a shader genuinely reads as an SSBO cannot be rescued here: below 4.3 there are no SSBOs to read. So a StorageBuffer-ONLY usage is returned untouched and fails honestly. This only demotes buffers whose storage role is an ADDITIONAL one alongside a vertex / index / indirect role the backend can still serve – the mesh arena, the geometry VBOs, the MDI command buffer.
◆ copiesGpuIndices()
|
noexcept |
Whether the Scene Preprocessor can copy a GPU index buffer of this index size into its uint32 index stream on this backend.
uint16 indices are copied two bytes at a time into the low half of each slot, which Metal on macOS refuses: it only blits 4-byte-aligned ranges.
◆ createDefaultBindings()
| QRhiShaderResourceBindings * score::gfx::createDefaultBindings | ( | const RenderList & | renderer, |
| const TextureRenderTarget & | rt, | ||
| QRhiBuffer * | processUBO, | ||
| QRhiBuffer * | materialUBO, | ||
| std::span< const Sampler > | samplers, | ||
| std::span< QRhiShaderResourceBinding > | additionalBindings = {}, |
||
| int | firstSamplerBinding = 3, |
||
| int | sampleCount = 0 |
||
| ) |
Create bindings following the score conventions for shaders and materials.
Binding 0 is the output UBO for sampleCount, or when it is 0 for the sample count of rt: pass it when the pipeline renders into another target than rt.
◆ createDepthOnlyRenderTarget() [1/2]
| TextureRenderTarget score::gfx::createDepthOnlyRenderTarget | ( | const RenderState & | state, |
| QRhiTexture * | externalDepthTexture, | ||
| int | samples, | ||
| bool | samplableDepth = true |
||
| ) |
Create a depth-only render target around an EXTERNAL depth texture.
Builds the RT around externalDepthTexture (caller-allocated, already created) instead of allocating its own. Use this when the depth texture is named/owned by the node (so textureForOutput() can return it).
externalDepthTexture may be a plain 2D depth texture or a TextureArray (layered / shadow-cascade depth). It becomes ret.depthTexture and is released with the RT.
◆ createDepthOnlyRenderTarget() [2/2]
| TextureRenderTarget score::gfx::createDepthOnlyRenderTarget | ( | const RenderState & | state, |
| QSize | sz, | ||
| int | samples, | ||
| bool | samplableDepth = true, |
||
| QRhiTexture::Format | depthFmt = QRhiTexture::D32F |
||
| ) |
Create a depth-only render target.
Allocates a sampleable depth texture (samplableDepth=true) or a depth renderbuffer. If the backend rejects color-less render targets, a 1x1 RGBA8 dummy color texture is allocated and stored in the TextureRenderTarget::dummyColorTexture field (owned by the RT).
The resulting TextureRenderTarget has:
depthTextureordepthRenderBufferset (never both)texture== nullptr (depth-only semantics)dummyColorTexturemay be non-null on some backends
◆ createGPUVideoDecoder()
| SCORE_PLUGIN_GFX_EXPORT std::unique_ptr< GPUVideoDecoder > score::gfx::createGPUVideoDecoder | ( | Video::ImageFormat & | format, |
| const std::string & | filter = {} |
||
| ) |
Creates the appropriate GPUVideoDecoder for a given pixel format.
This factory centralizes the pixel-format-to-decoder switch statement that was previously duplicated in VideoNodeRenderer and DirectVideoNodeRenderer.
- Parameters
-
format The video frame format (width, height, pixel_format) filter Optional GLSL filter expression to apply in the fragment shader
- Returns
- A unique_ptr to the created decoder, or nullptr if format is unhandled
◆ createLayeredRenderTarget() [1/2]
| TextureRenderTarget score::gfx::createLayeredRenderTarget | ( | const RenderState & | state, |
| QRhiTexture * | colorTextureArray, | ||
| int | renderLayer, | ||
| QRhiTexture * | depthTexture, | ||
| int | samples | ||
| ) |
Create a render target that targets a single layer of a texture array.
colorTextureArray must have been created with QRhiTexture::TextureArray and at least (renderLayer + 1) layers.
depthTexture may be a regular 2D texture (shared across layers) or nullptr to skip depth (use a renderbuffer instead via createRenderTarget overloads).
◆ createLayeredRenderTarget() [2/2]
| TextureRenderTarget score::gfx::createLayeredRenderTarget | ( | const RenderState & | state, |
| std::span< QRhiTexture *const > | colorTextures, | ||
| int | renderLayer, | ||
| QRhiTexture * | depthTexture, | ||
| int | samples | ||
| ) |
Multi-attachment (MRT) layered render target.
Same as the single-texture overload but attaches ALL colorTextures to the render pass (locations 0..N-1), so the number of attachments matches the pipeline blend-state count (rt.colorAttachmentCount()). Each layered color texture renders to renderLayer; plain 2D textures keep layer 0.
◆ createMultiViewRenderTarget() [1/2]
| TextureRenderTarget score::gfx::createMultiViewRenderTarget | ( | const RenderState & | state, |
| QRhiTexture * | colorTextureArray, | ||
| int | multiViewCount, | ||
| QRhiTexture * | depthTextureArray, | ||
| int | samples | ||
| ) |
Create a multiview render target (single RT drawing N views at once).
colorTextureArray must be a TextureArray with at least multiViewCount layers. depthTextureArray may be nullptr for no depth, or a TextureArray with the same layer count.
Requires state.caps.multiview == true — caller must check.
◆ createMultiViewRenderTarget() [2/2]
| TextureRenderTarget score::gfx::createMultiViewRenderTarget | ( | const RenderState & | state, |
| std::span< QRhiTexture *const > | colorTextures, | ||
| int | multiViewCount, | ||
| QRhiTexture * | depthTextureArray, | ||
| int | samples | ||
| ) |
Multi-attachment (MRT) multiview render target.
Same as the single-texture overload but attaches ALL colorTextures (each a TextureArray with >= multiViewCount layers) with per-attachment multiview, so attachments == pipeline blend targets. Requires state.caps.multiview == true.
◆ createOutputRenderTarget()
| TextureRenderTarget score::gfx::createOutputRenderTarget | ( | RenderState & | state, |
| QRhiTexture & | texture, | ||
| OutputDepth | depth = OutputDepth::None, |
||
| int | samples = 0 |
||
| ) |
The render target an offscreen output's input is drawn into.
texture is the output's picture: single-sample, and what its encoders, readbacks, previews and texture sharing read. When samples is above one the passes draw into a multisample colour buffer instead, which QRhi resolves into texture at the end of every pass, so the output gets the anti-aliasing a window's multisampled swap chain gets. A backend or format that cannot multisample falls back to drawing into texture directly, with a warning: the passes drawing into the target take their sample count from TextureRenderTarget::sampleCount(), so they follow either way.
samples < 1 means RenderState::samples, the count the render list renders at. An output whose renderer draws into this target with a pass of its own at one sample (a scaling blit, say) passes 1.
Sets state.renderPassDescriptor to the target's descriptor. Returns an empty target when the backend refuses even the single-sample one. The caller keeps owning texture; releaseOutputRenderTarget frees the rest.
◆ createReadbackTarget()
| ReadbackTarget * score::gfx::createReadbackTarget | ( | QRhi & | rhi, |
| void * | dst, | ||
| std::size_t | bytes | ||
| ) |
Registers dst (alignment-aligned, bytes rounded up to the alignment and owned by the caller) once. Returns nullptr when the backend or the specific allocation cannot be wrapped — fall back to QRhi::readBackTexture. Never call per frame.
◆ createRenderTarget() [1/2]
| TextureRenderTarget score::gfx::createRenderTarget | ( | const RenderState & | state, |
| QRhiTexture::Format | fmt, | ||
| QSize | sz, | ||
| int | samples, | ||
| bool | depth, | ||
| bool | samplableDepth = false, |
||
| QRhiTexture::Flags | flags = {} |
||
| ) |
Create a render target from a texture format and size.
This function will also create a texture.
◆ createRenderTarget() [2/2]
| TextureRenderTarget score::gfx::createRenderTarget | ( | const RenderState & | state, |
| std::span< QRhiTexture *const > | colorTextures, | ||
| QRhiTexture * | depthTexture, | ||
| int | samples | ||
| ) |
Create a render target with multiple color attachments and optional sampleable depth.
- Parameters
-
colorTextures All color attachment textures (must be non-empty, first becomes primary) depthTexture Sampleable depth texture, or nullptr for no depth / renderbuffer depth
◆ createStorageImagePlaceholder()
| QRhiTexture * score::gfx::createStorageImagePlaceholder | ( | QRhi & | rhi, |
| QRhiResourceUpdateBatch & | res, | ||
| std::string_view | qualifier, | ||
| int | dimensions, | ||
| bool | array, | ||
| bool | cube, | ||
| QSize | size = {1, 1}, |
||
| int | extent = 1 |
||
| ) |
A zero-filled texture a storage image binding declared with qualifier can take when nothing is bound: same format, the shape of the declaration, usable with image load/store. Owned by the caller.
1x1 unless size says otherwise; extent is the depth of a 3D image or the layer count of an array (shader board R46: a writable image nothing produces is the node's own, at its declared size).
◆ csfAttributeFormat()
|
noexcept |
The vertex format a CSF publishes for a geometry attribute of GLSL type type: signed for int / ivecN (it was the unsigned format, shader board C42), float4 for a type with no attribute format (bool, matrices, structs).
◆ csfAttributeRefusal()
| SCORE_PLUGIN_GFX_EXPORT QString score::gfx::csfAttributeRefusal | ( | const ossia::geometry::attribute & | upstream, |
| std::string_view | type, | ||
| const isf::descriptor & | d | ||
| ) |
Why a CSF attribute declared type cannot read upstream, or an empty string when it can. A user_struct element is read only by the same type at the same element size; a scalar or vector attribute is read by any scalar or vector type (the scatter converts it, C40), never by a bool, a matrix or a struct. There is no implicit conversion between the two.
◆ declaresCompare()
|
noexcept |
Whether a declared sampler asks for a depth comparison. Such a sampler is the shader's own intent, not a property of the texture, so it is kept even when the texture's publisher offers a sampler of its own.
◆ declaresSampler()
|
noexcept |
Whether the shader's JSON sets any sampler field of an input (WRAP, FILTER, MIPMAP_MODE, COMPARE...): that sampler then wins over the inlet's (shader board U34).
◆ depthStencilRenderBufferFlags()
|
inlinenoexcept |
NoTransientBacking on Metal when this Qt has the indirect command buffer flags: a depth-stencil renderbuffer score creates keeps its contents across the pass restart an indirect command buffer draw causes. It costs the memory a memoryless (transient) one would not take.
◆ describeCsfAttribute()
|
noexcept |
Describes a CSF geometry attribute of GLSL type type in attr. A scalar or vector gets its vertex format. A type with none (bool, matrices, TYPES structs) is published as user_struct with its type name and std430 element size, instead of as a float4 nothing can read (C42).
◆ dispatchComputeLayeredImages()
| bool score::gfx::dispatchComputeLayeredImages | ( | QRhi & | rhi, |
| QRhiCommandBuffer & | cb, | ||
| QRhiShaderResourceBindings & | srb, | ||
| int | x, | ||
| int | y, | ||
| int | z | ||
| ) |
Dispatch a compute pass, working around Qt's non-layered bind of layered (3D / cube / array) storage images on the OpenGL backend.
Qt's QRhi OpenGL backend (before the fix that shipped in 6.10) binds a 3D, cube-map OR 2D-texture-array storage image with glBindImageTexture(..., layered=GL_FALSE, layer=0). That exposes only slice/face/layer 0 to the shader, so an imageStore into an image3D, imageCube or image2DArray writes ONLY that single slice and every other slice/face/layer stays uninitialised — the classic "layered compute output
reads back black on GL, fine on Vulkan" symptom. (Fixed upstream in Qt 6.10: qrhigles2.cpp binds layered = CubeMap || ThreeDimensional || TextureArray; there this call is a harmless identical re-bind.)
When srb contains at least one layered storage-image binding (3D, cube or array) AND the backend is OpenGL, this issues the dispatch itself: it flushes QRhi's own (mis-)binding via beginExternal(), re-binds each layered storage image LAYERED (all slices/faces/layers writable), dispatches, emits a full memory barrier, and returns true. The predicate is kept EXACTLY in sync with qrhigles2's own layered determination.
Returns false when the caller should issue the ordinary QRhi dispatch (non-OpenGL backend, or no layered storage image in the SRB) — every other backend and the 2D image path are left completely untouched.
Must be called inside an active compute pass, after setComputePipeline() and setShaderResources().
◆ dispatchIndirectCompat()
|
inlinenoexcept |
dispatchIndirect when the API exists; returns false when it does not, so the caller can fall back to a CPU worst-case dispatch.
◆ drawIndirectCountCompat()
|
inlinenoexcept |
drawIndirectCount / drawIndexedIndirectCount when the API exists; returns false (recorded nothing) when it does not, so the caller can fall back to the plain multi-draw / CPU rungs.
◆ drawIndirectCountUsable()
|
inlinenoexcept |
Whether the GPU-count draw path (drawIndexedIndirectCount) is usable for a pipeline.
Ask this WITH caps.drawIndirectCount at every site that selects the count rung; QRhi's feature flag alone is not enough:
- Metal implements the count draw exclusively through Indirect Command Buffers, which demand things the flag cannot express (qrhimetal.mm icbUnavailableReason; the draw is SKIPPED with a warning otherwise): the graphics pipeline created with QRhiGraphicsPipeline::UsesIndirectDraws (indirectDrawPipelineFlags()), a depth-stencil renderbuffer created with NoTransientBacking since the pass is interrupted and restarted (depthStencilRenderBufferFlags()), and a pipeline whose shaders bind no texture, sampled or storage, which Metal refuses in such a pipeline. The first two need the 6.13-era flags (rhiHasIndirectCommandBufferFlags); the last one is
pipelineBindsTextures, see shadersBindTextures(). A declined pipeline takes the multi-draw rung over commands clamped to the count on the GPU (IndirectCountClamp). - The multiview-on-Metal indirect break applies to the count entry points exactly as it does to drawIndexedIndirect (they share the encoder path), so the existing predicate is folded in.
◆ drawMeshWithOptionalIndirect()
|
noexcept |
Draw a mesh, using indirect multi-draw when available in MeshBuffers.
When bufs.useIndirectDraw is true (and Qt >= 6.12), dispatches to cb.drawIndexedIndirect / cb.drawIndirect with the offset/count/stride stored in bufs. Otherwise falls back to the mesh's standard draw().
This is the main draw entry point for ISF / RawRaster / Scene renderers so that they can transparently support multi-draw indirect just by wiring an indirect buffer into MeshBuffers.
◆ drawMeshWithPlan()
|
noexcept |
Draws a mesh with the vertex bindings a pipeline built for it kept (see Pipeline::plan).
◆ dropTrailingOrphanVertexBindings()
|
noexcept |
Metal rejects a vertex buffer layout that no attribute reads; Vulkan and OpenGL accept it silently.
◆ endBufferCopyBarrier()
| void score::gfx::endBufferCopyBarrier | ( | QRhi & | rhi, |
| QRhiCommandBuffer & | cb | ||
| ) |
Emit the transfer→{indirect, vertex input, vertex, fragment, compute, transfer} barrier after a batch of buffer copies so every downstream consumer of the copied range observes the writes.
◆ ensureStorageResources()
| void score::gfx::ensureStorageResources | ( | QRhi & | rhi, |
| QRhiResourceUpdateBatch & | res, | ||
| const RenderList & | renderer, | ||
| const isf::descriptor & | desc, | ||
| GraphicsStorageResources & | store, | ||
| QSize | renderSize, | ||
| const std::function< QSize(const GraphicsStorageImage &, QSize)> & | imageSize = {} |
||
| ) |
Create missing buffers and textures.
Safe to call every frame — idempotent. Resizes buffers when they don't match the current layout. For persistent SSBOs, allocates both the current and prev buffers. For indirect-draw buffers, adds the IndirectBuffer usage flag.
- Parameters
-
imageSize Resolves a storage image's WIDTH / HEIGHT expressions against the node's inputs, from the render size; without it they are ignored.
◆ filterFlattenedScene()
| SCORE_PLUGIN_GFX_EXPORT ossia::geometry_spec score::gfx::filterFlattenedScene | ( | const ossia::geometry_spec & | in, |
| int | mode, | ||
| int | match, | ||
| const std::string & | match_str | ||
| ) |
Per-pass filter on a flattened scene: geometry_spec → geometry_spec.
Reads the filter_tag and filter_material_index metadata fields that ScenePreprocessorNode writes onto every output geometry, and emits a new geometry_spec containing only the draws that match the configured predicate. All underlying GPU buffers are shared via shared_ptr — the filter only rewrites the mesh_list; no GPU data is copied.
Inputs:
- Port 0: Geometry (Types::Geometry)
- Port 1: Filter mode (Types::Int): 0 = tag equals match value 1 = tag differs from match value 2 = material index equals match value 3 = material index differs from match value 4 = blend_mode equals match (0 = opaque, 1 = premul-alpha) 5 = blend_mode differs from match 6 = depth_write equals (match != 0) 7 = depth_write differs from (match != 0) 8 = cull_mode equals match (0 = none, 1 = front, 2 = back) 9 = cull_mode differs from match 10 = topology equals match (0 = triangles, 1 = tri strip, …) 11 = topology differs from match 12 = format_id equals match_str (rapidhash of match_str truncated to 32 bits compared with filter_tag; an empty match_str short-circuits to 0u so it matches the "untagged" sentinel rather than the rapidhash of the empty string) 13 = format_id differs from match_str
- Port 2: Match value (Types::Int) — user-supplied, interpreted per mode
- Port 3: Match string (Types::Empty control) — used by modes 12/13
The tag and material modes (0-3, 12, 13) select DRAWS in a merged batch: ScenePreprocessor merges every regular draw into one geometry and gives it a CPU "draw_filter_keys" auxiliary, a (tag_hash, material_index) pair per draw command, material_index being the per_draws slot. The matching commands are kept and drawn from the CPU command list (shader board P05). The other modes, and meshes without the keys, keep or drop whole meshes.
Outputs:
- Port 0: Geometry (Types::Geometry) The node's rewrite of a flattened scene (see FlattenedSceneFilterNode).
◆ filterScene()
| SCORE_PLUGIN_GFX_EXPORT ossia::scene_spec score::gfx::filterScene | ( | const ossia::scene_spec & | in, |
| int | mode, | ||
| std::string_view | pattern | ||
| ) |
The Scene Filter's rewrite of a scene, for a mode and a name pattern.
Mode 2 keeps the subtrees whose node name matches pattern: libossia's OSC pattern syntax (*, ?, [0-9], {a,b}), matched against the whole name. A matching node is kept whole. A node kept only because something below it matches keeps its transforms and its kept sub-nodes, so the match stays where it was, and drops its own components. An empty pattern keeps everything. Modes 0 and 1 ignore the pattern.
◆ findGeometryAttribute()
| const ossia::geometry::attribute * score::gfx::findGeometryAttribute | ( | const ossia::geometry & | geom, |
| std::string_view | name, | ||
| std::string_view | semantic_key | ||
| ) |
Match a (name, semantic) request to an upstream geometry attribute.
Three-stage cascade shared by all shader modes:
- semantic_key → name_to_semantic → if known, geom.find(semantic).
- Custom-attribute lookup by
name. - display_name == name fallback (so { NAME: "position", SEMANTIC: "custom" } still finds the real position attribute when no custom one shadows it). If
semantic_keyis empty,nameis used as the semantic key.
◆ finishReadbackToHost()
| bool score::gfx::finishReadbackToHost | ( | QRhi & | rhi, |
| ReadbackTarget & | dst | ||
| ) |
Makes the last recorded readback's bytes visible in dst. On the GL paths this waits on a fence (and memcpys from the PBO when not pinned); on D3D11 it maps the staging texture and copies it into dst; on Vulkan/D3D12 it is a no-op — the caller's frame synchronization suffices. Must be called after every recorded readback, on every backend.
◆ followTextureMips()
| bool score::gfx::followTextureMips | ( | QRhiSampler & | sampler, |
| const QRhiTexture & | texture | ||
| ) |
Mipmap mode for a declaration that leaves MIPMAP_MODE out: the texture's mip chain is read when it has one, so textureLod on a prefiltered cube reaches its rougher levels. Single-level textures keep None, since GL treats a mip-filtered sampler on one as incomplete. Re-creates sampler in place when its mode differs; returns true then.
◆ generateMipsIfAny()
|
inline |
Queue the mip chain of tex, unless its base level is 1x1: such a texture has a single level, and Metal's generateMipmapsForTexture: rejects it with a validation abort. Qt's D3D12 backend skips that case itself; its Metal one does not.
◆ geometryPositionBounds()
|
inlinenoexcept |
The bounds of the positions of a geometry held in memory; empty when they are not
◆ glslTypeSizeBytes()
|
noexcept |
Byte size of a single GLSL primitive type as used for SSBO element strides in this codebase.
Coverage: scalars (float, int, uint, bool), vectors (vec[234], ivec[234], uvec[234]), and matrices (mat2, mat3, mat4). Sampler / image / opaque types are not covered (return the fallback). Returns 16 as a fallback for unknown / unsupported types.
Conventions:
- Returns 12 for
vec3/ivec3/uvec3(the bare component size). Consumers that need std140 / std430 array stride must align to 16 themselves; for that case preferstd430ArrayStridebelow, which encapsulates the rule and keeps the two domains (bare type size vs. stride-in-SSBO) from drifting at call sites. ISF auxiliary layouts continue to align at the field level viastd430LayoutSize. mat2is reported as 16 (twovec2columns, no per-column padding).mat3is reported as 48 (threevec4-padded columns); this matches both std140 and std430 column-major layout format3in storage blocks.mat4is reported as 64.
This is the single source of truth for GLSL type → element size in score-plugin-gfx; do not introduce private copies.
The vertex-attribute format → byte-size mapping (ossia::geometry::attribute enum) is a different domain – binary attribute formats, not GLSL type strings – and lives in its own helper inside RenderedCSFNode.cpp.
◆ imageTextureFormat()
|
noexcept |
Texture format to use for images uploaded from the CPU.
BGRA8 where the backend has it, RGBA8 otherwise. QRhiGles2 asks for GL_BGRA whenever a texture is BGRA8, and WebGL has no such format at all, so uploading one there is an INVALID_ENUM and the image never appears.
◆ indirectDrawBreaksMultiView()
|
inlinenoexcept |
Whether a GPU indirect draw silently loses multiview on this backend.
Qt's Metal backend derives gl_ViewIndex by multiplying the instance count and binding a view-mask buffer, and it does BOTH only in adjustForMultiViewDraw() – which qrhimetal.mm calls from draw() (:2499) and drawIndexed() (:2539) and from NEITHER drawIndirect() nor drawIndexedIndirect(). An indirect draw of a multiview shader therefore renders every amplified view into layer 0, with no qWarning: the warning inside adjustForMultiViewDraw cannot fire because the function is never entered. Metal's validation layer names it outright:
Vertex Function(main0): missing Buffer binding at index 24 for spvViewMask[0].
The CPU fallback in CustomMesh::drawSingleMesh issues one drawIndexed per command, which DOES go through adjustForMultiViewDraw, so declining GPU indirect restores correct multiview at the cost of N draw calls.
Scoped to Metal deliberately: Vulkan and D3D12 implement multiview in the render pass / view instancing, so the indirect entry points inherit it.
◆ indirectDrawPipelineFlags()
|
inlinenoexcept |
UsesIndirectDraws on Metal when this Qt has the indirect command buffer flags, no flag otherwise. Harmless on a pipeline that ends up not using them: Qt then keeps its plain indirect draws.
◆ inputSamplerConfig()
|
noexcept |
The sampler fields a sampled image input declares (image, cubemap, or a compute shader's texture), or null for any other input.
◆ insertComputeBarrier()
| void score::gfx::insertComputeBarrier | ( | QRhi & | rhi, |
| QRhiCommandBuffer & | cb | ||
| ) |
Insert a compute-to-compute memory barrier.
Ensures that SSBO writes from a preceding compute dispatch are visible to the next compute dispatch. Must be called between QRhiCommandBuffer::beginExternal() and endExternal(), inside a compute pass.
Per-backend behaviour:
- Vulkan : vkCmdPipelineBarrier (COMPUTE → COMPUTE, SHADER_WRITE → SHADER_READ|WRITE)
- OpenGL : glMemoryBarrier(GL_SHADER_STORAGE_BARRIER_BIT | GL_BUFFER_UPDATE_BARRIER_BIT)
- D3D12 : UAV barrier on all resources
- D3D11 : no-op (implicit within device context)
- Metal : no-op (implicit between command encoders; each QRhi compute pass uses a separate MTLComputeCommandEncoder)
◆ is_texture_dimension()
|
inlinenoexcept |
A width or height expression can give NaN (sqrt(-1), an interrupted loop) or a value below one pixel or past int: the default size is kept then.
◆ iterationAttachmentAllocations()
|
noexcept |
Multisample colour buffers and scratch depth textures the raw raster iteration modes (PER_MIP / PER_LAYER / PER_CUBE_FACE) have allocated, process-wide. For tests.
◆ makeCompute()
| QShader score::gfx::makeCompute | ( | const RenderState & | v, |
| QString | compt | ||
| ) |
Compile a compute shader.
Note: this function will throw if the shader is invalid.
◆ makeSampler()
| QRhiSampler * score::gfx::makeSampler | ( | QRhi & | rhi, |
| const isf::sampler_config & | cfg | ||
| ) |
Build a QRhiSampler from an isf::sampler_config.
Fields left empty/unset in the config are filled with ossia defaults (linear filtering, no mipmaps, clamp-to-edge). When the config sets a comparison op other than "never", the returned sampler is a shadow comparison sampler.
The returned sampler is created (create() was called) and has no name assigned; callers should setName() before or after create() as needed. Ownership follows the standard QRhi convention — callers delete it.
◆ makeShaders()
| std::pair< QShader, QShader > score::gfx::makeShaders | ( | const RenderState & | v, |
| QString | vert, | ||
| QString | frag, | ||
| int | multiViewCount = 0 |
||
| ) |
Get a pair of compiled vertex / fragment shaders from GLSL 4.5 sources.
Note: this function will throw if a shader is invalid.
◆ makeWireComputeEncoder()
|
inline |
Compute-shader encoder for the GPU-direct path (writes into an imported buffer). Only the formats with a compute variant are supported.
◆ makeWireEncoder()
|
inline |
Render (fragment-shader) encoder producing fmt's exact on-wire bytes.
Returns nullptr when no GPU encoder exists for fmt.
- Parameters
-
contiguousFramestore ask for the variant whose SINGLE readback is the whole framestore, planes adjacent and in order, rather than one readback per plane. A consumer that hands a device one pointer – NDI's p_data, a card's frame buffer – would otherwise have to concatenate the planes itself, which is 8.3 MB of memcpy per frame at 1080p P216. Only some formats have such a variant; the rest ignore the flag and return their usual encoder.
◆ numWorkGroupsThroughUniform()
|
inlinenoexcept |
Whether a compute shader reads gl_NumWorkGroups from the NUMWORKGROUPS_ uniform rather than the built-in.
SPIRV-Cross cannot emit the built-in for HLSL, so on D3D libisf's alias routes it through a uniform the CSF node fills before each dispatch. An INDIRECT dispatch's count is decided on the GPU, so there the uniform can only hold the WORKGROUPS ceiling (shader board C33): every other backend keeps the built-in, which ShaderCache restores. RenderedCSFNode asks the same function to warn when an INDIRECT pass reads it through the uniform. SCORE_GFX_NO_NATIVE_NUM_WORKGROUPS forces the uniform everywhere.
◆ nv12ExternalOesUsable()
|
noexcept |
True when this decoder can be used at all: a GLES backend whose driver advertises the external-image extension. Checked before the backend commits to it, because an external texture the driver will not sample is worse than the CPU path.
◆ outputGrabbedBySink()
|
inlinenoexcept |
Whether an input cabled to output samples the producer's own texture (GrabsFromSource: a STATIC image, a cubemap, a volume) instead of having it drawn into a render target. Producers that only draw into their consumers' targets publish a texture of their own for those.
◆ packedBitfieldFilter()
|
inline |
Builds the PackedDecoder filter that unpacks l.
The word is rebuilt from the sampled bytes, then each field is shifted, masked and normalised by its own maximum, so a 5-bit channel spans the full 0..1 range rather than topping out at 31/255.
◆ parseOutputFormat()
|
noexcept |
Map an ISF/CSF FORMAT string to a QRhiTexture::Format.
Supported: rgba8, bgra8, r8, rg8, r16, rg16, r16f, r32f, rgba16f, rgba32f, d16, d24, d24s8, d32f. Unknown / empty strings fall back to the caller's default. Lookup is case-insensitive.
◆ persistentTextureIndex()
|
constexprnoexcept |
Which texture of a persistent pass's pair the pass at readerPass samples. The writer renders into textures[frameParity]; the main and alternate pass sets have parity 0 and 1 and swap every frame. As in VVISF, where each pass hands its freshly rendered buffer to the passes drawn after it, a reader after the writer sees this frame and the writer itself and the passes before it see the previous frame.
◆ previewFirstRowIsPictureBottom()
|
noexcept |
True when the host texture's first row is the picture's bottom, i.e. OpenGL's framebuffer order. Quick3D's Texture.sourceItem samples the texture raw, so this cannot be corrected downstream; createRenderer and the host item's mirrorVertically both derive from it.
◆ readbackDstOffsetAlignment()
|
noexcept |
Required alignment of the dstOffset passed to readbackTextureToHost for a texture of this format (0 = backend unsupported). D3D12: 512 (D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT); Vulkan: the texel size and 4; OpenGL: 4; D3D11: 1.
◆ readbackHostMemoryAlignment()
|
noexcept |
Required alignment of dst and granularity of bytes for createReadbackTarget, or 0 when unsupported. Vulkan: the device's minImportedHostPointerAlignment (4096 on NVIDIA). OpenGL: 4096 (GL_AMD_pinned_memory page requirement; the PBO fallback ignores it). D3D12: 65536 (VirtualAlloc allocation granularity). D3D11: 1 (dst is only ever a memcpy destination).
◆ readbackTextureSupported()
|
noexcept |
Whether readbackTextureToHost can handle this texture on this backend (format/size/pitch constraints), for a target of dstBytes — the same checks the record path performs, without recording anything. Lets a caller decide at init time instead of discovering a permanent per-frame failure.
◆ readbackTextureToHost()
| bool score::gfx::readbackTextureToHost | ( | QRhi & | rhi, |
| QRhiCommandBuffer & | cb, | ||
| QRhiTexture & | src, | ||
| ReadbackTarget & | dst, | ||
| std::size_t | dstOffset = 0 |
||
| ) |
Records the texture→(dst + dstOffset) copy on cb. Must be called outside a render pass. The copy is tightly packed rows, texture storage order (top-left origin in score). dstOffset lets the copy land on an interior pointer of the registered region (device SDKs often hand out offset frame pointers inside their allocations); it must satisfy readbackDstOffsetAlignment and fit in the target. Returns false when the texture's format/size/offset cannot target this backend's path — nothing is recorded, fall back.
◆ reapplyStorageBindings()
| void score::gfx::reapplyStorageBindings | ( | const GraphicsStorageResources & | store, |
| QRhiShaderResourceBindings & | srb | ||
| ) |
Re-apply the current persistent-storage state to a single SRB.
Pairs with swapPersistentSSBOsState: after swapping store once, call this on every SRB that references the persistent bindings so the descriptor set matches the new pointers. Uses replaceBuffer's updateResources() fast path — no srb->create() rebuild — to avoid thrashing the SRB pool slot every frame on a static scene.
◆ releaseOutputRenderTarget()
|
noexcept |
Frees what createOutputRenderTarget allocated, but not the texture.
Clears state.renderPassDescriptor when it is this target's. deferred releases through deleteLater(), for a target replaced while the QRhi keeps rendering.
◆ remapPipelineVertexInputs() [1/2]
| bool score::gfx::remapPipelineVertexInputs | ( | QRhiGraphicsPipeline & | pip, |
| const QShader & | vertexShader, | ||
| const ossia::geometry & | geom, | ||
| const isf::descriptor & | desc, | ||
| QRhi & | rhi, | ||
| VertexFallbackPool & | pool, | ||
| QRhiResourceUpdateBatch & | batch, | ||
| FallbackBindingPlan & | outPlan | ||
| ) |
Fallback-aware overload: the strict-matching behaviour of the overload above, extended so VERTEX_INPUTS entries with "REQUIRED": false silently resolve to a shared identity buffer from the pool when their semantic is absent upstream.
pool per-RenderList shared fallback buffer pool batch any uploads for freshly-allocated fallback buffers are recorded here outPlan filled with the bindings the caller must merge into the draw's QRhiCommandBuffer::VertexInput array. Cleared on entry.
Returns false (and logs which input failed) if:
- a REQUIRED=true input has no matching upstream attribute, OR
- a REQUIRED=false input has no matching upstream attribute AND the declared GLSL TYPE is unsupported (mat4 / integer / sampler) OR the resolved semantic is not in the whitelist AND no explicit DEFAULT was supplied.
◆ remapPipelineVertexInputs() [2/2]
| bool score::gfx::remapPipelineVertexInputs | ( | QRhiGraphicsPipeline & | pip, |
| const QShader & | vertexShader, | ||
| const ossia::geometry & | geom, | ||
| FallbackBindingPlan * | outPlan = nullptr, |
||
| QRhi * | rhi = nullptr |
||
| ) |
Remap a pipeline's vertex input layout using semantic matching.
Reflects the compiled vertex shader to find each in variable, then for each one runs findGeometryAttribute(name, name) — useful when no isf descriptor is around (legacy callers). Returns true on success, false if a required attribute can't be matched.
Strict: with no descriptor every input is required, so a miss fails the build. Same resolver as the fallback-aware overload below, minus the fallback synthesis.
◆ renameReservedIdentifiers()
| SCORE_PLUGIN_GFX_EXPORT QByteArray score::gfx::renameReservedIdentifiers | ( | const QByteArray & | src, |
| GraphicsApi | api | ||
| ) |
Rename the identifiers of a GLSL source that the target language of a bake reserves, and that SPIRV-Cross leaves alone.
SPIRV-Cross renames user identifiers that collide with GLSL builtins and with its own keyword list for the target, but not all of them:
- HLSL: the HLSL-only intrinsics and type names it emits (mix -> lerp, fract -> frac, clamp(x, 0, 1) -> saturate...).
float lerpbecamefloat lerp = lerp(...), which fxc rejects. - MSL: C++ keywords and alternative tokens (
new,or,char,throw) and the namesusing namespace metalmakes ambiguous (plus,array). - GLSL for OpenGL: words NVIDIA's compiler reserves beyond the GLSL spec (
char,register,row_major), which glslang accepts for SPIR-V.
Those names have no meaning in GLSL, so every occurrence is the author's: each one is prefixed with isf_hlsl_ / isf_msl_ / isf_glsl_, consistently across declarations, uses, struct members and macros. Comments and strings are left alone, and the source is returned as is (shared, not copied) when nothing matches. Vulkan and Null get the source unchanged.
◆ replaceTextureElement()
| void score::gfx::replaceTextureElement | ( | std::vector< QRhiShaderResourceBinding > & | , |
| int | binding, | ||
| int | element, | ||
| QRhiTexture * | newTexture | ||
| ) |
Replace one element of a multi-element texture binding.
The other replaceTexture overloads only ever touch texSamplers[0], which is all a combined sampledTexture binding has. A ladder collapsed by isf_group_auxiliary_texture_ladders binds N textures under one slot through QRhiShaderResourceBinding::textures(), so each rung has to be addressed by its element index. Out-of-range elements and null textures are ignored, matching the single-element overload's refusal to write a null.
◆ resizeCountedStorage()
| bool score::gfx::resizeCountedStorage | ( | QRhi & | rhi, |
| QRhiResourceUpdateBatch & | res, | ||
| const std::vector< Port * > & | inputPorts, | ||
| const isf::descriptor & | desc, | ||
| GraphicsStorageResources & | store | ||
| ) |
Resize the owned flexible-array SSBOs whose size control changed.
Reads each one's "<name> size" control from inputPorts and recreates the buffer, zero-filled, at fixed part + count x element stride (shader board U44). The QRhiBuffer objects stay the same, so the SRBs that bind them pick the new native buffers up by themselves. Call every frame, before the passes run. Returns true when a buffer was resized.
◆ resolveSamplerFields()
|
noexcept |
Fills the sampler fields spec leaves unset from the shader's JSON, when it declares a sampler: as makeSampler() reads it, its defaults included.
◆ resourceRhi()
|
inlinenoexcept |
The QRhi a resource was created with. QRhiResource::rhi() arrived in Qt 6.5; below it this is null and callers take their device-independent fallback.
◆ retargetSampler()
| bool score::gfx::retargetSampler | ( | Sampler & | s, |
| QRhiTexture * | tex | ||
| ) |
Points s at tex, re-creating its sampler first when its mipmap mode follows the texture. Returns false when s already samples tex; the caller then has no SRB to patch.
◆ rhiSupportsDrawIndirectCount()
|
inlinenoexcept |
QRhi::DrawIndirectCount reported by the device, false when the API does not exist in this Qt (or SCORE_GFX_SIMULATE_QT612 pretends it does not).
◆ shadersBindTextures()
|
inlinenoexcept |
Whether shaders bind a texture the way Qt's Metal backend counts it for indirect command buffers (qrhimetal.mm usesTextures): a combined image sampler, a separate image or a storage image in any stage.
◆ shownTextureGlsl()
| QString score::gfx::shownTextureGlsl | ( | TextureKind | kind, |
| int | binding, | ||
| const char * | name = "inTex" |
||
| ) |
GLSL that reads a texture of kind as the image ShownTexture describes.
It declares layout(binding = binding) uniform <sampler> name and:
// `uv` and `p` address the shown image in memory, as a render target // or a storage image holds it. `flip`: QRhi::isYUpInNDC(), where a 2D // image is held bottom row first (see RowOrder.hpp): the tiles still // go from the top left of what the image shows. vec4 shownSample(vec2 uv, int layout, int index, bool flip, out bool inside); vec4 shownTexel(ivec2 p, ivec2 size, int layout, int index, bool flip, out bool inside);
shownSample filters, shownTexel reads the nearest texel. inside is false between the tiles. For a 2D texture they are a textureLod() at uv and a texelFetch() at p.
◆ sizeExpressionCompilations()
|
noexcept |
Data model for Interactive Shader Format filters.
See https://isf.video Size expressions (pass and OUTPUTS WIDTH / HEIGHT) ISFNode has compiled, process-wide. For tests: each is compiled once per node, then evaluated.
◆ std430ArrayStride()
|
noexcept |
std430 array stride for a GLSL primitive type when laid out as T array[] inside a shader storage block.
Differs from glslTypeSizeBytes only for vec3-shaped vectors: per the std430 layout rules, an array of vec3 (or ivec3 / uvec3) keeps the element's vec4-aligned base alignment, so the per-element stride is 16 bytes — the trailing 4 bytes are padding the GPU does not write but consumer reads must skip. For scalars, vec2, vec4 and matrices, the stride equals the bare type size, so this returns glslTypeSizeBytes(type) unchanged.
Use this — never glslTypeSizeBytes — when sizing a CSF SoA output SSBO buffer or setting a downstream vertex binding stride that mirrors the SSBO's std430 layout: mixing the two corrupts vec3 data silently.
◆ storageImageInputSamplers()
| std::vector< int > score::gfx::storageImageInputSamplers | ( | const isf::descriptor & | desc, |
| const std::vector< Port * > & | ports, | ||
| int | firstInlet = 0 |
||
| ) |
Indices, in the list initInputSamplers() returns for ports, of the samplers it creates for the input ports of read_only csf_image_input's.
A graphics shader declares those inputs as storage images, not samplers, so the sampler bindings must skip these entries.
◆ swapPersistentSSBOs()
| void score::gfx::swapPersistentSSBOs | ( | GraphicsStorageResources & | store, |
| QRhiShaderResourceBindings & | srb | ||
| ) |
Swap current/prev for all persistent SSBOs and storage images, then update the SRB.
Call at end of frame, after all passes have run. Symmetric to the existing texture ping-pong in RenderedISFNode (the swap(passes, altPasses) at RenderedISFNode.cpp:1094).
◆ swapPersistentSSBOsState()
| void score::gfx::swapPersistentSSBOsState | ( | GraphicsStorageResources & | store | ) |
Swap current/prev pointers in store without touching any SRB.
Used by multi-pass / multi-SRB renderers that need to apply the same post-swap state to many descriptor sets: call this once per frame, then call reapplyStorageBindings on every affected SRB. Calling swapPersistentSSBOs per-SRB would double-swap and cancel out.
◆ toExternalSamplerEssl()
| QByteArray score::gfx::toExternalSamplerEssl | ( | QByteArray | glsl | ) |
Turn the baked GLSL into the external-sampler variant.
Two surgical edits on the baked text rather than a reconstruction: the baked shader already carries exactly the uniform blocks, locations and precision qualifiers that QRhiGles2 will wire from the reflection, and rebuilding that by hand gets it wrong: the blocks end } renderer; rather than };, so slicing to the first }; produces malformed source and a compile error at token "renderer".
Rewrite baked GLSL so its sampler2D tex becomes samplerExternalOES tex, adding the required extension pragma. Shared because every external-image decoder needs exactly this edit: glslang rejects the external type, so the shader is baked with sampler2D and only the GL text is swapped. Returns an empty array when the input does not look like baked GLSL.
◆ toRenderTargetSpecs()
|
noexcept |
The render-target specs of an inlet, sampler fields it leaves unset marked so.
◆ uploadReversesRows()
|
inlinenoexcept |
Row order of the 2D image textures that travel between nodes.
A render target holds its image bottom row first in memory on OpenGL, Metal and Direct3D – the GL framebuffer origin, and the Y negation of isf_vertShaderApplyClipSpace() on the others: QRhi::isYUpInNDC() – and top row first on Vulkan. Every 2D image texture a node publishes has the row order of a rendered one, whoever produced it, so a consumer (IMG_NORM_PIXEL, the output blits, a STATIC binding, a readback, a material slot) never needs to know whether it was drawn or uploaded.
An image coming from the CPU is top row first (QImage, decoded files, halp CPU textures), so a producer publishing it reverses its rows on upload when uploadReversesRows() is true. Data tables (LUTs addressed by a parameter, not by an image position) are not images and keep their memory order: their row 0 is at v = 0 on every backend, for a raw texture() read.
◆ videoDecoderNeedsRebuild()
|
inlinenoexcept |
Whether the GPU decoder has to be rebuilt for this frame.
Free and inline rather than a member: a static member of this class is not exported from the plugin, and this has to be callable from a test. A wrong answer here is not a visible defect – it is a rebuild on every frame, whose only symptom is a frame rate that is quietly worse than it should be.
built is what the current decoder was built for, src what the input reports now, and w / h the incoming AVFrame's own size – which for a fielded source is HALF the picture height that src carries.
◆ videoFieldMode()
|
inlinenoexcept |
Which mode score_tc should run, as a uniform value.
0 progressive, 1 weave, 2 bob. Weave needs the OTHER half of the stacked texture to hold this field's partner; when it does not – a dropped field, or the very first field after a connection – weaving would pair two fields of the same parity and tear. Falling back to bob for that one frame costs half the vertical resolution on that frame and nothing else.
◆ viewIndexNeedsPassIndexFallback()
|
inlinenoexcept |
Whether MULTIVIEW must be emulated with one pass per view.
gl_ViewIndex becomes HLSL SV_ViewID, which requires shader model 6.1. D3D11 is pinned to SM 5.0 for good, and D3D12 drops to 5.0 whenever dxcompiler.dll is absent, so on those targets a multiview shader cannot be COMPILED at all:
Vertex shader error: View Index input is only supported in VS and PS 6.1 or higher.
ShaderCache answers this by rewriting gl_ViewIndex to the VIEWINDEX uniform, which the N-pass path stamps per invocation.
That rewrite and the choice of render path MUST be driven by the same predicate. When they disagree the failure is silent and looks like a rasterizer bug: a D3D12 shader lowered to read VIEWINDEX while QRhi still reports MultiView gets ONE amplified draw in which passIndex never advances past 0 – and all six cube faces come back carrying face 0's colour. Ask this function in both places.
◆ visibilityToStages()
|
noexcept |
Decode an isf::storage_input::visibility string to Qt RHI stage flags.
"fragment" → FragmentStage "vertex" → VertexStage "vertex+fragment" / "both" / "graphics" → Vertex | Fragment "compute" → ComputeStage "none" → 0
◆ warnStorageImageUnits()
| bool score::gfx::warnStorageImageUnits | ( | QRhi & | rhi, |
| const char * | kind, | ||
| std::initializer_list< const QString * > | sources | ||
| ) |
Warn once per shader when a storage image in sources has a binding the OpenGL backend cannot bind (at or above storageImageUnitLimit()).
- Returns
- whether a warning was emitted by this call.
◆ wireComputeSupports()
|
inline |
Whether the compute encoder can handle (fmt, width): v210 needs width % 6, UYVY needs width % 2, BGRA is unconstrained.
◆ zeroTexture()
| bool score::gfx::zeroTexture | ( | QRhi & | rhi, |
| QRhiResourceUpdateBatch & | res, | ||
| QRhiTexture & | tex | ||
| ) |
Queue zeros into every level, layer, face and slice of a texture.
A new QRhiTexture holds whatever memory the driver hands out: zeros on most desktop drivers, the previous owner's pixels on lavapipe and others. Use this on a texture that can be sampled or loaded before anything writes it. The zeros are copied from a small zeroed tile of the same format, so the staging cost is bounded whatever the texture size. Returns false and queues nothing for depth and block-compressed formats.
Variable Documentation
◆ rhiHasIndirectCommandBufferFlags
|
inlineconstexpr |
Metal implements the draw-count rung with indirect command buffers, and Qt then needs two more things than the feature flag says (qrhimetal.mm icbUnavailableReason, QRhiCommandBuffer::drawIndexedIndirect docs): the pipeline created with UsesIndirectDraws, and a depth-stencil renderbuffer created with NoTransientBacking, since the encode kernel interrupts and restarts the render pass. Both are 6.13-era (the SDK picks them), hence detected like the rest. The third condition, a pipeline binding no texture, is drawIndirectCountUsable()'s.
◆ unsetSamplerField
|
inlineconstexpr |
A sampler field of a render_target_spec that its inlet leaves unset: the value one past the last of the 2-bit texture_filter / texture_address_mode fields, which no setting uses.