Vixen
02b45cc4
csharp
public static class StageInterface

What a pipeline stage's interface can carry.

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

Remarks

One predicate, for the same reason BindingPlan is one plan: both backends and the reflection have to agree about what is expressible, and two copies of the rule is how they come to differ. They did — SPIR-V refused an aggregate stage output as RVN4001 while GLSL emitted out SomeStruct, which is not valid GLSL at all. glslc caught it; Raven reported nothing on the GLSL path.

The rule is Vulkan's rather than either language's. An interface variable gets one location, so it has to be one scalar or vector; an aggregate would need a location per leaf and a layout rule to assign them, and a boolean has no interface representation at all because OpTypeBool has no size.

Multiple render targets are the case that proves the rule rather than the exception to it: a fragment stage returning a struct is taken apart into one output per member before it reaches here, and every one of those is asked this same question. So the check never had to be relaxed — what changed was that an entry point may have several outputs.

A built-in is not asked at all, because the rule is about a location and a built-in has none: Location and BuiltIn are mutually exclusive decorations, and the type is the target's own rather than something a host lays out. SV_IsFrontFace is the case that makes the distinction visible — gl_FrontFacing and SPIR-V's FrontFacing are both declared bool by the target itself, so asking this predicate about one would refuse a variable neither backend was going to write a location for.

Methods (3)

  • public static bool CanCarry(IrType type)

    Whether a stage input or output may have this type.

  • public static bool MustBeFlat(IrType type)

    Whether a varying of this type has to be flat rather than interpolated.

  • public static string Describe(IrType type, string name, bool isInput)

    The reason a type cannot be carried, phrased for RVN4001's {0}.

Used by (3)

  • GlslEmitterVixen.Raven
  • Int64TestsVixen.Raven.Tests
  • SpirvEmitterVixen.Raven