1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-20 10:54:16 +01:00

[d3d9] Fix pitch when copying straight from mapping buffer

This commit is contained in:
Robin Kertels 2021-07-17 14:50:45 +02:00 committed by Joshie
parent 34101dcf26
commit 584e1515b1

View File

@ -4364,12 +4364,12 @@ namespace dxvk {
+ boxOffsetBlockCount.y * texLevelExtentBlockCount.width
+ boxOffsetBlockCount.x)
* formatInfo->elementSize;
VkDeviceSize pitch = align(texLevelExtentBlockCount.width * formatInfo->elementSize, 4);
VkDeviceSize rowAlignment = 0;
DxvkBufferSlice copySrcSlice;
if (pResource->DoesStagingBufferUploads(Subresource)) {
VkDeviceSize dirtySize = scaledBoxExtentBlockCount.width * scaledBoxExtentBlockCount.height * scaledBoxExtentBlockCount.depth * formatInfo->elementSize;
VkDeviceSize pitch = align(texLevelExtentBlockCount.width * formatInfo->elementSize, 4);
D3D9BufferSlice slice = AllocTempBuffer<false>(dirtySize);
copySrcSlice = slice.slice;
void* srcData = reinterpret_cast<uint8_t*>(srcSlice.mapPtr) + copySrcOffset;
@ -4378,7 +4378,7 @@ namespace dxvk {
pitch, pitch * texLevelExtentBlockCount.height);
} else {
copySrcSlice = DxvkBufferSlice(pResource->GetBuffer(Subresource), copySrcOffset, srcSlice.length);
rowAlignment = 4;
rowAlignment = pitch; // row alignment can act as the pitch parameter
}
EmitCs([