transform: Make methods const, add ShouldRun()
Transforms are supposed to be immutable, operating on the DataMaps provided for input and output, so make the methods const.
Add a ShouldRun() method which the Manager can use to skip over transforms that do not need to be run.
Change-Id: I320ac964577e94ac988748d8aca85bd43ee8d3b5
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77120
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
diff --git a/src/transform/first_index_offset.cc b/src/transform/first_index_offset.cc
index 6fcff16..50a65fa 100644
--- a/src/transform/first_index_offset.cc
+++ b/src/transform/first_index_offset.cc
@@ -59,7 +59,7 @@
void FirstIndexOffset::Run(CloneContext& ctx,
const DataMap& inputs,
- DataMap& outputs) {
+ DataMap& outputs) const {
// Get the uniform buffer binding point
uint32_t ub_binding = binding_;
uint32_t ub_group = group_;