Vixen
02b45cc4
csharp
public readonly struct VideoConstants

The sixty-four bytes a video draw is, on their way to both shader stages.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

A push constant rather than a uniform buffer, for the reason the UI's projection is one: it is sixteen floats that change per draw, and a descriptor set for that would be a set to allocate, bind and invalidate on every video on the screen. Sixty-four bytes is half of the hundred and twenty-eight every Vulkan implementation guarantees.

⚠ Laid out to match the shader's layout(push_constant) block field for field. Nothing checks that at compile time, on any engine — a mismatch is a picture in the wrong place or the wrong colour rather than an error — so the block is one struct here and one block there, and both are commented with the same names.

Fields and properties (5)

  • public const int Size

    How many bytes the block is.

  • public readonly Vector4 Placement

    Clip-space scale (xy) and offset (zw), which turn a 0–1 corner into a position.

  • public readonly Vector4 Crop

    Texture-coordinate scale (xy) and offset (zw), which crop the picture.

  • public readonly Vector4 Luma

    Luma offset, luma scale, V's contribution to red, U's to blue.

  • public readonly Vector4 Chroma

    U's contribution to green, V's, the tint alpha, and the sample mode.

Methods (2)

Used by (2)

  • VideoConstantsTestsVixen.Video.Rendering.Tests
  • VideoRendererVixen.Video.Rendering