Skip to content

Implement the GetRemainingRecursionLevels HLSL Function #97625

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
9 tasks
Tracked by #99235
farzonl opened this issue Jul 3, 2024 · 0 comments
Open
9 tasks
Tracked by #99235

Implement the GetRemainingRecursionLevels HLSL Function #97625

farzonl opened this issue Jul 3, 2024 · 0 comments
Labels
backend:DirectX bot:HLSL HLSL HLSL Language Support metabug Issue to collect references to a group of similar or related issues.

Comments

@farzonl
Copy link
Member

farzonl commented Jul 3, 2024

  • 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

@farzonl farzonl added backend:DirectX HLSL HLSL Language Support HLSL_Bot labels Jul 3, 2024
@EugeneZelenko EugeneZelenko added the metabug Issue to collect references to a group of similar or related issues. label Jul 3, 2024
@farzonl farzonl mentioned this issue Jul 16, 2024
Closed
@farzonl farzonl added bot:HLSL and removed HLSL_Bot labels Jul 16, 2024
@damyanp damyanp moved this to Ready in HLSL Support Oct 30, 2024
@damyanp damyanp moved this from Ready to Planning in HLSL Support Oct 30, 2024
@davidcook-msft davidcook-msft moved this from Planning to Ready in HLSL Support Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:DirectX bot:HLSL HLSL HLSL Language Support metabug Issue to collect references to a group of similar or related issues.
Projects
Status: Ready
Development

No branches or pull requests

2 participants