Skip to content

Conversation

@bob80905
Copy link
Contributor

@bob80905 bob80905 commented Dec 5, 2025

This PR is the second step in bringing support to testing with partially mapped and unmapped resources.
It lays out the infrastructure necessary to initialize UAV resources with only a certain number of tiles mapped. By default, if the UAV is specified as reserved, a sufficient number of tiles to cover the entire size of the UAV resource will be mapped, unless otherwise specified.
The IsReserved keyword was added to the yaml resource setup, and if not specified, the resources will be created as committed. The TilesMapped keyword requires that the IsReserved keyword is set to True.

Addresses #182
Fixes #181
Fixes #623
The last part needed to complete the above issue (182) would be to implement partial mappings for Buffers, but that will be left to a separate PR.

@bob80905 bob80905 changed the title Add unmapped resources tests for UAV resources Add capability to use reserved or committed resources for SRVs and UAVs Dec 17, 2025
Copy link
Collaborator

@damyanp damyanp left a comment

Choose a reason for hiding this comment

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

I think there may be some unrelated changes in this PR that should be pulled out into a separate, and also some changes that probably aren't really necessary.

CD3DX12_HEAP_PROPERTIES(D3D12_HEAP_TYPE_UPLOAD);
const D3D12_RESOURCE_DESC UploadResDesc =
CD3DX12_RESOURCE_DESC::Buffer(BufferSize);
const D3D12_HEAP_PROPERTIES UploadHeapProps =
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect that swapping the order of UploadResDesc and UploadHeapProps wasn't particularly intentional? Might be good to swap them back to reduce churn in the PR.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Renaming UploadHeapProp -> UploadHeapProp - I can see why it makes sense, but I'm not sure it really belongs as part of this change. If we are going to change the naming convention then we should also rename ReadBackHeapProp, but then we're churning things even more.

return Err;
}

// Committed upload buffer
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't quite understand the rationale for adding these "Committed XXX buffer" comments.

These will always be committed resources, won't they? And they're used for uploading and reading back data to/from the resource whether it is committed or reserved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I thought it was helpful to write them for me personally. They indeed will always be committed resources, which was counter intuitive to me as I was writing the reserved resources changes, as I assumed everything should be using the CreateReservedResource API.
I can remove them if they're unnecessary, but that was my rationale.

Copy link
Collaborator

@damyanp damyanp left a comment

Choose a reason for hiding this comment

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

LGTM

Couple of comments left open, but they're take-it-or-leave-it.


ID3D12CommandQueue *CommandQueue = IS.Queue.Get();
CommandQueue->UpdateTileMappings(
Buffer.Get(), 1, &StartCoord, &RegionSize, // One region
Copy link
Collaborator

Choose a reason for hiding this comment

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

This comment is confusing. Is it referring to one of the 1 arguments? Is it repeating the comment from line 580 above? Having a comment in the middle of an argument like this is generally avoided in any case.

Suggested change
Buffer.Get(), 1, &StartCoord, &RegionSize, // One region
Buffer.Get(), 1, &StartCoord, &RegionSize,

@bob80905 bob80905 merged commit 6889fab into llvm:main Dec 19, 2025
8 of 12 checks passed
luciechoi pushed a commit to luciechoi/offload-test-suite that referenced this pull request Jan 6, 2026
…Vs (llvm#604)

This PR is the second step in bringing support to testing with partially
mapped and unmapped resources.
It lays out the infrastructure necessary to initialize UAV resources
with only a certain number of tiles mapped. By default, if the UAV is
specified as reserved, a sufficient number of tiles to cover the entire
size of the UAV resource will be mapped, unless otherwise specified.
The `IsReserved` keyword was added to the yaml resource setup, and if
not specified, the resources will be created as committed. The
TilesMapped keyword requires that the IsReserved keyword is set to True.

Addresses llvm#182
Fixes llvm#181
Fixes llvm#623
The last part needed to complete the above issue (182) would be to
implement partial mappings for Buffers, but that will be left to a
separate PR.
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.

Offload Test Suite should allow for committed or reserved resources to be run Add test exercising CheckAccessFullyMapped

3 participants