mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-04-25 08:06:30 +00:00
[idd] driver: fix hardcoded pitch values
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
Some checks failed
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Has been cancelled
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Has been cancelled
build / module (push) Has been cancelled
build / host-linux (push) Has been cancelled
build / host-windows-cross (push) Has been cancelled
build / host-windows-native (push) Has been cancelled
build / obs (clang) (push) Has been cancelled
build / obs (gcc) (push) Has been cancelled
build / docs (push) Has been cancelled
This commit is contained in:
parent
be4782b062
commit
4e951184f1
@ -203,17 +203,29 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
|
|||||||
//FIXME: handle dirty rects
|
//FIXME: handle dirty rects
|
||||||
srcRes->SetFullDamage();
|
srcRes->SetFullDamage();
|
||||||
|
|
||||||
|
D3D12_RESOURCE_DESC desc = srcRes->GetRes()->GetDesc();
|
||||||
|
D3D12_PLACED_SUBRESOURCE_FOOTPRINT layout;
|
||||||
|
m_dx12Device->GetDevice()->GetCopyableFootprints(
|
||||||
|
&desc,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
&layout,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
auto buffer = m_devContext->PrepareFrameBuffer(
|
auto buffer = m_devContext->PrepareFrameBuffer(
|
||||||
srcRes->GetFormat().Width,
|
(int)desc.Width,
|
||||||
srcRes->GetFormat().Height,
|
(int)desc.Height,
|
||||||
srcRes->GetFormat().Width * 4,
|
(int)layout.Footprint.RowPitch,
|
||||||
srcRes->GetFormat().Format);
|
desc.Format);
|
||||||
|
|
||||||
if (!buffer.mem)
|
if (!buffer.mem)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CFrameBufferResource * fbRes = m_fbPool.Get(buffer,
|
CFrameBufferResource * fbRes = m_fbPool.Get(buffer,
|
||||||
((size_t)srcRes->GetFormat().Width * 4) * srcRes->GetFormat().Height);
|
(size_t)layout.Footprint.RowPitch * desc.Height);
|
||||||
|
|
||||||
if (!fbRes)
|
if (!fbRes)
|
||||||
{
|
{
|
||||||
@ -239,11 +251,11 @@ bool CSwapChainProcessor::SwapChainNewFrame(ComPtr<IDXGIResource> acquiredBuffer
|
|||||||
dstLoc.pResource = fbRes->Get().Get();
|
dstLoc.pResource = fbRes->Get().Get();
|
||||||
dstLoc.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
|
dstLoc.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
|
||||||
dstLoc.PlacedFootprint.Offset = 0;
|
dstLoc.PlacedFootprint.Offset = 0;
|
||||||
dstLoc.PlacedFootprint.Footprint.Format = srcRes->GetFormat().Format;
|
dstLoc.PlacedFootprint.Footprint.Format = desc.Format;
|
||||||
dstLoc.PlacedFootprint.Footprint.Width = srcRes->GetFormat().Width;
|
dstLoc.PlacedFootprint.Footprint.Width = (UINT)desc.Width;
|
||||||
dstLoc.PlacedFootprint.Footprint.Height = srcRes->GetFormat().Height;
|
dstLoc.PlacedFootprint.Footprint.Height = (UINT)desc.Height;
|
||||||
dstLoc.PlacedFootprint.Footprint.Depth = 1;
|
dstLoc.PlacedFootprint.Footprint.Depth = 1;
|
||||||
dstLoc.PlacedFootprint.Footprint.RowPitch = srcRes->GetFormat().Width * 4; //FIXME
|
dstLoc.PlacedFootprint.Footprint.RowPitch = layout.Footprint.RowPitch;
|
||||||
|
|
||||||
srcRes->Sync(*copyQueue);
|
srcRes->Sync(*copyQueue);
|
||||||
copyQueue->GetGfxList()->CopyTextureRegion(
|
copyQueue->GetGfxList()->CopyTextureRegion(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user