mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-04-13 05:43:18 -07:00
vkd3d: Return correctly aligned depth/stencil sizes from GetCopyableFootprints().
This commit is contained in:
committed by
Henri Verbeet
parent
1a4dedbc8d
commit
e99906f05d
Notes:
Henri Verbeet
2025-01-20 16:18:31 +01:00
Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/899
@@ -4749,7 +4749,8 @@ static void d3d12_device_get_copyable_footprints(struct d3d12_device *device,
|
||||
depth = d3d12_resource_desc_get_depth(desc, miplevel_idx);
|
||||
row_count = height / format->block_height;
|
||||
row_size = (width / format->block_width) * format->byte_count * format->block_byte_count;
|
||||
row_pitch = align(row_size, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT);
|
||||
/* Direct3D 12 requires double the alignment for dual planes. */
|
||||
row_pitch = align(row_size, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT * plane_count);
|
||||
|
||||
if (layouts)
|
||||
{
|
||||
@@ -4766,7 +4767,7 @@ static void d3d12_device_get_copyable_footprints(struct d3d12_device *device,
|
||||
row_sizes[i] = row_size;
|
||||
|
||||
size = max(0, row_count - 1) * row_pitch + row_size;
|
||||
size = max(0, depth - 1) * align(size, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT) + size;
|
||||
size = max(0, depth - 1) * align(size, D3D12_TEXTURE_DATA_PITCH_ALIGNMENT * plane_count) + size;
|
||||
|
||||
total = offset + size;
|
||||
offset = align(total, D3D12_TEXTURE_DATA_PLACEMENT_ALIGNMENT);
|
||||
|
Reference in New Issue
Block a user