-
Notifications
You must be signed in to change notification settings - Fork 85
Fix location assignment #482
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
daab5cb
location assignment: compiletest failing with larger than Vec4 struct…
Firestar99 2670228
location assignment: fix overlapping locations
Firestar99 6fc6164
location assignment: explicit location assignment with `#[spirv(locat…
Firestar99 ed5ec7d
location assignment: failing compiletests
Firestar99 6041bf3
location assignment: proper location layout algorithm, as required by…
Firestar99 6945862
location assignment: bless other compiletests
Firestar99 0b9dc00
location assignment: document UniformConstant locations
Firestar99 5450e8c
location assignment: checked multiply and expect with messages
Firestar99 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
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
22 changes: 11 additions & 11 deletions
22
tests/compiletests/ui/spirv-attr/bad-deduce-storage-class.stderr
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,31 @@ | ||
| // build-pass | ||
| // compile-flags: -C llvm-args=--disassemble | ||
| // normalize-stderr-test "OpSource .*\n" -> "" | ||
| // normalize-stderr-test "OpLine .*\n" -> "" | ||
| // normalize-stderr-test "%\d+ = OpString .*\n" -> "" | ||
| // normalize-stderr-test "; .*\n" -> "" | ||
| // normalize-stderr-test "OpCapability VulkanMemoryModel\n" -> "" | ||
| // normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple" | ||
| // ignore-spv1.0 | ||
| // ignore-spv1.1 | ||
| // ignore-spv1.2 | ||
| // ignore-spv1.3 | ||
| // ignore-vulkan1.0 | ||
| // ignore-vulkan1.1 | ||
|
|
||
| use spirv_std::glam::*; | ||
| use spirv_std::{Image, spirv}; | ||
|
|
||
| #[derive(Copy, Clone, Default)] | ||
| pub struct LargerThanVec4 { | ||
| a: Vec4, | ||
| b: Vec2, | ||
| } | ||
|
|
||
| #[spirv(vertex)] | ||
| pub fn main(out1: &mut LargerThanVec4, out2: &mut Vec2, out3: &mut Mat4, out4: &mut f32) { | ||
| *out1 = Default::default(); | ||
| *out2 = Default::default(); | ||
| *out3 = Default::default(); | ||
| *out4 = Default::default(); | ||
| } |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not really more helpful than
.unwrap(). Neither in runtime not during code review.The best approach so far I have found in blockchain space:
.expect()where panics never happen and in its message you write a proof that reviewer can verifyFor example:
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I very much agree with you, it would be a lot better to remodel the entire internal type system, cause it's a mess. I've already been floating a few suggestions, to express some of the complexity in standard library traits. Like a
trait ExplicitLayoutthat is only implemented by types that have a reasonable layout in SPIR-V and can be read from or written to buffers. Specifically, they do not contain references.