Skip to content

Commit

Permalink
Bug 1677211 - Add Read access flags to D3D11 staging textures to avoi…
Browse files Browse the repository at this point in the history
…d slow accesses when reading our intermediate results. r=jrmuizel

Differential Revision: https://phabricator.services.mozilla.com/D97106
  • Loading branch information
mattwoodrow committed Nov 16, 2020
1 parent facd2e4 commit 5583f50
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions gfx/webrender_bindings/RenderCompositorD3D11SWGL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 5583f50

Please sign in to comment.