Bug 1677211 - Add Read access flags to D3D11 staging textures to avoid slow accesses when reading our intermediate results. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D97106
This commit is contained in:
Matt Woodrow 2020-11-16 03:21:52 +00:00
Родитель 6fa12333a5
Коммит 7edd8e0527
1 изменённых файлов: 4 добавлений и 3 удалений

Просмотреть файл

@ -225,8 +225,9 @@ bool RenderCompositorD3D11SWGL::MapTile(wr::NativeTileId aId,
mCompositor->GetDevice()->GetImmediateContext(getter_AddRefs(context));
D3D11_MAPPED_SUBRESOURCE mappedSubresource;
DebugOnly<HRESULT> hr = context->Map(mCurrentTile.mStagingTexture, 0,
D3D11_MAP_WRITE, 0, &mappedSubresource);
DebugOnly<HRESULT> hr =
context->Map(mCurrentTile.mStagingTexture, 0, D3D11_MAP_READ_WRITE, 0,
&mappedSubresource);
MOZ_ASSERT(SUCCEEDED(hr));
// aData is expected to contain a pointer to the first pixel within the valid
@ -309,7 +310,7 @@ void RenderCompositorD3D11SWGL::CreateTile(wr::NativeSurfaceId aId, int32_t aX,
// add an extra row instead.
desc.Height += 1;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE | D3D11_CPU_ACCESS_READ;
desc.Usage = D3D11_USAGE_STAGING;
desc.BindFlags = 0;