From c0f20fbc541e90c5f8195e7b86fdeec5e521c27f Mon Sep 17 00:00:00 2001 From: Stephen White Date: Thu, 2 Sep 2021 16:50:58 +0000 Subject: [PATCH] Remove all "WithTint" suffixes from Dawn native. The D3D12 and Metal backends no longer support any other shading language translator, so the suffix is superfluous. Bug: dawn:1099 Change-Id: I6a1a249a80d59dbf9cabf5d4ea917f852745e78e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/63400 Reviewed-by: Corentin Wallez Reviewed-by: Austin Eng Commit-Queue: Stephen White --- src/dawn_native/d3d12/ShaderModuleD3D12.cpp | 6 ++--- src/dawn_native/d3d12/ShaderModuleD3D12.h | 10 ++++---- src/dawn_native/metal/ShaderModuleMTL.h | 18 +++++++------- src/dawn_native/metal/ShaderModuleMTL.mm | 27 ++++++++++----------- 4 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp index 2ecb5fce91..426cdb3107 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp @@ -180,7 +180,7 @@ namespace dawn_native { namespace d3d12 { return InitializeBase(parseResult); } - ResultOrError ShaderModule::TranslateToHLSLWithTint( + ResultOrError ShaderModule::TranslateToHLSL( const char* entryPointName, SingleShaderStage stage, PipelineLayout* layout, @@ -322,8 +322,8 @@ namespace dawn_native { namespace d3d12 { std::string remappedEntryPoint; CompiledShader compiledShader = {}; DAWN_TRY_ASSIGN(hlslSource, - TranslateToHLSLWithTint(entryPointName, stage, layout, &remappedEntryPoint, - &compiledShader.firstOffsetInfo)); + TranslateToHLSL(entryPointName, stage, layout, &remappedEntryPoint, + &compiledShader.firstOffsetInfo)); entryPointName = remappedEntryPoint.c_str(); if (device->IsToggleEnabled(Toggle::DumpShaders)) { diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.h b/src/dawn_native/d3d12/ShaderModuleD3D12.h index d1b2a0ac1c..7fbb78a428 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.h +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.h @@ -59,11 +59,11 @@ namespace dawn_native { namespace d3d12 { ~ShaderModule() override = default; MaybeError Initialize(ShaderModuleParseResult* parseResult); - ResultOrError TranslateToHLSLWithTint(const char* entryPointName, - SingleShaderStage stage, - PipelineLayout* layout, - std::string* remappedEntryPointName, - FirstOffsetInfo* firstOffsetInfo) const; + ResultOrError TranslateToHLSL(const char* entryPointName, + SingleShaderStage stage, + PipelineLayout* layout, + std::string* remappedEntryPointName, + FirstOffsetInfo* firstOffsetInfo) const; ResultOrError CreateHLSLKey(const char* entryPointName, SingleShaderStage stage, diff --git a/src/dawn_native/metal/ShaderModuleMTL.h b/src/dawn_native/metal/ShaderModuleMTL.h index a6608bda6e..aced62b004 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.h +++ b/src/dawn_native/metal/ShaderModuleMTL.h @@ -47,15 +47,15 @@ namespace dawn_native { namespace metal { const VertexState* vertexState = nullptr); private: - ResultOrError TranslateToMSLWithTint(const char* entryPointName, - SingleShaderStage stage, - const PipelineLayout* layout, - uint32_t sampleMask, - const RenderPipeline* renderPipeline, - const VertexState* vertexState, - std::string* remappedEntryPointName, - bool* needsStorageBufferLength, - bool* hasInvariantAttribute); + ResultOrError TranslateToMSL(const char* entryPointName, + SingleShaderStage stage, + const PipelineLayout* layout, + uint32_t sampleMask, + const RenderPipeline* renderPipeline, + const VertexState* vertexState, + std::string* remappedEntryPointName, + bool* needsStorageBufferLength, + bool* hasInvariantAttribute); ShaderModule(Device* device, const ShaderModuleDescriptor* descriptor); ~ShaderModule() override = default; MaybeError Initialize(ShaderModuleParseResult* parseResult); diff --git a/src/dawn_native/metal/ShaderModuleMTL.mm b/src/dawn_native/metal/ShaderModuleMTL.mm index 800a3beaf6..917e1e5b7d 100644 --- a/src/dawn_native/metal/ShaderModuleMTL.mm +++ b/src/dawn_native/metal/ShaderModuleMTL.mm @@ -44,16 +44,15 @@ namespace dawn_native { namespace metal { return InitializeBase(parseResult); } - ResultOrError ShaderModule::TranslateToMSLWithTint( - const char* entryPointName, - SingleShaderStage stage, - const PipelineLayout* layout, - uint32_t sampleMask, - const RenderPipeline* renderPipeline, - const VertexState* vertexState, - std::string* remappedEntryPointName, - bool* needsStorageBufferLength, - bool* hasInvariantAttribute) { + ResultOrError ShaderModule::TranslateToMSL(const char* entryPointName, + SingleShaderStage stage, + const PipelineLayout* layout, + uint32_t sampleMask, + const RenderPipeline* renderPipeline, + const VertexState* vertexState, + std::string* remappedEntryPointName, + bool* needsStorageBufferLength, + bool* hasInvariantAttribute) { ScopedTintICEHandler scopedICEHandler(GetDevice()); std::ostringstream errorStream; @@ -187,10 +186,10 @@ namespace dawn_native { namespace metal { std::string remappedEntryPointName; std::string msl; bool hasInvariantAttribute = false; - DAWN_TRY_ASSIGN( - msl, TranslateToMSLWithTint(entryPointName, stage, layout, sampleMask, renderPipeline, - vertexState, &remappedEntryPointName, - &out->needsStorageBufferLength, &hasInvariantAttribute)); + DAWN_TRY_ASSIGN(msl, + TranslateToMSL(entryPointName, stage, layout, sampleMask, renderPipeline, + vertexState, &remappedEntryPointName, + &out->needsStorageBufferLength, &hasInvariantAttribute)); // Metal uses Clang to compile the shader as C++14. Disable everything in the -Wall // category. -Wunused-variable in particular comes up a lot in generated code, and some