mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 16:31:28 +12: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);
|
Texture->Unmap(0, nullptr);
|
||||||
|
|
||||||
size_t powerOf2Height = (size_t)log2f((float)heightInBlocks) + 1;
|
D3D12_RESOURCE_DESC texturedesc = getTexture2DResourceDesc(w, h, dxgiFormat, texture.GetMipmap());
|
||||||
textureSize = rowPitch * (1i64 << powerOf2Height);
|
textureSize = device->GetResourceAllocationInfo(0, 1, &texturedesc).SizeInBytes;
|
||||||
|
|
||||||
assert(textureHeap.canAlloc(textureSize));
|
assert(textureHeap.canAlloc(textureSize));
|
||||||
size_t heapOffset2 = textureHeap.alloc(textureSize);
|
size_t heapOffset2 = textureHeap.alloc(textureSize);
|
||||||
|
@ -558,7 +558,7 @@ ID3D12Resource *uploadSingleTexture(
|
||||||
check(device->CreatePlacedResource(
|
check(device->CreatePlacedResource(
|
||||||
textureHeap.m_heap,
|
textureHeap.m_heap,
|
||||||
heapOffset2,
|
heapOffset2,
|
||||||
&getTexture2DResourceDesc(w, h, dxgiFormat, texture.GetMipmap()),
|
&texturedesc,
|
||||||
D3D12_RESOURCE_STATE_COPY_DEST,
|
D3D12_RESOURCE_STATE_COPY_DEST,
|
||||||
nullptr,
|
nullptr,
|
||||||
IID_PPV_ARGS(&vramTexture)
|
IID_PPV_ARGS(&vramTexture)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue