Skip to content

Commit

Permalink
[spirv][fuzz] Avoid remapping multiple entry point names
Browse files Browse the repository at this point in the history
If the `remapped_entry_point_name` option is non-empty, we cannot
codegen a module with multiple entry points as they would all receive
the same name.

Note that this check will become unnecessary once we address
crbug.com/375388101.

Fixed: 384115680
Change-Id: I6fff79ed0f11b695bc89ef420bac07b31ef34221
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/219754
Commit-Queue: Antonio Maiorano <[email protected]>
Commit-Queue: James Price <[email protected]>
Reviewed-by: Antonio Maiorano <[email protected]>
Auto-Submit: James Price <[email protected]>
  • Loading branch information
jrprice authored and Dawn LUCI CQ committed Dec 16, 2024
1 parent a1dc897 commit 21a0d85
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/tint/lang/spirv/writer/writer_fuzz.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ bool CanRun(const core::ir::Module& module, const Options& options) {
if (options.remapped_entry_point_name.find('\0') != std::string::npos) {
return false;
}

// Check for multiple entry points.
// TODO(375388101): Remove this check when SingleEntryPoint is part of the backend.
bool has_entry_point = false;
for (auto& func : module.functions) {
if (func->IsEntryPoint()) {
if (has_entry_point) {
return false;
}
has_entry_point = true;
}
}
}

// Check for unsupported module-scope variable address spaces and types.
Expand Down

0 comments on commit 21a0d85

Please sign in to comment.