Skip to content
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

Disambiguate UpdateTileMappings function usage #802

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -463,12 +463,11 @@ void D3D12ReservedResources::UpdateTileMapping()

// Update the tile mappings on the reserved resource.
{
UINT updatedRegions = 0;
std::vector<D3D12_TILED_RESOURCE_COORDINATE> startCoordinates;
std::vector<D3D12_TILE_REGION_SIZE> regionSizes;
std::vector<D3D12_TILE_RANGE_FLAGS> rangeFlags;
std::vector<UINT> heapRangeStartOffsets;
std::vector<UINT> rangeTileCounts;
D3D12_TILED_RESOURCE_COORDINATE startCoordinates;
D3D12_TILE_REGION_SIZE regionSizes;
D3D12_TILE_RANGE_FLAGS rangeFlags;
UINT heapRangeStartOffsets;
UINT rangeTileCounts;

for (UINT n = 0; n < m_heaps.size(); n++)
{
Expand All @@ -478,41 +477,39 @@ void D3D12ReservedResources::UpdateTileMapping()
continue;
}

startCoordinates.push_back(m_mips[n].startCoordinate);
regionSizes.push_back(m_mips[n].regionSize);
startCoordinates = m_mips[n].startCoordinate;
regionSizes = m_mips[n].regionSize;

if (n == firstSubresource)
{
// Map the currently active mip.
rangeFlags.push_back(D3D12_TILE_RANGE_FLAG_NONE);
rangeFlags = D3D12_TILE_RANGE_FLAG_NONE;
m_mips[n].mapped = true;
}
else
{
// Unmap the previously active mip.
assert(m_mips[n].mapped);

rangeFlags.push_back(D3D12_TILE_RANGE_FLAG_NULL);
rangeFlags = D3D12_TILE_RANGE_FLAG_NULL;
m_mips[n].mapped = false;
}
heapRangeStartOffsets.push_back(0); // In this sample, each heap contains only one tile region.
rangeTileCounts.push_back(m_mips[n].regionSize.NumTiles);

updatedRegions++;
}

m_commandQueue->UpdateTileMappings(
m_reservedResource.Get(),
updatedRegions,
&startCoordinates[0],
&regionSizes[0],
m_heaps[firstSubresource].Get(),
updatedRegions,
&rangeFlags[0],
&heapRangeStartOffsets[0],
&rangeTileCounts[0],
D3D12_TILE_MAPPING_FLAG_NONE
heapRangeStartOffsets = 0; // In this sample, each heap contains only one tile region.
rangeTileCounts = m_mips[n].regionSize.NumTiles;

m_commandQueue->UpdateTileMappings(
m_reservedResource.Get(),
1,
&startCoordinates,
&regionSizes,
m_heaps[n].Get(),
1,
&rangeFlags,
&heapRangeStartOffsets,
&rangeTileCounts,
D3D12_TILE_MAPPING_FLAG_NONE
);
}
}

// Upload the mip(s) to the GPU and copy them to the reserved resource.
Expand Down