Skip to content

Correctly copy to resource_desc1 in rawgather test#4467

Merged
pow2clk merged 2 commits intomicrosoft:mainfrom
pow2clk:fix_rawgather
May 26, 2022
Merged

Correctly copy to resource_desc1 in rawgather test#4467
pow2clk merged 2 commits intomicrosoft:mainfrom
pow2clk:fix_rawgather

Conversation

@pow2clk
Copy link
Copy Markdown
Collaborator

@pow2clk pow2clk commented May 18, 2022

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

Greg Roth and others added 2 commits May 18, 2022 16:35
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
@AppVeyorBot
Copy link
Copy Markdown

@AppVeyorBot
Copy link
Copy Markdown

Copy link
Copy Markdown
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pow2clk pow2clk merged commit e1f8c6a into microsoft:main May 26, 2022
@pow2clk pow2clk deleted the fix_rawgather branch May 26, 2022 07:11
// Copy resDesc0 to resDesc1 zeroing anything new
D3D12_RESOURCE_DESC1 resDesc1 = {0};
memcpy(&resDesc1, &resDesc, sizeof(resDesc));
CopyDesc0ToDesc1(resDesc1, resDesc) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there was a typo here, should be CopyDesc0ToDesc1(resDesc1, resDesc); but has an open curly brace :(


#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) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I think the second argument needs to D3D12_RESOURCE_DESC to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants