gpu: Warn about Direct3D 12 texture alignment requirements.

Fixes #12835.
This commit is contained in:
Ryan C. Gordon
2025-04-25 14:19:04 -04:00
parent 2e45198299
commit faa2e40406
2 changed files with 16 additions and 1 deletions

View File

@@ -5934,6 +5934,10 @@ static void D3D12_UploadToTexture(
D3D12_INTERNAL_ReleaseBuffer(
d3d12CommandBuffer->renderer,
temporaryBuffer);
if (d3d12CommandBuffer->renderer->debug_mode) {
SDL_LogWarn(SDL_LOG_CATEGORY_GPU, "Texture upload row pitch not aligned to 256 bytes! This is suboptimal on D3D12!");
}
} else if (needsPlacementCopy) {
temporaryBuffer = D3D12_INTERNAL_CreateBuffer(
d3d12CommandBuffer->renderer,
@@ -5971,7 +5975,9 @@ static void D3D12_UploadToTexture(
d3d12CommandBuffer->renderer,
temporaryBuffer);
SDL_LogWarn(SDL_LOG_CATEGORY_GPU, "Texture upload offset not aligned to 512 bytes! This is suboptimal on D3D12!");
if (d3d12CommandBuffer->renderer->debug_mode) {
SDL_LogWarn(SDL_LOG_CATEGORY_GPU, "Texture upload offset not aligned to 512 bytes! This is suboptimal on D3D12!");
}
} else {
sourceLocation.pResource = transferBufferContainer->activeBuffer->handle;
sourceLocation.PlacedFootprint.Offset = source->offset;
@@ -6242,6 +6248,9 @@ static void D3D12_DownloadFromTexture(
destinationLocation.pResource = textureDownload->temporaryBuffer->handle;
destinationLocation.PlacedFootprint.Offset = 0;
if (d3d12CommandBuffer->renderer->debug_mode) {
SDL_LogWarn(SDL_LOG_CATEGORY_GPU, "Texture pitch or offset not aligned properly! This is suboptimal on D3D12!");
}
} else {
destinationLocation.pResource = destinationBuffer->handle;
destinationLocation.PlacedFootprint.Offset = destination->offset;