Provide build override for SPIRV options

Without this, the fuzzing framework will fall back to the default and
copies in random bits without consideration of range restrictions on
specific fields.

BUG=chromium:1287344

Change-Id: Ifbde471074a2f68e1d9fd8215174814d2f465f93
Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/76880
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Kokoro: Kokoro <noreply+kokoro@google.com>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison 2022-01-18 15:37:56 +00:00 committed by Tint LUCI CQ
parent e232e35723
commit dcb24cea41
1 changed files with 14 additions and 0 deletions

View File

@ -189,6 +189,20 @@ class DataBuilder {
}
};
/// Specialization for writer::spirv::Options
template <>
struct BuildImpl<writer::spirv::Options> {
/// Generate a pseudo-random writer::spirv::Options struct
/// @param b - data builder to use
/// @returns writer::spirv::Options filled with pseudo-random data
static writer::spirv::Options impl(DataBuilder* b) {
writer::spirv::Options out{};
b->build(out.emit_vertex_point_size);
b->build(out.disable_workgroup_init);
return out;
}
};
/// Specialization for writer::ArrayLengthFromUniformOptions
template <>
struct BuildImpl<writer::ArrayLengthFromUniformOptions> {