Skip to content

Implement the GetRemainingRecursionLevels HLSL Function #97625

Open
@farzonl

Description

@farzonl
  • Implement GetRemainingRecursionLevels clang builtin,
  • Link GetRemainingRecursionLevels clang builtin with hlsl_intrinsics.h
  • Add sema checks for GetRemainingRecursionLevels to CheckHLSLBuiltinFunctionCall in SemaChecking.cpp
  • Add codegen for GetRemainingRecursionLevels to EmitHLSLBuiltinExpr in CGBuiltin.cpp
  • Add codegen tests to clang/test/CodeGenHLSL/builtins/GetRemainingRecursionLevels.hlsl
  • Add sema tests to clang/test/SemaHLSL/BuiltIns/GetRemainingRecursionLevels-errors.hlsl
  • Create the int_dx_GetRemainingRecursionLevels intrinsic in IntrinsicsDirectX.td
  • Create the DXILOpMapping of int_dx_GetRemainingRecursionLevels to 253 in DXIL.td
  • Create the GetRemainingRecursionLevels.ll and GetRemainingRecursionLevels_errors.ll tests in llvm/test/CodeGen/DirectX/

DirectX

DXIL Opcode DXIL OpName Shader Model Shader Stages
253 GetRemainingRecursionLevels 6.8 ('node',)

SPIR-V

There is no support for GetRemainingRecursionLevels when targeting SPIR-V.

Test Case(s)

Example 1

//dxc GetRemainingRecursionLevels_test.hlsl -T lib_6_8 -enable-16bit-types -O0

RWBuffer<uint> buf0;

[shader("node")]
[NodeDispatchGrid(1, 1, 1)]
[numthreads(1, 1, 1)]
void fn() {

buf0[0] = GetRemainingRecursionLevels();
}

HLSL:

Syntax

uint GetRemainingRecursionLevels();

Type Description

Name Template Type Component Type Size
ret scalar uint 1

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 6.8 and higher shader models yes

Shader Stages

  • Node Shader

See also

Metadata

Metadata

Assignees

No one assigned

    Labels

    HLSLHLSL Language Supportbackend:DirectXbot:HLSLmetaissueIssue to collect references to a group of similar or related issues.

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions