mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-04 16:24:29 +01:00
[d3d9] UpdateTexture: Handle automatic mip gen properly
This commit is contained in:
parent
119c1ececb
commit
b2f22d5719
@ -793,14 +793,17 @@ namespace dxvk {
|
||||
if (unlikely(srcTexInfo->Desc()->Pool != D3DPOOL_SYSTEMMEM || dstTexInfo->Desc()->Pool != D3DPOOL_DEFAULT))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
if (srcTexInfo->Desc()->MipLevels < dstTexInfo->Desc()->MipLevels)
|
||||
if (unlikely(srcTexInfo->Desc()->MipLevels < dstTexInfo->Desc()->MipLevels && !dstTexInfo->IsAutomaticMip()))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
if (dstTexInfo->Desc()->Format != srcTexInfo->Desc()->Format)
|
||||
if (unlikely(dstTexInfo->Desc()->Format != srcTexInfo->Desc()->Format))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
if (unlikely(srcTexInfo->IsAutomaticMip() && !dstTexInfo->IsAutomaticMip()))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
const Rc<DxvkImage> dstImage = dstTexInfo->GetImage();
|
||||
uint32_t mipLevels = dstTexInfo->Desc()->MipLevels;
|
||||
uint32_t mipLevels = dstTexInfo->IsAutomaticMip() ? 1 : dstTexInfo->Desc()->MipLevels;
|
||||
uint32_t arraySlices = std::min(srcTexInfo->Desc()->ArraySize, dstTexInfo->Desc()->ArraySize);
|
||||
|
||||
uint32_t srcMipOffset = srcTexInfo->Desc()->MipLevels - mipLevels;
|
||||
@ -809,12 +812,6 @@ namespace dxvk {
|
||||
if (srcFirstMipExtent != dstFirstMipExtent)
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
if (unlikely(srcTexInfo->IsAutomaticMip() && !dstTexInfo->IsAutomaticMip()))
|
||||
return D3DERR_INVALIDCALL;
|
||||
|
||||
if (dstTexInfo->IsAutomaticMip())
|
||||
mipLevels = 1;
|
||||
|
||||
for (uint32_t a = 0; a < arraySlices; a++) {
|
||||
const D3DBOX& box = srcTexInfo->GetDirtyBox(a);
|
||||
if (box.Left >= box.Right || box.Top >= box.Bottom || box.Front >= box.Back)
|
||||
|
Loading…
Reference in New Issue
Block a user