mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-17 17:05:31 +00:00
Move tint::transform::Robustness to a santizier transform
There's no good reason for this to be public. Move it into the writers, and expose a 'disable_robustness' option to turn it off. This can be expanded to hold more fine-grain control in the future. Change-Id: I6ea6e54a27b2ae0fbcba5fdf45539063045cc15a Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/122203 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com> Reviewed-by: Dan Sinclair <dsinclair@chromium.org> Auto-Submit: Ben Clayton <bclayton@google.com> Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
committed by
Dawn LUCI CQ
parent
902c9e5726
commit
03de0e83ae
@@ -331,10 +331,6 @@ ResultOrError<std::string> TranslateToHLSL(
|
||||
std::move(r.substituteOverrideConfig).value());
|
||||
}
|
||||
|
||||
if (r.isRobustnessEnabled) {
|
||||
transformManager.Add<tint::transform::Robustness>();
|
||||
}
|
||||
|
||||
transformManager.Add<tint::transform::BindingRemapper>();
|
||||
|
||||
// D3D12 registers like `t3` and `c3` have the same bindingOffset number in
|
||||
@@ -383,6 +379,7 @@ ResultOrError<std::string> TranslateToHLSL(
|
||||
}
|
||||
|
||||
tint::writer::hlsl::Options options;
|
||||
options.disable_robustness = !r.isRobustnessEnabled;
|
||||
options.disable_workgroup_init = r.disableWorkgroupInit;
|
||||
if (r.usesNumWorkgroups) {
|
||||
options.root_constant_binding_point =
|
||||
|
||||
@@ -222,9 +222,6 @@ ResultOrError<CacheResult<MslCompilation>> TranslateToMSL(
|
||||
std::move(r.substituteOverrideConfig).value());
|
||||
}
|
||||
|
||||
if (r.isRobustnessEnabled) {
|
||||
transformManager.Add<tint::transform::Robustness>();
|
||||
}
|
||||
transformManager.Add<BindingRemapper>();
|
||||
transformInputs.Add<BindingRemapper::Remappings>(std::move(r.bindingPoints),
|
||||
BindingRemapper::AccessControls{},
|
||||
@@ -262,6 +259,7 @@ ResultOrError<CacheResult<MslCompilation>> TranslateToMSL(
|
||||
}
|
||||
|
||||
tint::writer::msl::Options options;
|
||||
options.disable_robustness = !r.isRobustnessEnabled;
|
||||
options.buffer_size_ubo_index = kBufferLengthBufferSlot;
|
||||
options.fixed_sample_mask = r.sampleMask;
|
||||
options.disable_workgroup_init = r.disableWorkgroupInit;
|
||||
|
||||
@@ -391,8 +391,6 @@ MaybeError ComputePipeline::Initialize() {
|
||||
tint::transform::Manager transformManager;
|
||||
tint::transform::DataMap transformInputs;
|
||||
|
||||
transformManager.Add<tint::transform::Robustness>();
|
||||
|
||||
if (!computeStage.metadata->overrides.empty()) {
|
||||
transformManager.Add<tint::transform::SingleEntryPoint>();
|
||||
transformInputs.Add<tint::transform::SingleEntryPoint::Config>(
|
||||
|
||||
@@ -228,6 +228,9 @@ ResultOrError<GLuint> ShaderModule::CompileShader(const OpenGLFunctions& gl,
|
||||
tintOptions.version = tint::writer::glsl::Version(ToTintGLStandard(r.glVersionStandard),
|
||||
r.glVersionMajor, r.glVersionMinor);
|
||||
|
||||
// TODO(crbug.com/dawn/1686): Robustness causes shader compilation failures.
|
||||
tintOptions.disable_robustness = true;
|
||||
|
||||
// When textures are accessed without a sampler (e.g., textureLoad()),
|
||||
// GetSamplerTextureUses() will return this sentinel value.
|
||||
BindingPoint placeholderBindingPoint{static_cast<uint32_t>(kMaxBindGroupsTyped), 0};
|
||||
|
||||
@@ -293,10 +293,6 @@ ResultOrError<ShaderModule::ModuleAndSpirv> ShaderModule::GetHandleAndSpirv(
|
||||
std::move(r.substituteOverrideConfig).value());
|
||||
}
|
||||
|
||||
if (r.isRobustnessEnabled) {
|
||||
transformManager.append(std::make_unique<tint::transform::Robustness>());
|
||||
}
|
||||
|
||||
// Run the binding remapper after SingleEntryPoint to avoid collisions with
|
||||
// unused entryPoints.
|
||||
transformManager.append(std::make_unique<tint::transform::BindingRemapper>());
|
||||
@@ -344,6 +340,7 @@ ResultOrError<ShaderModule::ModuleAndSpirv> ShaderModule::GetHandleAndSpirv(
|
||||
}
|
||||
|
||||
tint::writer::spirv::Options options;
|
||||
options.disable_robustness = !r.isRobustnessEnabled;
|
||||
options.emit_vertex_point_size = true;
|
||||
options.disable_workgroup_init = r.disableWorkgroupInit;
|
||||
options.use_zero_initialize_workgroup_memory_extension =
|
||||
|
||||
Reference in New Issue
Block a user