Fix compile-time errors in D3D12MeshShaders samples (error C2102: '&' requires l-value)#683
Merged
sebmerry merged 5 commits intomicrosoft:masterfrom Jan 4, 2021
Conversation
Just throwing structures into temporaries, might be better ways to do this
This seems relatively decent, besides the loop for vertex resource barriers Fixed a bug where I set the wrong end state
Contributor
Author
jenatali
approved these changes
Dec 21, 2020
Member
jenatali
left a comment
There was a problem hiding this comment.
Looks good to me, thanks for doing this!
Member
|
This looks great, thank you! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As referenced in issue #652, there are a number of compile-time errors in the Mesh Shaders sample set. They all relate to using r-values (temporary copies of various D3D12 structs) to generate pointers to pass into the D3D API surface.
I converted all of the problematic spots by using
constlocals to temporarily hold the struct contents. I also took the (small) liberty of merging some barriers inModel::UploadGpuResources(search forpostCopyBarriersnear the end of the method. Let me know if you want to undo them and match the original style of one barrier per copied resource.Trickiest part for me was figuring out how to match the existing style, considering so much of the code was using this short-hand style. I was able to model off some of the other samples, so I hope it's ok.
Extra: I did not fix all the samples in the repo, because I thought that it was a bit of scope for this PR, especially for my first PR against this repo. Maybe I'll fix the rest in a follow-up PR!