Table of Contents

Class GlSamplerSlots

Namespace
ShadowDusk.HLSL.Ast
Assembly
ShadowDusk.HLSL.dll

The two facts the OpenGL sampler allocator starts from, both read off the PREPROCESSED source (conditionals evaluated, macros expanded) the way mgfxc reads them. Produced by CollectGlSamplerSlots(string, string, FxParseResult).

public sealed record GlSamplerSlots : IEquatable<GlSamplerSlots>
Inheritance
GlSamplerSlots
Implements
Inherited Members

Constructors

GlSamplerSlots(IReadOnlyDictionary<string, int>, IReadOnlySet<int>)

The two facts the OpenGL sampler allocator starts from, both read off the PREPROCESSED source (conditionals evaluated, macros expanded) the way mgfxc reads them. Produced by CollectGlSamplerSlots(string, string, FxParseResult).

public GlSamplerSlots(IReadOnlyDictionary<string, int> Explicit, IReadOnlySet<int> Reserved)

Parameters

Explicit IReadOnlyDictionary<string, int>

TEXTURE name -> the texture unit an explicit register(sN) on its LEGACY sampler declaration pins it to. The preprocessed counterpart of ExplicitGlSamplerSlots (issue #299).

Reserved IReadOnlySet<int>

The registers modern SamplerState X : register(sN) declarations take out of circulation. The preprocessed counterpart of ReservedGlSamplerSlots (issue #283).

Properties

EntryPointInterpolants

Function name -> the matrix declarations its signature carries, for every function DEFINED in the preprocessed source (the compile looks up the entry points its passes name). Not a sampler fact: it rides on the same view because the OpenGL rewriter cannot see majorness in DXC's output, and fxc packs a row_major matrix interpolant by rows (see MatrixInterpolantDeclaration).

public IReadOnlyDictionary<string, EntryPointMatrixInterpolants> EntryPointInterpolants { get; init; }

Property Value

IReadOnlyDictionary<string, EntryPointMatrixInterpolants>

Explicit

TEXTURE name -> the texture unit an explicit register(sN) on its LEGACY sampler declaration pins it to. The preprocessed counterpart of ExplicitGlSamplerSlots (issue #299).

public IReadOnlyDictionary<string, int> Explicit { get; init; }

Property Value

IReadOnlyDictionary<string, int>

LegacySamplerRegisters

SAMPLER name (as the preprocessed view spells it) -> the explicit register(sN) on its LEGACY declaration, for every legacy sampler a legacy intrinsic (tex2D ...) reads. Keyed on the sampler rather than the texture so two samplers sharing one texture stay apart: it is what the overlapping-register check (SD0227, fxc's X4500) reads.

public IReadOnlyDictionary<string, int> LegacySamplerRegisters { get; init; }

Property Value

IReadOnlyDictionary<string, int>

LegacySamplerTextures

LEGACY sampler name -> the texture it samples through, both as the preprocessed view spells them. The DirectX 11 sampler table needs the join: mgfxc's record for a legacy sampler's texture carries that SAMPLER's DXBC binding, not the texture's.

public IReadOnlyDictionary<string, string> LegacySamplerTextures { get; init; }

Property Value

IReadOnlyDictionary<string, string>

LegacyTextures

TEXTURE names (as the preprocessed view spells them) that a LEGACY sampler samples through (its synthesized texture, or the one its sampler_state block names). fxc allocates the OpenGL units of these AFTER every modern (texture, sampler) pair, so the allocator needs to tell the two kinds apart.

public IReadOnlySet<string> LegacyTextures { get; init; }

Property Value

IReadOnlySet<string>

Reserved

The registers modern SamplerState X : register(sN) declarations take out of circulation. The preprocessed counterpart of ReservedGlSamplerSlots (issue #283).

public IReadOnlySet<int> Reserved { get; init; }

Property Value

IReadOnlySet<int>