Use SubstituteOverride transform to implement overrides

Remove the old backend specific implementation for
overrides. Use tint SubstituteOverride transform to replace
overrides with const expressions and use the updated program
at pipeline creation time.

This CL also adds support for overrides used as workgroup size
and related tests. Workgroup size validation now happens
in backend code and at compute pipeline creation time.

Bug: dawn:1504
Change-Id: I7df1fe9c3e358caa23235eacd6d13ba0b2998aec
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/99821
Commit-Queue: Shrek Shao <shrekshao@google.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
shrekshao
2022-09-07 20:09:54 +00:00
committed by Dawn LUCI CQ
parent 23cf74c30e
commit 145337f309
36 changed files with 1246 additions and 698 deletions

View File

@@ -20,6 +20,7 @@
#include "tint/override_id.h"
#include "src/tint/reflection.h"
#include "src/tint/transform/transform.h"
namespace tint::transform {
@@ -63,6 +64,9 @@ class SubstituteOverride final : public Castable<SubstituteOverride, Transform>
/// The value is always a double coming into the transform and will be
/// converted to the correct type through and initializer.
std::unordered_map<OverrideId, double> map;
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
TINT_REFLECT(map);
};
/// Constructor