Skip to content

Commit

Permalink
HL_XBS: dx12 minor workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxiaomao committed Sep 11, 2023
1 parent ff91dcc commit d858b13
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions libs/directx/dx12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,16 +579,20 @@ void HL_NAME(resource_unmap)( ID3D12Resource *res, int subres, D3D12_RANGE *rang
int64 HL_NAME(get_required_intermediate_size)( ID3D12Resource *res, int first, int count ) {
auto desc = res->GetDesc();
UINT64 size = 0;
#ifndef HL_XBS
static_driver->device->GetCopyableFootprints(&desc, first, count, 0, NULL, NULL, NULL, &size);
#ifdef HL_XBS
#else
D3D12_PLACED_SUBRESOURCE_FOOTPRINT pLayouts;
static_driver->device->GetCopyableFootprints(&desc, first, 1, 0, &pLayouts, NULL, NULL, NULL);
static_driver->device->GetCopyableFootprints(&desc, first + count - 1, 1, 0, &pLayouts, NULL, NULL, &size);
size += pLayouts.Offset;
#endif
return size;
}

bool HL_NAME(update_sub_resource)( ID3D12GraphicsCommandList *cmd, ID3D12Resource *res, ID3D12Resource *tmp, int64 tmpOffs, int first, int count, D3D12_SUBRESOURCE_DATA *data ) {
#ifdef HL_XBS
tmpOffs = 0;
#endif
return UpdateSubresources(cmd,res,tmp,(UINT64)tmpOffs,(UINT)first,(UINT)count,data) != 0;
}

Expand Down

0 comments on commit d858b13

Please sign in to comment.