commit | 4c7b09fbb942a291f60c73b2e519be203a53b4ca | [log] [tgz] |
---|---|---|
author | Ben Clayton <bclayton@google.com> | Fri Apr 05 16:27:20 2024 +0000 |
committer | Dawn LUCI CQ <dawn-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Apr 05 16:27:20 2024 +0000 |
tree | 91b9383a03f499f2837c84c0b0df99b12e4a6bf8 | |
parent | 348277f9ec06103029ab5669b69e17e9f40d4f87 [diff] |
[tint][ir] Use the FilteredIterator to avoid dead instructions The common pattern by many IR transforms is to iterate over the ir::Module::instructions.Objects(), which is the list of allocated instructions. These include instructions that have been destroyed, and must not be used. We've hit the same bug time and time again, where we've forgotten to check for `Instruction::Alive()` before using the instruction. To avoid this mistake, add new ir::Module::Instructions() and ir::Module::Values() method that returns an iterator filtered to the alive instructions / values. Move the allocators into a new 'allocators' structure member to discourage use of these for object iteration. Change-Id: Ic0043c8a4b82b9ec10b2b8a3479f33c6e5d286ff Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/182122 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com>
Dawn is an open-source and cross-platform implementation of the WebGPU standard. More precisely it implements webgpu.h
that is a one-to-one mapping with the WebGPU IDL. Dawn is meant to be integrated as part of a larger system and is the underlying implementation of WebGPU in Chromium.
Dawn provides several WebGPU building blocks:
webgpu.h
version that Dawn implements.webgpu.h
.Helpful links:
Developer documentation:
User documentation: (TODO, figure out what overlaps with the webgpu.h docs)
BSD 3-Clause License, please see LICENSE.
This is not an officially supported Google product.