Reorder options structures.
Shuffle around the options structures to group similar options together.
Bug: tint:1501
Change-Id: Ib2e02207ecb83374e24d0f3735ff07ad5db739d4
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/152900
Reviewed-by: Ben Clayton <bclayton@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: dan sinclair <dsinclair@chromium.org>
diff --git a/src/tint/lang/glsl/writer/common/options.h b/src/tint/lang/glsl/writer/common/options.h
index 1fe8e43..2c9fdcd 100644
--- a/src/tint/lang/glsl/writer/common/options.h
+++ b/src/tint/lang/glsl/writer/common/options.h
@@ -41,6 +41,15 @@
/// Copy constructor
Options(const Options&);
+ /// Set to `true` to disable software robustness that prevents out-of-bounds accesses.
+ bool disable_robustness = false;
+
+ /// Set to `true` to disable workgroup memory zero initialization
+ bool disable_workgroup_init = false;
+
+ /// The GLSL version to emit
+ Version version;
+
/// A map of SamplerTexturePair to combined sampler names for the
/// CombineSamplers transform
BindingMap binding_map;
@@ -48,12 +57,6 @@
/// The binding point to use for placeholder samplers.
BindingPoint placeholder_binding_point;
- /// Set to `true` to disable software robustness that prevents out-of-bounds accesses.
- bool disable_robustness = false;
-
- /// Set to `true` to disable workgroup memory zero initialization
- bool disable_workgroup_init = false;
-
/// Options used in the bindings remapper
BindingRemapperOptions binding_remapper_options = {};
@@ -65,18 +68,15 @@
/// textureQueryLevels/textureSamples directly.
std::optional<TextureBuiltinsFromUniformOptions> texture_builtins_from_uniform = std::nullopt;
- /// The GLSL version to emit
- Version version;
-
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
- TINT_REFLECT(binding_map,
- placeholder_binding_point,
- disable_robustness,
+ TINT_REFLECT(disable_robustness,
disable_workgroup_init,
+ version,
+ binding_map,
+ placeholder_binding_point,
binding_remapper_options,
external_texture_options,
- texture_builtins_from_uniform,
- version);
+ texture_builtins_from_uniform);
};
} // namespace tint::glsl::writer
diff --git a/src/tint/lang/hlsl/writer/common/options.h b/src/tint/lang/hlsl/writer/common/options.h
index e35e8bd..6a2648c 100644
--- a/src/tint/lang/hlsl/writer/common/options.h
+++ b/src/tint/lang/hlsl/writer/common/options.h
@@ -42,45 +42,45 @@
/// Set to `true` to disable software robustness that prevents out-of-bounds accesses.
bool disable_robustness = false;
- /// The binding point to use for information passed via root constants.
- std::optional<BindingPoint> root_constant_binding_point;
-
/// Set to `true` to disable workgroup memory zero initialization
bool disable_workgroup_init = false;
- /// Options used in the binding mappings for external textures
- ExternalTextureOptions external_texture_options = {};
-
- /// Options used to specify a mapping of binding points to indices into a UBO
- /// from which to load buffer sizes.
- ArrayLengthFromUniformOptions array_length_from_uniform = {};
-
- /// Options used in the bindings remapper
- BindingRemapperOptions binding_remapper_options = {};
-
- /// Interstage locations actually used as inputs in the next stage of the pipeline.
- /// This is potentially used for truncating unused interstage outputs at current shader stage.
- std::bitset<16> interstage_locations;
-
/// Set to `true` to run the TruncateInterstageVariables transform.
bool truncate_interstage_variables = false;
/// Set to `true` to generate polyfill for `reflect` builtin for vec2<f32>
bool polyfill_reflect_vec2_f32 = false;
+ /// Options used to specify a mapping of binding points to indices into a UBO
+ /// from which to load buffer sizes.
+ ArrayLengthFromUniformOptions array_length_from_uniform = {};
+
+ /// Interstage locations actually used as inputs in the next stage of the pipeline.
+ /// This is potentially used for truncating unused interstage outputs at current shader stage.
+ std::bitset<16> interstage_locations;
+
+ /// The binding point to use for information passed via root constants.
+ std::optional<BindingPoint> root_constant_binding_point;
+
+ /// Options used in the binding mappings for external textures
+ ExternalTextureOptions external_texture_options = {};
+
+ /// Options used in the bindings remapper
+ BindingRemapperOptions binding_remapper_options = {};
+
/// The binding points that will be ignored in the rebustness transform.
std::vector<BindingPoint> binding_points_ignored_in_robustness_transform;
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
TINT_REFLECT(disable_robustness,
- root_constant_binding_point,
disable_workgroup_init,
- external_texture_options,
- array_length_from_uniform,
- binding_remapper_options,
- interstage_locations,
truncate_interstage_variables,
polyfill_reflect_vec2_f32,
+ array_length_from_uniform,
+ interstage_locations,
+ root_constant_binding_point,
+ external_texture_options,
+ binding_remapper_options,
binding_points_ignored_in_robustness_transform);
};
diff --git a/src/tint/lang/msl/writer/common/options.h b/src/tint/lang/msl/writer/common/options.h
index 763b1d3..597e5c7 100644
--- a/src/tint/lang/msl/writer/common/options.h
+++ b/src/tint/lang/msl/writer/common/options.h
@@ -38,6 +38,16 @@
/// Set to `true` to disable software robustness that prevents out-of-bounds accesses.
bool disable_robustness = false;
+ /// Set to `true` to disable workgroup memory zero initialization
+ bool disable_workgroup_init = false;
+
+ /// Set to `true` to generate a [[point_size]] attribute which is set to 1.0
+ /// for all vertex shaders in the module.
+ bool emit_vertex_point_size = false;
+
+ /// Set to `true` to generate MSL via the Tint IR instead of from the AST.
+ bool use_tint_ir = false;
+
/// The index to use when generating a UBO to receive storage buffer sizes.
/// Defaults to 30, which is the last valid buffer slot.
uint32_t buffer_size_ubo_index = 30;
@@ -46,39 +56,30 @@
/// Defaults to 0xFFFFFFFF.
uint32_t fixed_sample_mask = 0xFFFFFFFF;
- /// Set to `true` to generate a [[point_size]] attribute which is set to 1.0
- /// for all vertex shaders in the module.
- bool emit_vertex_point_size = false;
-
- /// Set to `true` to disable workgroup memory zero initialization
- bool disable_workgroup_init = false;
-
/// Options used for dealing with pixel local storage
PixelLocalOptions pixel_local_options = {};
- /// Options used in the binding mappings for external textures
- ExternalTextureOptions external_texture_options = {};
-
/// Options used to specify a mapping of binding points to indices into a UBO
/// from which to load buffer sizes.
ArrayLengthFromUniformOptions array_length_from_uniform = {};
+ /// Options used in the binding mappings for external textures
+ ExternalTextureOptions external_texture_options = {};
+
/// Options used in the bindings remapper
BindingRemapperOptions binding_remapper_options = {};
- /// Set to `true` to generate MSL via the Tint IR instead of from the AST.
- bool use_tint_ir = false;
-
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
TINT_REFLECT(disable_robustness,
+ disable_workgroup_init,
+ emit_vertex_point_size,
+ use_tint_ir,
buffer_size_ubo_index,
fixed_sample_mask,
- emit_vertex_point_size,
- disable_workgroup_init,
- external_texture_options,
+ pixel_local_options,
array_length_from_uniform,
- binding_remapper_options,
- use_tint_ir);
+ external_texture_options,
+ binding_remapper_options);
};
} // namespace tint::msl::writer
diff --git a/src/tint/lang/spirv/writer/common/options.h b/src/tint/lang/spirv/writer/common/options.h
index fce8659..57e81e8 100644
--- a/src/tint/lang/spirv/writer/common/options.h
+++ b/src/tint/lang/spirv/writer/common/options.h
@@ -26,35 +26,35 @@
/// Set to `true` to disable software robustness that prevents out-of-bounds accesses.
bool disable_robustness = false;
- /// Set to `true` to generate a PointSize builtin and have it set to 1.0
- /// from all vertex shaders in the module.
- bool emit_vertex_point_size = true;
-
- /// Set to `true` to disable workgroup memory zero initialization
- bool disable_workgroup_init = false;
-
- /// Set to `true` to clamp frag depth
- bool clamp_frag_depth = false;
-
- /// Options used in the binding mappings for external textures
- ExternalTextureOptions external_texture_options = {};
-
- /// Options used in the bindings remapper
- BindingRemapperOptions binding_remapper_options = {};
-
- /// Set to `true` to initialize workgroup memory with OpConstantNull when
- /// VK_KHR_zero_initialize_workgroup_memory is enabled.
- bool use_zero_initialize_workgroup_memory_extension = false;
-
/// Set to `true` to skip robustness transform on textures.
bool disable_image_robustness = false;
/// Set to `true` to disable index clamping on the runtime-sized arrays in robustness transform.
bool disable_runtime_sized_array_index_clamping = false;
+ /// Set to `true` to disable workgroup memory zero initialization
+ bool disable_workgroup_init = false;
+
+ /// Set to `true` to initialize workgroup memory with OpConstantNull when
+ /// VK_KHR_zero_initialize_workgroup_memory is enabled.
+ bool use_zero_initialize_workgroup_memory_extension = false;
+
+ /// Set to `true` to generate a PointSize builtin and have it set to 1.0
+ /// from all vertex shaders in the module.
+ bool emit_vertex_point_size = true;
+
+ /// Set to `true` to clamp frag depth
+ bool clamp_frag_depth = false;
+
/// Set to `true` to generate SPIR-V via the Tint IR instead of from the AST.
bool use_tint_ir = false;
+ /// Options used in the binding mappings for external textures
+ ExternalTextureOptions external_texture_options = {};
+
+ /// Options used in the bindings remapper
+ BindingRemapperOptions binding_remapper_options = {};
+
/// Set to `true` to require `SPV_KHR_subgroup_uniform_control_flow` extension and
/// `SubgroupUniformControlFlowKHR` execution mode for compute stage entry points in generated
/// SPIRV module. Issue: dawn:464
@@ -62,15 +62,15 @@
/// Reflect the fields of this class so that it can be used by tint::ForeachField()
TINT_REFLECT(disable_robustness,
- emit_vertex_point_size,
- disable_workgroup_init,
- clamp_frag_depth,
- external_texture_options,
- binding_remapper_options,
- use_zero_initialize_workgroup_memory_extension,
disable_image_robustness,
disable_runtime_sized_array_index_clamping,
+ disable_workgroup_init,
+ use_zero_initialize_workgroup_memory_extension,
+ emit_vertex_point_size,
+ clamp_frag_depth,
use_tint_ir,
+ external_texture_options,
+ binding_remapper_options,
experimental_require_subgroup_uniform_control_flow);
};