mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-08-12 06:59:21 +00:00
This patch disables the workaround about the T2T copy issue (the Toggle UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel) on the latest Intel Gen9 and Gen9.5 D3D driver (27.20.100.9466) which contains the fix for this issue. This patch also implements the D3D driver version comparison algorithm for Intel drivers. BUG=chromium:1161355 TEST=dawn_end2end_tests Change-Id: I406598f2c5745214a60bfc43fb732d45360aa1fe Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/51343 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
65 lines
2.4 KiB
C++
65 lines
2.4 KiB
C++
// 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 <array>
|
|
#include <cstdint>
|
|
|
|
using PCIVendorID = uint32_t;
|
|
using PCIDeviceID = 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;
|
|
static constexpr PCIVendorID kVendorID_Google = 0x1AE0;
|
|
static constexpr PCIVendorID kVendorID_Microsoft = 0x1414;
|
|
|
|
static constexpr PCIDeviceID kDeviceID_Swiftshader = 0xC0DE;
|
|
static constexpr PCIDeviceID kDeviceID_WARP = 0x8c;
|
|
|
|
bool IsAMD(PCIVendorID vendorId);
|
|
bool IsARM(PCIVendorID vendorId);
|
|
bool IsImgTec(PCIVendorID vendorId);
|
|
bool IsIntel(PCIVendorID vendorId);
|
|
bool IsNvidia(PCIVendorID vendorId);
|
|
bool IsQualcomm(PCIVendorID vendorId);
|
|
bool IsSwiftshader(PCIVendorID vendorId, PCIDeviceID deviceId);
|
|
bool IsWARP(PCIVendorID vendorId, PCIDeviceID deviceId);
|
|
|
|
using D3DDriverVersion = std::array<uint16_t, 4>;
|
|
|
|
// Do comparison between two driver versions. Currently we only support the comparison between
|
|
// Intel D3D driver versions.
|
|
// - Return a negative value if version1 is older
|
|
// - Return a positive value if version1 is newer
|
|
// - Return 0 if version1 and version2 represent same driver version
|
|
int CompareD3DDriverVersion(PCIVendorID vendorId,
|
|
const D3DDriverVersion& version1,
|
|
const D3DDriverVersion& version2);
|
|
|
|
// Intel architectures
|
|
bool IsSkylake(PCIDeviceID deviceId);
|
|
bool IsKabylake(PCIDeviceID deviceId);
|
|
bool IsCoffeelake(PCIDeviceID deviceId);
|
|
|
|
} // namespace gpu_info
|
|
#endif // COMMON_GPUINFO_H
|