Skip to content
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

[HLSL] [HLSL] Translate cbuffer {...} declarations to target type dx.CBuffer for simple cases with no arrays or embedded structs #118531

Open
Tracked by #41
hekota opened this issue Dec 3, 2024 · 1 comment · May be fixed by #119755
Assignees
Labels
HLSL HLSL Language Support

Comments

@hekota
Copy link
Member

hekota commented Dec 3, 2024

Implement cbuffer codegen for simple constant buffers that have no arrays or embedded structs. The constant buffer will be translated to LLVM target type target("dx.CBuffer", ...) and should include the cbuffer type, size, and a sequence of numbers specifying the layout (list of offset for each field).

For example:

cbuffer MyConstants {
  float2 a;
  float b;
  int4 c;
};

will be translated to target("dx.CBuffer", { <2 x float>, [2 x float], i32}, 32, 0, 8, 16).

Note that this might not be the final way how we are going to encode the constant buffer layout. They way to encode layout of constant buffers that contain arrays and embedded structures is still TBD and might change how the simple case is encoded as well.

Doing the simple case first will unblock tasks that are dependent of cbuffer codegen: #104862, #114126, #112992

@hekota hekota moved this to Planning in HLSL Support Dec 3, 2024
@EugeneZelenko EugeneZelenko added HLSL HLSL Language Support and removed new issue labels Dec 3, 2024
@EugeneZelenko
Copy link
Contributor

@hekota: Please do not forget to add relevant labels during issues creation.

@damyanp damyanp moved this from Planning to Ready in HLSL Support Dec 3, 2024
@hekota hekota changed the title [HLSL] Translate cbuffer blocks to LLVM target type for simple cases with no arrays or embedded structs [HLSL] Translate cbuffer declarations to LLVM target type for simple cases with no arrays or embedded structs Dec 12, 2024
@hekota hekota moved this from Ready to Needs Review in HLSL Support Dec 12, 2024
@hekota hekota moved this from Needs Review to Active in HLSL Support Dec 20, 2024
@hekota hekota self-assigned this Dec 20, 2024
@hekota hekota mentioned this issue Jan 13, 2025
10 tasks
@hekota hekota changed the title [HLSL] Translate cbuffer declarations to LLVM target type for simple cases with no arrays or embedded structs [HLSL] [HLSL] Translate cbuffer {...} declarations to target type dx.CBuffer for simple cases with no arrays or embedded structs Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HLSL HLSL Language Support
Projects
Status: Active
Development

Successfully merging a pull request may close this issue.

2 participants