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

[milestone] Compile a runnable shader from clang #7

Open
8 of 10 tasks
damyanp opened this issue Apr 25, 2024 · 0 comments
Open
8 of 10 tasks

[milestone] Compile a runnable shader from clang #7

damyanp opened this issue Apr 25, 2024 · 0 comments

Comments

@damyanp
Copy link
Collaborator

damyanp commented Apr 25, 2024

This is a milestone on the way to getting full HLSL support in Clang.

For this milestone we need to be able to compile a simple compute shader such that the resulting DXBC container can pass validation and be signed by the DXC validator and can therefore be executed on a non-developer mode Windows desktop PC. The shader compiler binary should come from some kind of nightly build, rather than building locally.

Sample shader

RWBuffer<int> In : register(u0);
RWBuffer<int> Out : register(u1);

[numthreads(8,1,1)]
void main(uint GI : SV_GroupIndex) {
  Out[GI] = In[GI] * In[GI];
}

Workstreams

Language (#21)

  • numthreads entry attribute
  • Entry function linkage rules

Resource Binding (#23)

Semantics (#25)

  • Support SV_GroupIndex and SV_DispatchThreadID used with basic scalar/vector input types for target shader.

Resources (#8)

DirectX Container (#9)

damyanp referenced this issue in llvm/llvm-project Jun 26, 2024
Direct3D requires a PSV0 section to be present in the DXContainer in
order to be able to load and use the shader.

This change adds a minimal stub PSV0, with some hard-coded values, that
are just enough to unblock loading into Direct3D.

Contributes to #90129
lravenclaw referenced this issue in lravenclaw/llvm-project Jul 3, 2024
Direct3D requires a PSV0 section to be present in the DXContainer in
order to be able to load and use the shader.

This change adds a minimal stub PSV0, with some hard-coded values, that
are just enough to unblock loading into Direct3D.

Contributes to #90129
AlexisPerry referenced this issue in llvm-project-tlp/llvm-project Jul 9, 2024
Direct3D requires a PSV0 section to be present in the DXContainer in
order to be able to load and use the shader.

This change adds a minimal stub PSV0, with some hard-coded values, that
are just enough to unblock loading into Direct3D.

Contributes to #90129
@damyanp damyanp transferred this issue from llvm/llvm-project Aug 1, 2024
@damyanp damyanp changed the title [HLSL][DirectX] Compile a runnable shader from clang [milestone] Compile a runnable shader from clang Aug 1, 2024
hekota added a commit to llvm/llvm-project that referenced this issue Oct 18, 2024
…11207)

Adds `@_init_resource_bindings()` function to module initialization that
includes `handle.fromBinding` intrinsic calls for simple resource
declarations. Arrays of resources or resources inside user defined types
are not supported yet.

While this unblocks our progress on [Compile a runnable shader from
clang](llvm/wg-hlsl#7) milestone, this is
probably not the way we would like to handle resource binding
initialization going forward. Ideally, it should be done via the
resource class constructors in order to support dynamic resource binding
or unbounded arrays if resources.

Depends on PRs #110327 and #111203.

Part 1 of #105076
bricknerb pushed a commit to bricknerb/llvm-project that referenced this issue Oct 21, 2024
…vm#111207)

Adds `@_init_resource_bindings()` function to module initialization that
includes `handle.fromBinding` intrinsic calls for simple resource
declarations. Arrays of resources or resources inside user defined types
are not supported yet.

While this unblocks our progress on [Compile a runnable shader from
clang](llvm/wg-hlsl#7) milestone, this is
probably not the way we would like to handle resource binding
initialization going forward. Ideally, it should be done via the
resource class constructors in order to support dynamic resource binding
or unbounded arrays if resources.

Depends on PRs llvm#110327 and llvm#111203.

Part 1 of llvm#105076
EricWF pushed a commit to efcs/llvm-project that referenced this issue Oct 22, 2024
…vm#111207)

Adds `@_init_resource_bindings()` function to module initialization that
includes `handle.fromBinding` intrinsic calls for simple resource
declarations. Arrays of resources or resources inside user defined types
are not supported yet.

While this unblocks our progress on [Compile a runnable shader from
clang](llvm/wg-hlsl#7) milestone, this is
probably not the way we would like to handle resource binding
initialization going forward. Ideally, it should be done via the
resource class constructors in order to support dynamic resource binding
or unbounded arrays if resources.

Depends on PRs llvm#110327 and llvm#111203.

Part 1 of llvm#105076
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Active
Development

No branches or pull requests

1 participant