Remove the use_tint_generator toggle

We now always use Tint.

Bug: dawn:571
Change-Id: Ic65669a9e00493292ed60cde00af6fa3f6e55ec2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/65665
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
This commit is contained in:
Corentin Wallez 2021-10-29 13:17:27 +00:00 committed by Dawn LUCI CQ
parent 2f8a68ce21
commit deb4057d27
22 changed files with 18 additions and 72 deletions

View File

@ -186,15 +186,6 @@ namespace dawn_native {
mFormatTable = BuildFormatTable(this);
SetDefaultToggles();
if ((adapter->GetBackendType() == wgpu::BackendType::Metal ||
adapter->GetBackendType() == wgpu::BackendType::Vulkan ||
adapter->GetBackendType() == wgpu::BackendType::D3D12) &&
!IsToggleEnabled(Toggle::UseTintGenerator)) {
EmitLog(
WGPULoggingType_Warning,
"Non-tint generator is not available on this backend; toggle disable ignored.\n");
ForceSetToggle(Toggle::UseTintGenerator, true);
}
}
DeviceBase::DeviceBase() : mState(State::Alive) {
@ -1537,7 +1528,6 @@ namespace dawn_native {
void DeviceBase::SetDefaultToggles() {
SetToggle(Toggle::LazyClearResourceOnFirstUse, true);
SetToggle(Toggle::DisallowUnsafeAPIs, true);
SetToggle(Toggle::UseTintGenerator, true);
}
void DeviceBase::ApplyToggleOverrides(const DeviceDescriptor* deviceDescriptor) {

View File

@ -160,9 +160,6 @@ namespace dawn_native {
"Produces validation errors on API entry points or parameter combinations that "
"aren't considered secure yet.",
"http://crbug.com/1138528"}},
{Toggle::UseTintGenerator,
{"use_tint_generator", "Use Tint instead of SPRIV-cross to generate shaders.",
"https://crbug.com/dawn/571"}},
{Toggle::FlushBeforeClientWaitSync,
{"flush_before_client_wait_sync",
"Call glFlush before glClientWaitSync to work around bugs in the latter",

View File

@ -48,7 +48,6 @@ namespace dawn_native {
DisableRobustness,
MetalEnableVertexPulling,
DisallowUnsafeAPIs,
UseTintGenerator,
FlushBeforeClientWaitSync,
UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel,
EmitHLSLDebugSymbols,

View File

@ -352,13 +352,13 @@ namespace dawn_native { namespace opengl {
// Modify the decoration of variables so that SPIRV-Cross outputs only
// layout(binding=<index>) for interface variables.
//
// When the use_tint_generator toggle is on, Tint is used for the reflection of bindings
// for the implicit pipeline layout and pipeline/layout validation, but bindingInfo is set
// to mGLEntryPoints which is the SPIRV-Cross reflection. Tint reflects bindings used more
// precisely than SPIRV-Cross so some bindings in bindingInfo might not exist in the layout
// and querying the layout for them would cause an ASSERT. That's why we defensively check
// that bindings are in the layout before modifying them. This slight hack is ok because in
// the long term we will use Tint to produce GLSL.
// Tint is used for the reflection of bindings for the implicit pipeline layout and
// pipeline/layout validation, but bindingInfo is set to mGLEntryPoints which is the
// SPIRV-Cross reflection. Tint reflects bindings used more precisely than SPIRV-Cross so
// some bindings in bindingInfo might not exist in the layout and querying the layout for
// them would cause an ASSERT. That's why we defensively check that bindings are in the
// layout before modifying them. This slight hack is ok because in the long term we will use
// Tint to produce GLSL.
for (BindGroupIndex group : IterateBitSet(layout->GetBindGroupLayoutsMask())) {
for (const auto& it : bindingInfo[group]) {
const BindGroupLayoutBase* bgl = layout->GetBindGroupLayout(group);

View File

@ -385,7 +385,7 @@ void DawnTestEnvironment::ParseArgs(int argc, char** argv) {
" enable all available backend validation with less performance overhead.\n"
" Set to 'disabled' to run with no validation (same as no flag).\n"
" --enable-toggles: Comma-delimited list of Dawn toggles to enable.\n"
" ex.) skip_validation,use_tint_generator,disable_robustness,turn_off_vsync\n"
" ex.) skip_validation,disable_robustness,turn_off_vsync\n"
" --disable-toggles: Comma-delimited list of Dawn toggles to disable\n"
" --adapter-vendor-id: Select adapter by vendor id to run end2end tests"
"on multi-GPU systems \n"

View File

@ -986,9 +986,6 @@ TEST_P(BindGroupTests, DrawThenChangePipelineTwiceAndBindGroup) {
// Regression test for crbug.com/dawn/408 where dynamic offsets were applied in the wrong order.
// Dynamic offsets should be applied in increasing order of binding number.
TEST_P(BindGroupTests, DynamicOffsetOrder) {
// Does not work with SPIRV-Cross. crbug.com/dawn/975
DAWN_SUPPRESS_TEST_IF(IsD3D12() && !HasToggleEnabled("use_tint_generator"));
// We will put the following values and the respective offsets into a buffer.
// The test will ensure that the correct dynamic offset is applied to each buffer by reading the
// value from an offset binding.

View File

@ -135,8 +135,6 @@ class ComputeLayoutMemoryBufferTests
: public DawnTestWithParams<ComputeLayoutMemoryBufferTestParams> {
void SetUp() override {
DawnTestBase::SetUp();
DAWN_TEST_UNSUPPORTED_IF((IsD3D12() || IsMetal()) &&
!HasToggleEnabled("use_tint_generator"));
}
};

View File

@ -339,10 +339,6 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) {
// 2 - Write ones into it with a compute shader.
// 3 - Use the indirect buffer in a Dispatch while also reading its data.
TEST_P(ComputeStorageBufferBarrierTests, IndirectBufferCorrectBarrier) {
// For some reason SPIRV-Cross crashes when translating the step3 shader to HLSL. Suppress the
// failure since we'll remove SPIRV-Cross at some point.
DAWN_SUPPRESS_TEST_IF(IsD3D12() && !HasToggleEnabled("use_tint_generator"));
wgpu::ComputePipelineDescriptor step2PipelineDesc;
step2PipelineDesc.compute.entryPoint = "main";
step2PipelineDesc.compute.module = utils::CreateShaderModule(device, R"(

View File

@ -140,10 +140,6 @@ class CopyTextureForBrowserTests : public DawnTest {
void SetUp() override {
DawnTest::SetUp();
// crbug.com/dawn/948: Tint required for multiple entrypoints in a module.
// CopyTextureForBrowser uses and internal pipeline with a multi-entrypoint
// shader module.
DAWN_TEST_UNSUPPORTED_IF(!HasToggleEnabled("use_tint_generator"));
testPipeline = MakeTestPipeline();

View File

@ -741,9 +741,6 @@ TEST_P(DepthStencilSamplingTest, CompareFunctionsRender) {
// Initialization via renderPass loadOp doesn't work on Mac Intel.
DAWN_SUPPRESS_TEST_IF(IsMetal() && IsIntel());
// Depends on Tint's shader reflection
DAWN_TEST_UNSUPPORTED_IF(!HasToggleEnabled("use_tint_generator"));
wgpu::RenderPipeline pipeline = CreateComparisonRenderPipeline();
for (wgpu::TextureFormat format : kDepthFormats) {

View File

@ -62,10 +62,6 @@ TEST_P(ExternalTextureTests, CreateExternalTextureSuccess) {
}
TEST_P(ExternalTextureTests, SampleExternalTexture) {
// SPIRV-Cross is unable to reflect texture_external correctly, which causes errors during
// validation.
DAWN_SUPPRESS_TEST_IF(!HasToggleEnabled("use_tint_generator"));
wgpu::ShaderModule vsModule = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main([[builtin(vertex_index)]] VertexIndex : u32) -> [[builtin(position)]] vec4<f32> {
var positions : array<vec4<f32>, 3> = array<vec4<f32>, 3>(

View File

@ -50,8 +50,6 @@ class FirstIndexOffsetTests : public DawnTest {
protected:
void SetUp() override {
DawnTest::SetUp();
DAWN_TEST_UNSUPPORTED_IF(IsD3D12() && !HasToggleEnabled("use_tint_generator"));
// WGSL doesn't have the ability to tag attributes as "flat". "flat" is required on u32
// attributes for correct runtime behavior under Vulkan and codegen under OpenGL(ES).
// TODO(tint:451): Remove once resolved by spec/tint

View File

@ -756,7 +756,7 @@ TEST_P(MultisampledRenderingTest, MultisampledRenderingWithDepthTestAndSampleMas
TEST_P(MultisampledRenderingTest, ResolveInto2DTextureWithSampleMaskAndShaderOutputMask) {
// TODO(github.com/KhronosGroup/SPIRV-Cross/issues/1626): SPIRV-Cross produces bad GLSL for
// unsigned SampleMask builtins
DAWN_SUPPRESS_TEST_IF(HasToggleEnabled("use_tint_generator") && (IsOpenGL() || IsOpenGLES()));
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
// TODO(crbug.com/dawn/673): Work around or enforce via validation that sample variables are not
// supported on some platforms.
@ -818,7 +818,7 @@ TEST_P(MultisampledRenderingTest, ResolveInto2DTextureWithSampleMaskAndShaderOut
TEST_P(MultisampledRenderingTest, ResolveIntoMultipleResolveTargetsWithShaderOutputMask) {
// TODO(github.com/KhronosGroup/SPIRV-Cross/issues/1626): SPIRV-Cross produces bad GLSL for
// unsigned SampleMask builtins
DAWN_SUPPRESS_TEST_IF(HasToggleEnabled("use_tint_generator") && (IsOpenGL() || IsOpenGLES()));
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || IsOpenGLES());
// TODO(crbug.com/dawn/673): Work around or enforce via validation that sample variables are not
// supported on some platforms.

View File

@ -126,8 +126,6 @@ class MultisampledSamplingTest : public DawnTest {
// must cover both the X and Y coordinates of the sample position (no false positives if
// it covers the X position but not the Y, or vice versa).
TEST_P(MultisampledSamplingTest, SamplePositions) {
DAWN_TEST_UNSUPPORTED_IF(!HasToggleEnabled("use_tint_generator"));
static constexpr wgpu::Extent3D kTextureSize = {1, 1, 1};
wgpu::Texture colorTexture;

View File

@ -36,11 +36,10 @@ class ShaderFloat16Tests : public DawnTest {
};
// Test basic 16bit float arithmetic and 16bit storage features.
TEST_P(ShaderFloat16Tests, Basic16BitFloatFeaturesTest) {
// TODO(crbug.com/tint/404): Implement float16 in Tint.
TEST_P(ShaderFloat16Tests, DISABLED_Basic16BitFloatFeaturesTest) {
DAWN_TEST_UNSUPPORTED_IF(!IsShaderFloat16Supported());
DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsIntel()); // Flaky crashes. crbug.com/dawn/586
// TODO(crbug.com/tint/404): Implement float16 in Tint.
DAWN_TEST_UNSUPPORTED_IF(HasToggleEnabled("use_tint_generator"));
uint16_t uniformData[] = {Float32ToFloat16(1.23), Float32ToFloat16(0.0)}; // 0.0 is a padding.
wgpu::Buffer uniformBuffer = utils::CreateBufferFromData(

View File

@ -278,9 +278,6 @@ fn main(input : FragmentIn) -> [[location(0)]] vec4<f32> {
// Tests that shaders I/O structs can be shared between vertex and fragment shaders.
TEST_P(ShaderTests, WGSLSharedStructIO) {
// crbug.com/dawn/948: Tint required for multiple entrypoints in a module.
DAWN_TEST_UNSUPPORTED_IF(!HasToggleEnabled("use_tint_generator"));
std::string shader = R"(
struct VertexIn {
[[location(0)]] position : vec3<f32>;

View File

@ -409,7 +409,7 @@ void ShaderRobustnessPerf::SetUp() {
DAWN_SUPPRESS_TEST_IF(IsD3D12() && IsWARP());
// TODO(crbug.com/dawn/945): Generation via SPIRV-Cross fails
DAWN_SUPPRESS_TEST_IF(IsOpenGL() || !HasToggleEnabled("use_tint_generator"));
DAWN_SUPPRESS_TEST_IF(IsOpenGL());
const size_t dataASize = mDimAOuter * mDimInner;
std::vector<float> dataA(dataASize);

View File

@ -2426,7 +2426,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
}
// Test that filtering sampler binding does not work with comparison sampler in the shader.
if (HasToggleEnabled("use_tint_generator")) {
{
wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Filtering}});
@ -2438,7 +2438,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
}
// Test that non-filtering sampler binding does not work with comparison sampler in the shader.
if (HasToggleEnabled("use_tint_generator")) {
{
wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::NonFiltering}});
@ -2450,7 +2450,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
}
// Test that comparison sampler binding does not work with normal sampler in the shader.
if (HasToggleEnabled("use_tint_generator")) {
{
wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Comparison}});
@ -2532,7 +2532,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
}
// Test that a filtering sampler cannot be used to sample an unfilterable-float texture.
if (HasToggleEnabled("use_tint_generator")) {
{
wgpu::BindGroupLayout bindGroupLayout = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Filtering},
{1, wgpu::ShaderStage::Fragment, wgpu::TextureSampleType::UnfilterableFloat}});

View File

@ -162,8 +162,6 @@ TEST_F(GetBindGroupLayoutTests, DefaultTextureSampleType) {
// Getting the same pointer to equivalent bind group layouts is an implementation detail of Dawn
// Native.
DAWN_SKIP_TEST_IF(UsesWire());
// Relies on Tint shader reflection.
DAWN_SKIP_TEST_IF(!HasToggleEnabled("use_tint_generator"));
wgpu::BindGroupLayout filteringBGL = utils::MakeBindGroupLayout(
device, {{0, wgpu::ShaderStage::Vertex | wgpu::ShaderStage::Fragment,
@ -1082,10 +1080,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
}
// Test that fragment output validation is for the correct entryPoint
// TODO(dawn:216): Re-enable when we correctly reflect which bindings are used for an entryPoint.
TEST_F(GetBindGroupLayoutTests, FromCorrectEntryPoint) {
DAWN_SKIP_TEST_IF(!HasToggleEnabled("use_tint_generator"));
wgpu::ShaderModule module = utils::CreateShaderModule(device, R"(
[[block]] struct Data {
data : f32;

View File

@ -435,8 +435,6 @@ TEST_F(ShaderModuleValidationTest, MaximumInterStageShaderComponents) {
// Tests that we validate workgroup size limits.
TEST_F(ShaderModuleValidationTest, ComputeWorkgroupSizeLimits) {
DAWN_SKIP_TEST_IF(!HasToggleEnabled("use_tint_generator"));
auto MakeShaderWithWorkgroupSize = [this](uint32_t x, uint32_t y, uint32_t z) {
std::ostringstream ss;
ss << "[[stage(compute), workgroup_size(" << x << "," << y << "," << z
@ -467,8 +465,6 @@ TEST_F(ShaderModuleValidationTest, ComputeWorkgroupSizeLimits) {
// Tests that we validate workgroup storage size limits.
TEST_F(ShaderModuleValidationTest, ComputeWorkgroupStorageSizeLimits) {
DAWN_SKIP_TEST_IF(!HasToggleEnabled("use_tint_generator"));
wgpu::Limits supportedLimits = GetSupportedLimits().limits;
constexpr uint32_t kVec4Size = 16;

View File

@ -63,7 +63,7 @@ void InitDawnValidationTestEnvironment(int argc, char** argv) {
" [--enable-toggles=toggles] [--disable-toggles=toggles]\n"
" -w, --use-wire: Run the tests through the wire (defaults to no wire)\n"
" --enable-toggles: Comma-delimited list of Dawn toggles to enable.\n"
" ex.) skip_validation,use_tint_generator,disable_robustness,turn_off_vsync\n"
" ex.) skip_validation,disable_robustness,turn_off_vsync\n"
" --disable-toggles: Comma-delimited list of Dawn toggles to disable\n";
continue;
}

View File

@ -737,9 +737,6 @@ TEST_P(D3D12DescriptorHeapTests, EncodeReuseUBOMultipleSubmits) {
// Verify encoding many sampler and ubo worth of bindgroups.
// Shader-visible heaps should switch out |kNumOfViewHeaps| times.
TEST_P(D3D12DescriptorHeapTests, EncodeManyUBOAndSamplers) {
// TODO(crbug.com/dawn/571): HLSL emission via SPIRV-Cross produces incorrect results.
DAWN_TEST_UNSUPPORTED_IF(!HasToggleEnabled("use_tint_generator"));
DAWN_TEST_UNSUPPORTED_IF(!mD3DDevice->IsToggleEnabled(
dawn_native::Toggle::UseD3D12SmallShaderVisibleHeapForTesting));