mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-09-17 02:32:04 +00:00
Fix D3D multi-layer texture fallback upload alignment
This commit is contained in:
@@ -6044,7 +6044,11 @@ static void D3D12_UploadToTexture(
|
||||
needsPlacementCopy = source->offset % D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT != 0;
|
||||
}
|
||||
|
||||
alignedBytesPerSlice = alignedRowPitch * destination->h;
|
||||
alignedBytesPerSlice = alignedRowPitch * blockHeight;
|
||||
if (!renderer->UnrestrictedBufferTextureCopyPitchSupported && destination->d > 1 && alignedBytesPerSlice % D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT != 0) {
|
||||
needsRealignment = true;
|
||||
alignedBytesPerSlice = D3D12_INTERNAL_Align(alignedBytesPerSlice, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
|
||||
}
|
||||
|
||||
sourceLocation.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
|
||||
sourceLocation.PlacedFootprint.Footprint.Format = SDLToD3D12_TextureFormat[textureContainer->header.info.format];
|
||||
@@ -6058,7 +6062,7 @@ static void D3D12_UploadToTexture(
|
||||
temporaryBuffer = D3D12_INTERNAL_CreateBuffer(
|
||||
d3d12CommandBuffer->renderer,
|
||||
0,
|
||||
alignedRowPitch * blockHeight * destination->d,
|
||||
alignedBytesPerSlice * destination->d,
|
||||
D3D12_BUFFER_TYPE_UPLOAD,
|
||||
NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user