Loading...
Searching...
No Matches
HostPinnedRing.hpp File Reference

Vendor-neutral N-slot sysmem ring for DVP / AMD-pinned / host-copy transfers. More...

Detailed Description

Vendor-neutral N-slot sysmem ring for DVP / AMD-pinned / host-copy transfers.

Counterpart to ImportedGpuBufferRing (which holds GPU-side buffers for true direct P2P). HostPinnedRing holds host-side page-locked buffers that a video card's DMA engine writes into, and a per-backend transfer primitive that moves slot contents to/from a QRhi texture.

The class is consumed by every vendor strategy that goes through host RAM on the hot path: DeckLink (all variants), AJA's DVP path, Magewell, Datapath, Osprey, USB capture, GenICam, etc. The vendor supplies the page-locked buffer (via its DMABufferLock, MWPinVideoBuffer, etc) and the slot index it just filled; the ring runs the QRhi-side ingest via the configured backend.

Backend selection is automatic:

  1. DVP (NVIDIA Quadro/Tesla, Win+Linux) — fastest sysmem→texture mechanism on NVIDIA HW. Uses nv_dvp_copy_buffer_to_texture.
  2. AMD-pinned (AMD, Win+Linux) — GL_AMD_pinned_memory-class buffer bound as GL_PIXEL_UNPACK_BUFFER + glTexSubImage2D. Only when QRhi is on the OpenGL backend.
  3. cudaHostRegister (NVIDIA, any backend) — page-locks the slot then cuMemcpy2D into a CUDA-imported QRhi texture. Fallback when DVP isn't loaded but CUDA is.
  4. CPU staging — plain QRhi uploadTexture from the slot's host pointer. Always available.

The picker walks the list in order, choosing the first backend compatible with the live QRhi backend + the GpuCapabilities probe.

Go to the source code of this file.

Classes

struct  score::gfx::interop::HostPinnedSlot
 
struct  score::gfx::interop::HostPinnedRingConfig
 
class  score::gfx::interop::HostPinnedRing
 

Namespaces

namespace  score
 Base toolkit upon which the software is built.
 
namespace  score::gfx
 Graphics rendering pipeline for ossia score.
 

Enumerations

enum class  score::gfx::interop::HostPinnedRingBackend : uint8_t {
  None = 0 , Dvp , AmdPinned , CudaHostReg ,
  CpuStaging
}
 
enum class  score::gfx::interop::HostPinnedDirection : uint8_t { CaptureToTexture = 0 , TextureToBuffer }
 

Functions

const char * score::gfx::interop::hostPinnedBackendName (HostPinnedRingBackend) noexcept
 Short name for logs and harness rows.
 

Enumeration Type Documentation

◆ HostPinnedDirection

enum class score::gfx::interop::HostPinnedDirection : uint8_t
strong

Direction of the per-slot transfer.

Enumerator
CaptureToTexture 

Vendor wrote into slot, ring uploads to texture.

TextureToBuffer 

Ring downloads texture to slot, vendor reads.

◆ HostPinnedRingBackend

enum class score::gfx::interop::HostPinnedRingBackend : uint8_t
strong

Which backend a HostPinnedRing instance is using. Set by create() and queryable via backend().

Enumerator
Dvp 

NVIDIA DVP — fastest sysmem path.

AmdPinned 

AMD GL pinned-memory or virtual-memory.

CudaHostReg 

cudaHostRegister + cuMemcpy2D.

CpuStaging 

QRhi uploadTexture / readbackTexture fallback.