Emulate store and multisample resolve on Metal

This patch implements "store and MSAA resolve" store operation on Metal
drivers that don't support MTLStoreActionStoreAndMultisampleResolve with
a workaround that does MSAA resolve in another render pass.

Driver workaround is one type of Dawn Toggles. Dawn Toggles will include
other optional optimizations and features that can be configured to use
or not when we create Dawn Devices.

As all Metal try bots don't need this toggle, to better test this
patch on the try bots:
1. We add the support of forcing enabling a workaround when starting an
   Dawn end2end test so that we can test the workaround on the platforms
   where the workaround is disabled.
2. We add an optional parameter DeviceDescriptor to CreateDevice() so
   that we can custom the toggles the Dawn device should use.

This patch also adds the support of querying toggle details from Instance
and the names of the toggles in use from Device. These APIs are tested in
the Dawn unittests added in this patch.

BUG=dawn:56
TEST=dawn_end2end_tests
TEST=dawn_unittests

Change-Id: Iae31d2ded6057eee638b6099d3061e9d78b04d55
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/6620
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Jiawei Shao <jiawei.shao@intel.com>
This commit is contained in:
Jiawei Shao
2019-04-26 07:52:57 +00:00
committed by Commit Bot service account
parent 8e97b4c8a5
commit 15d4c2e63b
34 changed files with 505 additions and 97 deletions

View File

@@ -39,10 +39,10 @@ namespace dawn_native { namespace opengl {
virtual ~Adapter() = default;
private:
ResultOrError<DeviceBase*> CreateDeviceImpl() override {
ResultOrError<DeviceBase*> CreateDeviceImpl(const DeviceDescriptor* descriptor) override {
// There is no limit on the number of devices created from this adapter because they can
// all share the same backing OpenGL context.
return {new Device(this)};
return {new Device(this, descriptor)};
}
};

View File

@@ -31,7 +31,8 @@
namespace dawn_native { namespace opengl {
Device::Device(AdapterBase* adapter) : DeviceBase(adapter) {
Device::Device(AdapterBase* adapter, const DeviceDescriptor* descriptor)
: DeviceBase(adapter, descriptor) {
}
Device::~Device() {

View File

@@ -34,7 +34,7 @@ namespace dawn_native { namespace opengl {
class Device : public DeviceBase {
public:
Device(AdapterBase* adapter);
Device(AdapterBase* adapter, const DeviceDescriptor* descriptor);
~Device();
void SubmitFenceSync();