Correctly copy to resource_desc1 in rawgather test#4467
Merged
pow2clk merged 2 commits intomicrosoft:mainfrom May 26, 2022
Merged
Correctly copy to resource_desc1 in rawgather test#4467pow2clk merged 2 commits intomicrosoft:mainfrom
pow2clk merged 2 commits intomicrosoft:mainfrom
Conversation
The previous approach was assigning garbage to the final field of desc1 due to alignment padding in desc0 where that field would be. This just duplicates the utility function behavior to copy one desc to the new one
|
✅ Build DirectXShaderCompiler 1.0.1665 completed (commit b40a43bd6d by @pow2clk) |
|
✅ Build DirectXShaderCompiler 1.0.1666 completed (commit 68ea37b172 by @pow2clk) |
sooknarine
reviewed
May 26, 2022
| // Copy resDesc0 to resDesc1 zeroing anything new | ||
| D3D12_RESOURCE_DESC1 resDesc1 = {0}; | ||
| memcpy(&resDesc1, &resDesc, sizeof(resDesc)); | ||
| CopyDesc0ToDesc1(resDesc1, resDesc) { |
Contributor
There was a problem hiding this comment.
Looks like there was a typo here, should be CopyDesc0ToDesc1(resDesc1, resDesc); but has an open curly brace :(
sooknarine
reviewed
May 26, 2022
|
|
||
| #if defined(NTDDI_WIN10_CU) && WDK_NTDDI_VERSION >= NTDDI_WIN10_CU | ||
| // Copy common fields from desc0 to desc1 and zero out the new one | ||
| void CopyDesc0ToDesc1(D3D12_RESOURCE_DESC1 &desc1, const D3D12_RESOURCE_DESC1 &desc0) { |
Contributor
There was a problem hiding this comment.
Also, I think the second argument needs to D3D12_RESOURCE_DESC to compile.
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.
The previous approach was assigning garbage to the final field of desc1
due to alignment padding in desc0 where that field would be.
This just duplicates the utility function behavior to copy one desc to
the new one