Rolling 5 dependencies and fix test slow down

Roll third_party/SPIRV-Tools/ 2e1d208ed..c8590c18b (2 commits)

2e1d208ed9..c8590c18bd

$ git log 2e1d208ed..c8590c18b --date=short --no-merges --format='%ad %ae %s'
2020-05-06 jaebaek Preserve debug info for wrap-opkill (#3331)
2020-05-05 jbolz Validate ShaderCallKHR memory scope (#3332)

Roll third_party/glslang/ b5f003d7a..4fa68edd6 (3 commits)

b5f003d7a3..4fa68edd68

$ git log b5f003d7a..4fa68edd6 --date=short --no-merges --format='%ad %ae %s'
2020-05-12 cepheus Address #2211: Improve the copy constructor of TVarLivePair.
2020-05-11 xilefmai Fix Web build
2020-05-08 sebastian.neubauer Explicitly mark some enums as unsigned

Roll third_party/shaderc/ 15a66d72f..00ac5d821 (4 commits)

15a66d72f3..00ac5d8217

$ git log 15a66d72f..00ac5d821 --date=short --no-merges --format='%ad %ae %s'
2020-05-11 rharrison Rolling 4 dependencies (#1062)
2020-05-11 chinmaygarde Only add -fPIC if supported by the compiler. (#1061)
2020-05-06 rharrison Remove Singleton pattern around access to glslang (#1059)
2020-05-05 rharrison Add .NET bindings to README.md (#1060)

Roll third_party/spirv-cross/ 92f7d36c7..d638d2df9 (4 commits)

92f7d36c72..d638d2df9c

$ git log 92f7d36c7..d638d2df9 --date=short --no-merges --format='%ad %ae %s'
2020-05-08 post Support gl_InstanceID in RT shaders.
2020-05-06 post MSL: Avoid packed arrays in more cases.
2020-05-06 post Add missing reference files from PR merge.
2020-05-06 lehoangq Fix #1359: MSL: If the packed type is scalar, don't emit "pack_" prefix.

Roll third_party/tint/ 1f1f08f94..0bbf1e746 (6 commits)

https://dawn.googlesource.com/tint/+log/1f1f08f94a11..0bbf1e746093

$ git log 1f1f08f94..0bbf1e746 --date=short --no-merges --format='%ad %ae %s'
2020-05-11 rharrison Small fix for BUILD.gn
2020-05-08 dneto Rolling 6 dependencies
2020-05-07 dneto [spirv-reader] Find if-selection internal headers
2020-05-07 dneto [spirv-reader] Rename Edge::kToMerge to kIfBreak
2020-05-07 dneto [spirv-reader] Classify kSwitchBreak from deep in control flow
2020-05-07 dsinclair Rename brace and bracket to match spec

Created with:
  roll-dep third_party/SPIRV-Tools third_party/glslang third_party/shaderc third_party/spirv-cross third_party/spirv-headers third_party/tint

Change-Id: I8d9ca3e29b4fa8907147fffacb3905acd48a9c0b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/21603
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Ryan Harrison <rharrison@chromium.org>
This commit is contained in:
Ryan Harrison 2020-05-12 17:26:42 +00:00 committed by Commit Bot service account
parent 02beecaec5
commit 4fa5ad4bf0
2 changed files with 37 additions and 13 deletions

10
DEPS
View File

@ -61,13 +61,13 @@ deps = {
# SPIRV-Cross
'third_party/spirv-cross': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Cross@92f7d36c72bc3cdbcc4aeff3534d096866013c0c',
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Cross@d638d2df9c8c4a862e0af829cf49cc6dcbb235a2',
'condition': 'dawn_standalone',
},
# SPIRV compiler dependencies: SPIRV-Tools, SPIRV-headers, glslang and shaderc
'third_party/SPIRV-Tools': {
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@2e1d208ed9deab9048a00e60bb891d5e12a8332e',
'url': '{chromium_git}/external/github.com/KhronosGroup/SPIRV-Tools@c8590c18bd0c70dcd1caa7d43c5f2d020439b012',
'condition': 'dawn_standalone',
},
'third_party/spirv-headers': {
@ -75,17 +75,17 @@ deps = {
'condition': 'dawn_standalone',
},
'third_party/glslang': {
'url': '{chromium_git}/external/github.com/KhronosGroup/glslang@b5f003d7a3ece37db45578a8a3140b370036fc64',
'url': '{chromium_git}/external/github.com/KhronosGroup/glslang@4fa68edd68197a8c77779942b5d973f89c621752',
'condition': 'dawn_standalone',
},
'third_party/shaderc': {
'url': '{chromium_git}/external/github.com/google/shaderc@15a66d72f33a099ec65e0fd37cf14548ed1d2bdb',
'url': '{chromium_git}/external/github.com/google/shaderc@00ac5d82178cfb5679fe19194d5794fdb01cdd00',
'condition': 'dawn_standalone',
},
# WGSL support
'third_party/tint': {
'url': '{dawn_git}/tint@1f1f08f94a11f470a4551896df9f610b71876924',
'url': '{dawn_git}/tint@0bbf1e7460936422db9207a73cf987d510a8ae15',
'condition': 'dawn_standalone',
},

View File

@ -61,6 +61,30 @@ namespace utils {
return device.CreateShaderModule(&descriptor);
}
class CompilerSingleton {
public:
static shaderc::Compiler* Get() {
std::call_once(mInitFlag, &CompilerSingleton::Initialize);
return mCompiler;
}
private:
CompilerSingleton() = default;
~CompilerSingleton() = default;
CompilerSingleton(const CompilerSingleton&) = delete;
CompilerSingleton& operator=(const CompilerSingleton&) = delete;
static shaderc::Compiler* mCompiler;
static std::once_flag mInitFlag;
static void Initialize() {
mCompiler = new shaderc::Compiler();
}
};
shaderc::Compiler* CompilerSingleton::mCompiler = nullptr;
std::once_flag CompilerSingleton::mInitFlag;
} // anonymous namespace
wgpu::ShaderModule CreateShaderModule(const wgpu::Device& device,
@ -68,8 +92,8 @@ namespace utils {
const char* source) {
shaderc_shader_kind kind = ShadercShaderKind(stage);
shaderc::Compiler compiler;
auto result = compiler.CompileGlslToSpv(source, strlen(source), kind, "myshader?");
shaderc::Compiler* compiler = CompilerSingleton::Get();
auto result = compiler->CompileGlslToSpv(source, strlen(source), kind, "myshader?");
if (result.GetCompilationStatus() != shaderc_compilation_status_success) {
dawn::ErrorLog() << result.GetErrorMessage();
return {};
@ -77,8 +101,8 @@ namespace utils {
#ifdef DUMP_SPIRV_ASSEMBLY
{
shaderc::CompileOptions options;
auto resultAsm = compiler.CompileGlslToSpvAssembly(source, strlen(source), kind,
"myshader?", options);
auto resultAsm = compiler->CompileGlslToSpvAssembly(source, strlen(source), kind,
"myshader?", options);
size_t sizeAsm = (resultAsm.cend() - resultAsm.cbegin());
char* buffer = reinterpret_cast<char*>(malloc(sizeAsm + 1));
@ -107,8 +131,8 @@ namespace utils {
}
wgpu::ShaderModule CreateShaderModuleFromASM(const wgpu::Device& device, const char* source) {
shaderc::Compiler compiler;
shaderc::SpvCompilationResult result = compiler.AssembleToSpv(source, strlen(source));
shaderc::Compiler* compiler = CompilerSingleton::Get();
shaderc::SpvCompilationResult result = compiler->AssembleToSpv(source, strlen(source));
if (result.GetCompilationStatus() != shaderc_compilation_status_success) {
dawn::ErrorLog() << result.GetErrorMessage();
return {};
@ -120,8 +144,8 @@ namespace utils {
std::vector<uint32_t> CompileGLSLToSpirv(SingleShaderStage stage, const char* source) {
shaderc_shader_kind kind = ShadercShaderKind(stage);
shaderc::Compiler compiler;
auto result = compiler.CompileGlslToSpv(source, strlen(source), kind, "myshader?");
shaderc::Compiler* compiler = CompilerSingleton::Get();
auto result = compiler->CompileGlslToSpv(source, strlen(source), kind, "myshader?");
if (result.GetCompilationStatus() != shaderc_compilation_status_success) {
dawn::ErrorLog() << result.GetErrorMessage();
return {};