Repository: shader-slang/slang
File: source/slang/slang-type-layout.h (C/C++)

Code before:
        : hashedStringLiteralPool(StringSlicePool::Style::Empty)
    {
    }

    // We catalog the requested entry points here,
    // and any entry-point-specific parameter data
    // will (eventually) belong there...
    List<RefPtr<EntryPointLayout>> entryPoints;

    /// Reflection information on (unspecialized) specialization parameters.
    List<RefPtr<SpecializationParamLayout>> specializationParams;

    /// Concrete argument values that were provided to specific global generic parameters.
    ///
    /// Not useful for reflection, but valuable for code generation.
    ///
    Dictionary<GlobalGenericParamDecl*, Val*> globalGenericArgs;

    /// Holds all of the string literals that have been hashed
    StringSlicePool hashedStringLiteralPool;

    /// The descriptor set/space index allocated for the bindless resource heap.
    /// This is determined during layout generation before any DCE occurs,
    /// ensuring consistency with reflection data.
    /// A value of -1 indicates no bindless space has been allocated.
    Int bindlessDescriptorSetIndex = -1;
};

StructTypeLayout* getGlobalStructLayout(ProgramLayout* programLayout);

struct LayoutRulesFamilyImpl;

// A delineation of shader parameter types into fine-grained
// categories that can then be mapped down to actual resources
// by a given set of rules.
//
// TODO(tfoley): `SlangParameterCategory` and `slang::ParameterCategory`
// are badly named, and need to be revised so they can't be confused
// with this concept.
enum class ShaderParameterKind
{
    ConstantBuffer,
    TextureUniformBuffer,
    ShaderStorageBuffer,

    StructuredBuffer,
    MutableStructuredBuffer,

    RawBuffer,
    MutableRawBuffer,


Review comment (suggestion):
In the frontend, things should be named in a platform agnostic way. So we should prefer `bindlessSpaceIndex` here.

Code after:
        : hashedStringLiteralPool(StringSlicePool::Style::Empty)
    {
    }

    // We catalog the requested entry points here,
    // and any entry-point-specific parameter data
    // will (eventually) belong there...
    List<RefPtr<EntryPointLayout>> entryPoints;

    /// Reflection information on (unspecialized) specialization parameters.
    List<RefPtr<SpecializationParamLayout>> specializationParams;

    /// Concrete argument values that were provided to specific global generic parameters.
    ///
    /// Not useful for reflection, but valuable for code generation.
    ///
    Dictionary<GlobalGenericParamDecl*, Val*> globalGenericArgs;

    /// Holds all of the string literals that have been hashed
    StringSlicePool hashedStringLiteralPool;

    /// The descriptor set/space index allocated for the bindless resource heap.
    ///
    /// Return: -1 means Bindless resources not used
    /// Return: >= 0 means Allocated space index for the bindless resource heap
    Int bindlessSpaceIndex = -1;
};

StructTypeLayout* getGlobalStructLayout(ProgramLayout* programLayout);

struct LayoutRulesFamilyImpl;

// A delineation of shader parameter types into fine-grained
// categories that can then be mapped down to actual resources
// by a given set of rules.
//
// TODO(tfoley): `SlangParameterCategory` and `slang::ParameterCategory`
// are badly named, and need to be revised so they can't be confused
// with this concept.
enum class ShaderParameterKind
{
    ConstantBuffer,
    TextureUniformBuffer,
    ShaderStorageBuffer,

    StructuredBuffer,
    MutableStructuredBuffer,

    RawBuffer,
    MutableRawBuffer,