-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Naga mesh shader SPIR-V writer #8456
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
inner-daemons
wants to merge
160
commits into
gfx-rs:trunk
Choose a base branch
from
inner-daemons:mesh-shading/spv-write
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+5,003
−8,149
Open
Changes from 149 commits
Commits
Show all changes
160 commits
Select commit
Hold shift + click to select a range
1c90d19
Initial commit
inner-daemons 8c3e550
Other initial changes
inner-daemons 85bbc5a
Updated shader snapshots
inner-daemons ccf8467
Added new HLSL limitation
inner-daemons e55c02f
Moved error to global variable error
inner-daemons f3a31a4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 0f6da75
Added docs to per_primitive
inner-daemons 3017214
Added a little bit more docs here and there in IR
inner-daemons 19b55b5
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 198437b
Adding validation to ensure that task shaders have a task payload
inner-daemons 64000e4
Updated spec to reflect the change to payload variables
inner-daemons 0575e98
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons b572ec7
Updated the mesh shading spec because it was goofy
inner-daemons 34d0411
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 02664e4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 7bec4dd
some doc tweaks
jimblandy 2fcb853
Tried to clarify docs a little
inner-daemons 3009b5a
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 8bfe106
Tried to update spec
inner-daemons 6ccaeec
Removed a warning
inner-daemons 5b7ba11
Addressed comment about docs mistake
inner-daemons 29c6972
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 63fa8b5
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 26c8681
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons d9cac9c
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons c112cb4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons e1ff67d
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 64644f7
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 739948b
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 7ca25a4
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 09ddbec
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 2d6a647
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 4657646
Review in progress
jimblandy 41b654c
mesh_shading.md: more tweaks
jimblandy 33ed0a6
Ran cargo fmt
inner-daemons 53ecb39
Small tweaks
inner-daemons 0ead329
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 07bfb1f
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons ba51fa2
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons c4e3eef
[naga] Move definition of `ShaderStage::compute_like` to `proc`.
jimblandy 8c9287d
Replace TODO comment with followup issue.
jimblandy 8f04d4f
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons 3a8399d
Update analyzer.rs
inner-daemons 879b79b
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons d92fe67
Removed stuff in accordance with Jim's recommendation
inner-daemons 2dc4090
minor changes for readability
jimblandy 1ec734b
Pull mesh shader output type validation out into its own function.
jimblandy 9ef0ed5
doc fixes
jimblandy 1173b0f
remove duplicated task payload validation
jimblandy 258e7e6
Quick little changes
inner-daemons 8885c5d
Another quick fix
inner-daemons 1cc3e85
Quick fix
inner-daemons 3be2c25
Removed unnecessary TODO statement
inner-daemons 21d3cc7
A
inner-daemons d5c11d3
Tried to be more expressive
inner-daemons 82ec9c2
Merge branch 'trunk' into mesh-shading/naga-ir
inner-daemons e7faff6
Made functions only work in mesh shader entry points
inner-daemons 385535a
Various validation fix attempts
inner-daemons c3f9acd
Undid capabilities resize
inner-daemons d15ba19
WGSL PR is up :)
inner-daemons f14e0f0
Update naga/src/ir/mod.rs
inner-daemons 7e12d30
Update naga/src/front/wgsl/error.rs
inner-daemons ce517bb
Update naga/src/ir/mod.rs
inner-daemons 083959e
Other Erich suggestion
inner-daemons 16aa7d0
Updated docs & validation for some builtins
inner-daemons 76bfca0
Added some docs & removed contentious "// TODO"
inner-daemons e68d0d2
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons 0fd0fdd
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/wgsl-…
inner-daemons e100034
Fixed bad validation, formatted mesh shader wgsl
inner-daemons edea07e
Rewrote the IR and parser significantly
inner-daemons 3905ae8
Improved validation slightly, remvoed obselete crap, fixed bug in com…
inner-daemons 8f6332d
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/wgsl-…
inner-daemons f557cad
Some initial changes to adapt to new system
inner-daemons f18a32a
Undid stupid change to writer that I have no idea how it occured
inner-daemons d20ee08
Added changelog entry
inner-daemons 64798dd
Added changelog entry
inner-daemons c85ad3f
Made tests & example use WGSL input for vulkan
inner-daemons cdcd600
Tried to fix capabiiities stuff
inner-daemons 6e85c6d
Cleaned up some edge cases on mesh shader capabilities
inner-daemons 9fc6dcb
Added mesh shader example test
inner-daemons 1856416
Corrected bug in spirv writer
inner-daemons 4b7a911
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons c8dccd3
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons d638d42
FIxed MESH_DISABLED test
inner-daemons 62e456c
Removed mesh disabled test cus its stupid
inner-daemons 50ca382
Updated shader to try to make it pass tests
inner-daemons bd923cd
Made parser respect enable extension
inner-daemons d95070a
Updated mesh shader spec
inner-daemons 55dc67a
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons ace7e17
Cleaned up the mesh shader analyzer function
inner-daemons f55dbd9
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons 3e1c6f9
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons f0d2cca
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons 3b2bd30
Slight refactor & changed stuff to use "Word"
inner-daemons a061ee7
Made mesh shader builtins require mesh shader capability
inner-daemons bd965a7
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons 7be0aa4
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons a5d28e6
Improved some stuff
inner-daemons d6b6ce2
Added comments, cleaned stuff up
inner-daemons 19213fb
A few more comments
inner-daemons 46fbc37
Merge branch 'trunk' into mesh-shading/spv-write
inner-daemons c0278f3
Updated changelog
inner-daemons 970be05
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons ab69a74
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons e7dc9e5
Updated validation from spv-write
inner-daemons 592ac16
Slight tweaks
inner-daemons f3daf23
Fix little typo
inner-daemons 4398171
Added capabilitiy thing blah blah blah
inner-daemons b88fab5
Updated comment slightly to clarify something
inner-daemons ffa9219
Removed thing from mesh shader test
inner-daemons 1f071a6
Fixed compaction & clean stuff up
inner-daemons 7f744cf
Fixed compaction and such pt 2
inner-daemons 9978847
Merge branch 'trunk' into mesh-shading/wgsl-parse
inner-daemons a031276
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons afb16fa
Updated code for the newly merged stuff
inner-daemons 1d13726
Paved the way for primitive-index stuff
inner-daemons be308b9
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons 942fe12
Added a single comment
inner-daemons 25afe48
Little bit of cleanup
inner-daemons e4b9e23
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons d1f2e92
Updated snapshots
inner-daemons a15190b
Added a barrier thing
inner-daemons 4f811ee
Made it clamp the number of vertices/primitives writte
inner-daemons 453a150
Added new features/capabilities for point primitives and added snapsh…
inner-daemons 2b96eb2
Updated spec to rename something
inner-daemons b3bfa73
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons 4b7ba3a
Updated new snapshots with SPIR-V
inner-daemons f888b74
Fixed experimental features stuff
inner-daemons 1fd690b
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons 703bac7
Updated the spec
inner-daemons 9de4741
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons 6df4efa
Fixed new validation rule for task payload size
inner-daemons c13f7dd
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons 5f86623
Update mesh_shading.md
inner-daemons 2453155
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/wgsl-…
inner-daemons c55d5be
Updated toml files
inner-daemons 5a2bb01
Updated stuff to use wgpu_mesh_shader name
inner-daemons 7e7b1d8
Merge branch 'mesh-shading/wgsl-parse' into mesh-shading/spv-write
inner-daemons 18fa9a8
Updated the example & tests
inner-daemons 50b3483
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/spv-w…
inner-daemons 65be73b
I am so fucking confused
inner-daemons b569fd1
Seeing what happens
inner-daemons 8df685a
WHAT THE FUCK IS GOING ON
inner-daemons aa06d41
Didn't notice this thing
inner-daemons a9e112e
Does this fix it?
inner-daemons 7d43d25
That didn't help I guess, whatever man, fuck
inner-daemons 62d0ed5
This should fix some of it
inner-daemons 14cb5de
Updated writer, will regenerate snapshots elsewhere cus fuck this
inner-daemons 0a3c94d
UPdated snapshots, removed IR and analysis targets
inner-daemons 9c381bb
Updated thing
inner-daemons 223114f
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/spv-w…
inner-daemons 1a3319b
Update naga/src/back/spv/block.rs
inner-daemons 8bd35d3
Update naga/src/back/spv/block.rs
inner-daemons 186c916
Addressed some stuff
inner-daemons cefee1b
Another fix
inner-daemons 019e8ed
Cleaned some stuff up
inner-daemons 3c7a258
Refactored slightly
inner-daemons b5339b7
Merge remote-tracking branch 'upstream/trunk' into mesh-shading/spv-w…
inner-daemons 9840c36
Another slight improvement
inner-daemons b9cd262
Updated snapshots
inner-daemons File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| enable wgpu_mesh_shader; | ||
|
|
||
| const positions = array( | ||
| vec4(0., 1., 0., 1.), | ||
| vec4(-1., -1., 0., 1.), | ||
| vec4(1., -1., 0., 1.) | ||
| ); | ||
| const colors = array( | ||
| vec4(0., 1., 0., 1.), | ||
| vec4(0., 0., 1., 1.), | ||
| vec4(1., 0., 0., 1.) | ||
| ); | ||
| struct TaskPayload { | ||
| colorMask: vec4<f32>, | ||
| visible: bool, | ||
| } | ||
| var<task_payload> taskPayload: TaskPayload; | ||
| var<workgroup> workgroupData: f32; | ||
| struct VertexOutput { | ||
| @builtin(position) position: vec4<f32>, | ||
| @location(0) color: vec4<f32>, | ||
| } | ||
| struct PrimitiveOutput { | ||
| @builtin(triangle_indices) index: vec3<u32>, | ||
| @builtin(cull_primitive) cull: bool, | ||
| @per_primitive @location(1) colorMask: vec4<f32>, | ||
| } | ||
| struct PrimitiveInput { | ||
| @per_primitive @location(1) colorMask: vec4<f32>, | ||
| } | ||
|
|
||
| @task | ||
| @payload(taskPayload) | ||
| @workgroup_size(1) | ||
| fn ts_main() -> @builtin(mesh_task_size) vec3<u32> { | ||
| workgroupData = 1.0; | ||
| taskPayload.colorMask = vec4(1.0, 1.0, 0.0, 1.0); | ||
| taskPayload.visible = true; | ||
| return vec3(3, 1, 1); | ||
| } | ||
|
|
||
| struct MeshOutput { | ||
| @builtin(vertices) vertices: array<VertexOutput, 3>, | ||
| @builtin(primitives) primitives: array<PrimitiveOutput, 1>, | ||
| @builtin(vertex_count) vertex_count: u32, | ||
| @builtin(primitive_count) primitive_count: u32, | ||
| } | ||
|
|
||
| var<workgroup> mesh_output: MeshOutput; | ||
| @mesh(mesh_output) | ||
| @payload(taskPayload) | ||
| @workgroup_size(1) | ||
| fn ms_main(@builtin(local_invocation_index) index: u32, @builtin(global_invocation_id) id: vec3<u32>) { | ||
| mesh_output.vertex_count = 3; | ||
| mesh_output.primitive_count = 1; | ||
| workgroupData = 2.0; | ||
|
|
||
| mesh_output.vertices[0].position = positions[0]; | ||
| mesh_output.vertices[0].color = colors[0] * taskPayload.colorMask; | ||
|
|
||
| mesh_output.vertices[1].position = positions[1]; | ||
| mesh_output.vertices[1].color = colors[1] * taskPayload.colorMask; | ||
|
|
||
| mesh_output.vertices[2].position = positions[2]; | ||
| mesh_output.vertices[2].color = colors[2] * taskPayload.colorMask; | ||
|
|
||
| mesh_output.primitives[0].index = vec3<u32>(0, 1, 2); | ||
| mesh_output.primitives[0].cull = !taskPayload.visible; | ||
| mesh_output.primitives[0].colorMask = vec4<f32>(1.0, 0.0, 1.0, 1.0); | ||
| } | ||
| @fragment | ||
| fn fs_main(vertex: VertexOutput, primitive: PrimitiveInput) -> @location(0) vec4<f32> { | ||
| return vertex.color * primitive.colorMask; | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.