Skip to content

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

Closed as not planned
@hekota

Description

@hekota

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

Metadata

Metadata

Assignees

Labels

HLSLHLSL Language SupportobsoleteIssues with old (unsupported) versions of LLVM

Type

No type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions