Library Overview[Library]

10 Library Overview[Library]

This clause serves as an overview to the remaining clauses of the specification which detail hlsl’s standard library of functions and objects.

10.1 Syntax Notations[Library.Notation]

Some of the constructs in the standard library are not expressible with spellable syntax. This section describes syntax constructs which are non-standard but are used throughout the standard library specification.

Code blocks in the remaining clauses of the specification decribe a hypothetical implementation and are provided for clarity. A conforming implementation need not rely on the specific code in any of the blocks.

10.1.1 Constructors[Library.Notation.Constructors]

Some standard library types have behaviors associated in isoCPP with constructors. These syntaxes are intended to describe equivalent behavior with C++ constructors.

10.1.2 Reference Types[Library.Notation.References]

Some standard library functions or member functions behave as if a parameter or return value are references (passed by address or returned by address). To simplify this notation the syntax address-spaceopt T & is used where the optional address-space is one of device or groupshared.

10.1.3 Concepts[Library.Notation.Concepts]

Some standard library template functions or objects have constraints to which types are valid as template arguments. To simplify this notation the concepts syntax from isoCPP20 is used.

10.2 Method of Description (Informative)[Library.Method]

10.2.1 Clause Structure[Libarry.Method.Structure]

Each library clause will contain all applicable subclauses of the list:

  • Introduction

  • Optional features

  • Special semantics

  • Element subclauses

The clause introduction shall provide an overview of the contents of the clause. Some features detailed in a clause may be optional, a subclause describing the optional features will be included if applicable.

Each library clause will optionally contain a subclause describing additional semantic behaviors required for the clause. This subclause is omitted if empty.

Each library clause will contain one or more element subclauses detailing the declarations required in a conforming implementation of the specification, and any normative optional declarations based on optional features described in the clause.

10.2.1.1 Element Subclauses[Library.Method.Structure.Element]

Each element subclause contain the following:

  • Summary

  • Detailed specifications

10.2.1.2 Summary[Library.Method.Structure.Summary]

The summary will include a description of the category as well as a listing of any introduced headers, macros, and declarations.

10.2.1.3 Detailed Specification[Library.Method.Structure.Detailed]

The detailed specification for each entity will contain each of the below that apply:

  • Name and description

  • Class definition or function prototype

  • Template argument constraints

  • Class invariants

  • Function semantics

Description of class member functions will follow the order, omitting sections that are empty:

  • Constructors

  • Copying and assignment

  • Modifying functions

  • Inspection functions

  • Operators

  • Other non-member functions

Descriptions of function semantics will contain all of the following elements that apply in the order as specified:

  • Requires: the preconditions for calling the function.

  • Effects: the actions performed by the function.

  • Synchronization: the requirements for execution or memory synchronization.

  • Returns: a description of the value returned by the function.

  • Remarks: additional normative information about the function.

  • Notes: non-normative information provided about the function.