Collect GPU device information for end2end tests - Part I

This patch is the first one to support inspecting GPU information for
dawn_end2end_tests.

In this patch, we support collecting the device name, device id and
vendor id on D3D12 and Vulkan. We also support collecting the device
name on OpenGL. The collection on Metal will be supported in the next
patch. Using this information we implement a series of APIs to inspect
the information of both OS and GPU vendor.

We also skip two failed tests on Windows Intel Vulkan backends.

BUG=dawn:10

Change-Id: If52a960c0bae3922a0b5650500218eff1400d77a
Reviewed-on: https://dawn-review.googlesource.com/1460
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Jiawei Shao
2018-09-19 00:32:52 +00:00
committed by Commit Bot service account
parent cd5e5756fd
commit 58809d413b
17 changed files with 177 additions and 0 deletions

View File

@@ -46,6 +46,10 @@ namespace dawn_native { namespace opengl {
// Device
Device::Device() {
CollectPCIInfo();
}
BindGroupBase* Device::CreateBindGroup(BindGroupBuilder* builder) {
return new BindGroup(builder);
}
@@ -109,4 +113,12 @@ namespace dawn_native { namespace opengl {
void Device::TickImpl() {
}
const dawn_native::PCIInfo& Device::GetPCIInfo() const {
return mPCIInfo;
}
void Device::CollectPCIInfo() {
mPCIInfo.name = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
}
}} // namespace dawn_native::opengl

View File

@@ -32,6 +32,7 @@ namespace dawn_native { namespace opengl {
class Device : public DeviceBase {
public:
Device();
BindGroupBase* CreateBindGroup(BindGroupBuilder* builder) override;
BlendStateBase* CreateBlendState(BlendStateBuilder* builder) override;
BufferViewBase* CreateBufferView(BufferViewBuilder* builder) override;
@@ -46,6 +47,8 @@ namespace dawn_native { namespace opengl {
void TickImpl() override;
const dawn_native::PCIInfo& GetPCIInfo() const override;
private:
ResultOrError<BindGroupLayoutBase*> CreateBindGroupLayoutImpl(
const BindGroupLayoutDescriptor* descriptor) override;
@@ -59,6 +62,9 @@ namespace dawn_native { namespace opengl {
ResultOrError<ShaderModuleBase*> CreateShaderModuleImpl(
const ShaderModuleDescriptor* descriptor) override;
ResultOrError<TextureBase*> CreateTextureImpl(const TextureDescriptor* descriptor) override;
void CollectPCIInfo();
dawn_native::PCIInfo mPCIInfo;
};
}} // namespace dawn_native::opengl