Temporarily Disable Use of D3D12 Render Pass API

Due to significant performance regressions on Intel Gen11 Graphics,
temporarily disable use of the D3D12 Render Pass API until a workaround
infrastructure can be implemented.

Bug: dawn:310
Change-Id: I994a2c2a0f6a3b61c48b083c73d6e0d3f8910dfa
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14663
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
This commit is contained in:
Brandon Jones 2020-01-07 17:49:15 +00:00 committed by Commit Bot service account
parent 5ccecaade2
commit d1cba106c8
9 changed files with 108 additions and 32 deletions

View File

@ -105,6 +105,8 @@ if (is_win || is_linux || is_mac || is_fuchsia || is_android) {
"Constants.h",
"DynamicLib.cpp",
"DynamicLib.h",
"GPUInfo.cpp",
"GPUInfo.h",
"HashUtils.h",
"Log.cpp",
"Log.h",

View File

@ -51,13 +51,6 @@ static constexpr uint64_t kDrawIndexedIndirectSize = 5 * sizeof(uint32_t);
static constexpr float kLodMin = 0.0;
static constexpr float kLodMax = 1000.0;
static constexpr uint32_t kVendorID_AMD = 0x1002;
static constexpr uint32_t kVendorID_ARM = 0x13B5;
static constexpr uint32_t kVendorID_ImgTec = 0x1010;
static constexpr uint32_t kVendorID_Intel = 0x8086;
static constexpr uint32_t kVendorID_Nvidia = 0x10DE;
static constexpr uint32_t kVendorID_Qualcomm = 0x5143;
// Max texture size constants
static constexpr uint32_t kMaxTextureSize = 8192u;
static constexpr uint32_t kMaxTexture2DArrayLayers = 256u;

36
src/common/GPUInfo.cpp Normal file
View File

@ -0,0 +1,36 @@
// Copyright 2019 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include "common/GPUInfo.h"
namespace gpu_info {
bool IsAMD(PCIVendorID vendorId) {
return vendorId == kVendorID_AMD;
}
bool IsARM(PCIVendorID vendorId) {
return vendorId == kVendorID_ARM;
}
bool IsImgTec(PCIVendorID vendorId) {
return vendorId == kVendorID_ImgTec;
}
bool IsIntel(PCIVendorID vendorId) {
return vendorId == kVendorID_Intel;
}
bool IsNvidia(PCIVendorID vendorId) {
return vendorId == kVendorID_Nvidia;
}
bool IsQualcomm(PCIVendorID vendorId) {
return vendorId == kVendorID_Qualcomm;
}
} // namespace gpu_info

39
src/common/GPUInfo.h Normal file
View File

@ -0,0 +1,39 @@
// Copyright 2019 The Dawn Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef COMMON_GPUINFO_H
#define COMMON_GPUINFO_H
#include <cstdint>
using PCIVendorID = uint32_t;
namespace gpu_info {
static constexpr PCIVendorID kVendorID_AMD = 0x1002;
static constexpr PCIVendorID kVendorID_ARM = 0x13B5;
static constexpr PCIVendorID kVendorID_ImgTec = 0x1010;
static constexpr PCIVendorID kVendorID_Intel = 0x8086;
static constexpr PCIVendorID kVendorID_Nvidia = 0x10DE;
static constexpr PCIVendorID kVendorID_Qualcomm = 0x5143;
bool IsAMD(PCIVendorID vendorId);
bool IsARM(PCIVendorID vendorId);
bool IsImgTec(PCIVendorID vendorId);
bool IsIntel(PCIVendorID vendorId);
bool IsNvidia(PCIVendorID vendorId);
bool IsQualcomm(PCIVendorID vendorId);
} // namespace gpu_info
#endif // COMMON_GPUINFO_H

View File

@ -66,14 +66,14 @@ namespace dawn_native { namespace d3d12 {
return DAWN_DEVICE_LOST_ERROR("D3D12CreateDevice failed");
}
DAWN_TRY_ASSIGN(mDeviceInfo, GatherDeviceInfo(*this));
DXGI_ADAPTER_DESC1 adapterDesc;
mHardwareAdapter->GetDesc1(&adapterDesc);
mPCIInfo.deviceId = adapterDesc.DeviceId;
mPCIInfo.vendorId = adapterDesc.VendorId;
DAWN_TRY_ASSIGN(mDeviceInfo, GatherDeviceInfo(*this));
if (adapterDesc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) {
mDeviceType = DeviceType::CPU;
} else {

View File

@ -14,6 +14,7 @@
#include "dawn_native/d3d12/D3D12Info.h"
#include "common/GPUInfo.h"
#include "dawn_native/d3d12/AdapterD3D12.h"
#include "dawn_native/d3d12/BackendD3D12.h"
#include "dawn_native/d3d12/D3D12Error.h"
@ -45,12 +46,17 @@ namespace dawn_native { namespace d3d12 {
// Windows builds 1809 and above can use the D3D12 render pass API. If we query
// CheckFeatureSupport for D3D12_FEATURE_D3D12_OPTIONS5 successfully, then we can use
// the render pass API.
info.supportsRenderPass = false;
D3D12_FEATURE_DATA_D3D12_OPTIONS5 featureOptions5 = {};
if (SUCCEEDED(adapter.GetDevice()->CheckFeatureSupport(
D3D12_FEATURE_D3D12_OPTIONS5, &featureOptions5, sizeof(featureOptions5)))) {
info.supportsRenderPass = true;
} else {
info.supportsRenderPass = false;
// Performance regressions been observed when using a render pass on Intel graphics with
// RENDER_PASS_TIER_1 available, so fall back to a software emulated render pass on
// these platforms.
if (featureOptions5.RenderPassesTier < D3D12_RENDER_PASS_TIER_1 ||
!gpu_info::IsIntel(adapter.GetPCIInfo().vendorId)) {
info.supportsRenderPass = true;
}
}
return info;

View File

@ -14,7 +14,7 @@
#include "dawn_native/metal/BackendMTL.h"
#include "common/Constants.h"
#include "common/GPUInfo.h"
#include "common/Platform.h"
#include "dawn_native/Instance.h"
#include "dawn_native/MetalBackend.h"
@ -39,11 +39,11 @@ namespace dawn_native { namespace metal {
};
#if defined(DAWN_PLATFORM_MACOS)
const Vendor kVendors[] = {{"AMD", kVendorID_AMD},
{"Radeon", kVendorID_AMD},
{"Intel", kVendorID_Intel},
{"Geforce", kVendorID_Nvidia},
{"Quadro", kVendorID_Nvidia}};
const Vendor kVendors[] = {{"AMD", gpu_info::kVendorID_AMD},
{"Radeon", gpu_info::kVendorID_AMD},
{"Intel", gpu_info::kVendorID_Intel},
{"Geforce", gpu_info::kVendorID_Nvidia},
{"Quadro", gpu_info::kVendorID_Nvidia}};
// Find vendor ID from MTLDevice name.
MaybeError GetVendorIdFromVendors(id<MTLDevice> device, PCIIDs* ids) {

View File

@ -14,7 +14,7 @@
#include "dawn_native/opengl/BackendGL.h"
#include "common/Constants.h"
#include "common/GPUInfo.h"
#include "common/Log.h"
#include "dawn_native/Instance.h"
#include "dawn_native/OpenGLBackend.h"
@ -31,12 +31,12 @@ namespace dawn_native { namespace opengl {
uint32_t vendorId;
};
const Vendor kVendors[] = {{"ATI", kVendorID_AMD},
{"ARM", kVendorID_ARM},
{"Imagination", kVendorID_ImgTec},
{"Intel", kVendorID_Intel},
{"NVIDIA", kVendorID_Nvidia},
{"Qualcomm", kVendorID_Qualcomm}};
const Vendor kVendors[] = {{"ATI", gpu_info::kVendorID_AMD},
{"ARM", gpu_info::kVendorID_ARM},
{"Imagination", gpu_info::kVendorID_ImgTec},
{"Intel", gpu_info::kVendorID_Intel},
{"NVIDIA", gpu_info::kVendorID_Nvidia},
{"Qualcomm", gpu_info::kVendorID_Qualcomm}};
uint32_t GetVendorIdFromVendors(const char* vendor) {
uint32_t vendorId = 0;

View File

@ -15,7 +15,7 @@
#include "tests/DawnTest.h"
#include "common/Assert.h"
#include "common/Constants.h"
#include "common/GPUInfo.h"
#include "common/Log.h"
#include "common/Math.h"
#include "common/Platform.h"
@ -362,27 +362,27 @@ bool DawnTestBase::IsVulkan() const {
}
bool DawnTestBase::IsAMD() const {
return mPCIInfo.vendorId == kVendorID_AMD;
return gpu_info::IsAMD(mPCIInfo.vendorId);
}
bool DawnTestBase::IsARM() const {
return mPCIInfo.vendorId == kVendorID_ARM;
return gpu_info::IsARM(mPCIInfo.vendorId);
}
bool DawnTestBase::IsImgTec() const {
return mPCIInfo.vendorId == kVendorID_ImgTec;
return gpu_info::IsImgTec(mPCIInfo.vendorId);
}
bool DawnTestBase::IsIntel() const {
return mPCIInfo.vendorId == kVendorID_Intel;
return gpu_info::IsIntel(mPCIInfo.vendorId);
}
bool DawnTestBase::IsNvidia() const {
return mPCIInfo.vendorId == kVendorID_Nvidia;
return gpu_info::IsNvidia(mPCIInfo.vendorId);
}
bool DawnTestBase::IsQualcomm() const {
return mPCIInfo.vendorId == kVendorID_Qualcomm;
return gpu_info::IsQualcomm(mPCIInfo.vendorId);
}
bool DawnTestBase::IsWindows() const {