mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 17:05:31 +00:00
OpenGL: use vendor name to get PCI vendor id
OpenGL doesn't allow to query PCI information, but we can get vendor name through glGetString(GL_VENDOR), then match it with vendor id. BUG=dawn:184 Change-Id: Icdcdc6bfdb5cd561b5057e8b2eab06df2dd5cea1 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/8940 Reviewed-by: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Hao Li <hao.x.li@intel.com>
This commit is contained in:
committed by
Commit Bot service account
parent
5580970f59
commit
1ffb0d6a02
@@ -114,7 +114,7 @@ DawnTestEnvironment::DawnTestEnvironment(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strstr(argv[i], "--adapter-vendor-id") != 0) {
|
||||
if (strstr(argv[i], "--adapter-vendor-id") != nullptr) {
|
||||
const char* value = strchr(argv[i], '=');
|
||||
if (value != nullptr) {
|
||||
mVendorIdFilter = strtoul(value + 1, nullptr, 16);
|
||||
@@ -343,9 +343,7 @@ void DawnTest::SetUp() {
|
||||
|
||||
for (const dawn_native::Adapter& adapter : adapters) {
|
||||
if (adapter.GetBackendType() == backendType) {
|
||||
// TODO(hao.x.li@intel.com): Filter adapter for OpenGL backend once
|
||||
// https://bugs.chromium.org/p/dawn/issues/detail?id=184 is resolved.
|
||||
if (HasVendorIdFilter() && backendType != dawn_native::BackendType::OpenGL) {
|
||||
if (HasVendorIdFilter()) {
|
||||
if (adapter.GetPCIInfo().vendorId == GetVendorIdFilter()) {
|
||||
backendAdapter = adapter;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user