Bug 1966082 - Use keyed mutex instead of ID3D11Fence in CanvasTranslator when remote canvas is enabled r=gfx-reviewers,lsalzman
Reverted as to use keyed mutex as before. Differential Revision: https://phabricator.services.mozilla.com/D249216
This commit is contained in:
committed by
sikeda.birchill@mozilla.com
parent
06ff856805
commit
0940d4ba61
@@ -97,6 +97,9 @@ enum TextureAllocationFlags {
|
|||||||
|
|
||||||
// Force allocation of remote/recorded texture, or fail if not possible.
|
// Force allocation of remote/recorded texture, or fail if not possible.
|
||||||
ALLOC_FORCE_REMOTE = 1 << 9,
|
ALLOC_FORCE_REMOTE = 1 << 9,
|
||||||
|
|
||||||
|
// Prefer to use keyed mutex than D3D11Fence on Windows
|
||||||
|
USE_D3D11_KEYED_MUTEX = 1 << 10,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class BackendSelector { Content, Canvas };
|
enum class BackendSelector { Content, Canvas };
|
||||||
|
|||||||
@@ -557,8 +557,10 @@ D3D11TextureData* D3D11TextureData::Create(IntSize aSize, SurfaceFormat aFormat,
|
|||||||
if (!NS_IsMainThread()) {
|
if (!NS_IsMainThread()) {
|
||||||
// On the main thread we use the syncobject to handle synchronization.
|
// On the main thread we use the syncobject to handle synchronization.
|
||||||
if (!(aFlags & ALLOC_MANUAL_SYNCHRONIZATION)) {
|
if (!(aFlags & ALLOC_MANUAL_SYNCHRONIZATION)) {
|
||||||
|
if (!(aFlags & USE_D3D11_KEYED_MUTEX)) {
|
||||||
auto* fencesHolderMap = CompositeProcessD3D11FencesHolderMap::Get();
|
auto* fencesHolderMap = CompositeProcessD3D11FencesHolderMap::Get();
|
||||||
useFence = fencesHolderMap && FenceD3D11::IsSupported(device);
|
useFence = fencesHolderMap && FenceD3D11::IsSupported(device);
|
||||||
|
}
|
||||||
if (!useFence) {
|
if (!useFence) {
|
||||||
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_NTHANDLE |
|
newDesc.MiscFlags = D3D11_RESOURCE_MISC_SHARED_NTHANDLE |
|
||||||
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
|
D3D11_RESOURCE_MISC_SHARED_KEYEDMUTEX;
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ UniquePtr<TextureData> CanvasTranslator::CreateTextureData(
|
|||||||
switch (mTextureType) {
|
switch (mTextureType) {
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
case TextureType::D3D11: {
|
case TextureType::D3D11: {
|
||||||
|
// Prefer keyed mutex than D3D11Fence if remote canvas is enabled. See Bug
|
||||||
|
// 1966082
|
||||||
|
if (gfx::gfxVars::RemoteCanvasEnabled()) {
|
||||||
|
allocFlags =
|
||||||
|
(TextureAllocationFlags)(allocFlags | USE_D3D11_KEYED_MUTEX);
|
||||||
|
}
|
||||||
textureData =
|
textureData =
|
||||||
D3D11TextureData::Create(aSize, aFormat, allocFlags, mDevice);
|
D3D11TextureData::Create(aSize, aFormat, allocFlags, mDevice);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user