mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-21 03:55:32 +00:00
d3d12: Do not guess texture size but use actual value
This commit is contained in:
parent
628acbf0b4
commit
ad3e50f90f
1 changed files with 3 additions and 3 deletions
|
@ -549,8 +549,8 @@ ID3D12Resource *uploadSingleTexture(
|
|||
}
|
||||
Texture->Unmap(0, nullptr);
|
||||
|
||||
size_t powerOf2Height = (size_t)log2f((float)heightInBlocks) + 1;
|
||||
textureSize = rowPitch * (1i64 << powerOf2Height);
|
||||
D3D12_RESOURCE_DESC texturedesc = getTexture2DResourceDesc(w, h, dxgiFormat, texture.GetMipmap());
|
||||
textureSize = device->GetResourceAllocationInfo(0, 1, &texturedesc).SizeInBytes;
|
||||
|
||||
assert(textureHeap.canAlloc(textureSize));
|
||||
size_t heapOffset2 = textureHeap.alloc(textureSize);
|
||||
|
@ -558,7 +558,7 @@ ID3D12Resource *uploadSingleTexture(
|
|||
check(device->CreatePlacedResource(
|
||||
textureHeap.m_heap,
|
||||
heapOffset2,
|
||||
&getTexture2DResourceDesc(w, h, dxgiFormat, texture.GetMipmap()),
|
||||
&texturedesc,
|
||||
D3D12_RESOURCE_STATE_COPY_DEST,
|
||||
nullptr,
|
||||
IID_PPV_ARGS(&vramTexture)
|
||||
|
|
Loading…
Add table
Reference in a new issue