Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package shaderc for openSUSE:Factory checked 
in at 2021-03-12 13:31:27
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/shaderc (Old)
 and      /work/SRC/openSUSE:Factory/.shaderc.new.2401 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "shaderc"

Fri Mar 12 13:31:27 2021 rev:9 rq:877955 version:2020.5

Changes:
--------
--- /work/SRC/openSUSE:Factory/shaderc/shaderc.changes  2021-01-15 
19:44:26.649860398 +0100
+++ /work/SRC/openSUSE:Factory/.shaderc.new.2401/shaderc.changes        
2021-03-12 13:31:43.198191206 +0100
@@ -1,0 +2,6 @@
+Mon Mar  1 08:44:37 UTC 2021 - Jan Engelhardt <[email protected]>
+
+- Update to release 2020.5
+  * Support newer glslang
+
+-------------------------------------------------------------------

Old:
----
  v2020.4.tar.gz

New:
----
  v2020.5.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ shaderc.spec ++++++
--- /var/tmp/diff_new_pack.KdhFGO/_old  2021-03-12 13:31:43.878192160 +0100
+++ /var/tmp/diff_new_pack.KdhFGO/_new  2021-03-12 13:31:43.882192166 +0100
@@ -18,7 +18,7 @@
 
 Name:           shaderc
 %define lname libshaderc_shared1
-Version:        2020.4
+Version:        2020.5
 Release:        0
 Summary:        A collection of tools, libraries and tests for shader 
compilation
 License:        Apache-2.0
@@ -30,7 +30,7 @@
 Patch1:         0001-Use-system-third-party-libs.patch
 BuildRequires:  c++_compiler
 BuildRequires:  cmake
-BuildRequires:  glslang-devel >= 8.13.3727+git4
+BuildRequires:  glslang-devel >= 11.1
 BuildRequires:  python-xml
 BuildRequires:  spirv-headers >= 1.5.1.corrected+git24
 BuildRequires:  spirv-tools-devel >= 2020.2

++++++ 0001-Use-system-third-party-libs.patch ++++++
--- /var/tmp/diff_new_pack.KdhFGO/_old  2021-03-12 13:31:43.902192194 +0100
+++ /var/tmp/diff_new_pack.KdhFGO/_new  2021-03-12 13:31:43.902192194 +0100
@@ -1,8 +1,13 @@
-Index: shaderc-2020.4/CMakeLists.txt
+---
+ CMakeLists.txt            |    7 -------
+ libshaderc/CMakeLists.txt |    2 ++
+ 2 files changed, 2 insertions(+), 7 deletions(-)
+
+Index: shaderc-2020.5/CMakeLists.txt
 ===================================================================
---- shaderc-2020.4.orig/CMakeLists.txt
-+++ shaderc-2020.4/CMakeLists.txt
-@@ -102,18 +102,12 @@ endif(MSVC)
+--- shaderc-2020.5.orig/CMakeLists.txt
++++ shaderc-2020.5/CMakeLists.txt
+@@ -112,7 +112,6 @@ endif(MSVC)
  
  # Configure subdirectories.
  # We depend on these for later projects, so they should come first.
@@ -10,21 +15,23 @@
  
  add_subdirectory(libshaderc_util)
  add_subdirectory(libshaderc)
- add_subdirectory(glslc)
- add_subdirectory(examples)
+@@ -121,12 +120,6 @@ if(${SHADERC_ENABLE_EXAMPLES})
+     add_subdirectory(examples)
+ endif()
  
 -add_custom_target(build-version
 -  ${PYTHON_EXECUTABLE}
 -  ${CMAKE_CURRENT_SOURCE_DIR}/utils/update_build_version.py
 -  ${shaderc_SOURCE_DIR} ${spirv-tools_SOURCE_DIR} ${glslang_SOURCE_DIR} 
${CMAKE_CURRENT_BINARY_DIR}/build-version.inc
 -  COMMENT "Update build-version.inc in the Shaderc build directory (if 
necessary).")
- 
+-
  function(define_pkg_config_file NAME LIBS)
    add_custom_target(${NAME}-pkg-config ALL
-Index: shaderc-2020.4/libshaderc/CMakeLists.txt
+     COMMAND ${CMAKE_COMMAND}
+Index: shaderc-2020.5/libshaderc/CMakeLists.txt
 ===================================================================
---- shaderc-2020.4.orig/libshaderc/CMakeLists.txt
-+++ shaderc-2020.4/libshaderc/CMakeLists.txt
+--- shaderc-2020.5.orig/libshaderc/CMakeLists.txt
++++ shaderc-2020.5/libshaderc/CMakeLists.txt
 @@ -66,6 +66,8 @@ set(SHADERC_LIBS
    shaderc_util
    SPIRV # from glslang

++++++ v2020.4.tar.gz -> v2020.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/CHANGES new/shaderc-2020.5/CHANGES
--- old/shaderc-2020.4/CHANGES  2020-12-09 22:30:21.000000000 +0100
+++ new/shaderc-2020.5/CHANGES  2021-02-19 22:08:08.000000000 +0100
@@ -1,5 +1,13 @@
 Revision history for Shaderc
 
+v2020.5 2021-02-19
+ - Refresh dependencies (in DEPS):
+   - SPIRV-Tools v2020.7 + 1 patch
+   - Glslang 11.1.0
+ - Add option to skip building examples
+ - Fixes:
+   #1153: Improve file+line parsing from Glslang messages
+
 v2020.4 2020-12-09
  - Removed svpc
  - Fixed issues with embedders getting duplicate symbols
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/CMakeLists.txt 
new/shaderc-2020.5/CMakeLists.txt
--- old/shaderc-2020.4/CMakeLists.txt   2020-12-09 22:30:21.000000000 +0100
+++ new/shaderc-2020.5/CMakeLists.txt   2021-02-19 22:08:08.000000000 +0100
@@ -40,6 +40,16 @@
   message(STATUS "Configuring Shaderc to avoid building tests.")
 endif()
 
+option(SHADERC_SKIP_EXAMPLES "Skip building examples" ${SHADERC_SKIP_EXAMPLES})
+if(NOT ${SHADERC_SKIP_EXAMPLES})
+  set(SHADERC_ENABLE_EXAMPLES ON)
+endif()
+if(${SHADERC_ENABLE_EXAMPLES})
+  message(STATUS "Configuring Shaderc to build examples.")
+else()
+  message(STATUS "Configuring Shaderc to avoid building examples.")
+endif()
+
 option(SHADERC_ENABLE_WERROR_COMPILE "Enable passing -Werror to compiler, if 
available" ON)
 
 set (CMAKE_CXX_STANDARD 11)
@@ -107,7 +117,9 @@
 add_subdirectory(libshaderc_util)
 add_subdirectory(libshaderc)
 add_subdirectory(glslc)
-add_subdirectory(examples)
+if(${SHADERC_ENABLE_EXAMPLES})
+    add_subdirectory(examples)
+endif()
 
 add_custom_target(build-version
   ${PYTHON_EXECUTABLE}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/DEPS new/shaderc-2020.5/DEPS
--- old/shaderc-2020.4/DEPS     2020-12-09 22:30:21.000000000 +0100
+++ new/shaderc-2020.5/DEPS     2021-02-19 22:08:08.000000000 +0100
@@ -5,11 +5,11 @@
   'khronos_git': 'https://github.com/KhronosGroup',
 
   'effcee_revision' : '2ec8f8738118cc483b67c04a759fee53496c5659',
-  'glslang_revision': 'c594de23cdd790d64ad5f9c8b059baae0ee2941d',
-  'googletest_revision': 'e5644f5f12ff3d5b2232dabc1c5ea272a52e8155',
-  're2_revision': '91420e899889cffd100b70e8cc50611b3031e959',
-  'spirv_headers_revision': 'f027d53ded7e230e008d37c8b47ede7cd308e19d',
-  'spirv_tools_revision': '3b85234542cadf0e496788fcc2f20697152e72f8',
+  'glslang_revision': 'e56beaee736863ce48455955158f1839e6e4c1a1',
+  'googletest_revision': '389cb68b87193358358ae87cc56d257fd0d80189',
+  're2_revision': '7107ebc4fbf7205151d8d2a57b2fc6e7853125d4',
+  'spirv_headers_revision': 'a3fdfe81465d57efc97cfd28ac6c8190fb31a6c8',
+  'spirv_tools_revision': 'ef3290bbea35935ba8fd623970511ed9f045bbd7',
 }
 
 deps = {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/libshaderc/include/shaderc/env.h 
new/shaderc-2020.5/libshaderc/include/shaderc/env.h
--- old/shaderc-2020.4/libshaderc/include/shaderc/env.h 2020-12-09 
22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc/include/shaderc/env.h 2021-02-19 
22:08:08.000000000 +0100
@@ -29,7 +29,8 @@
   shaderc_target_env_opengl_compat,  // SPIR-V under OpenGL semantics,
                                      // including compatibility profile
                                      // functions
-  shaderc_target_env_webgpu,         // SPIR-V under WebGPU semantics
+  shaderc_target_env_webgpu,         // Deprecated, SPIR-V under WebGPU
+                                     // semantics
   shaderc_target_env_default = shaderc_target_env_vulkan
 } shaderc_target_env;
 
@@ -44,9 +45,7 @@
   // See glslang/Standalone/Standalone.cpp
   // TODO(dneto): Glslang doesn't accept a OpenGL client version of 460.
   shaderc_env_version_opengl_4_5 = 450,
-  // Currently WebGPU doesn't have versioning, since it isn't finalized. This
-  // will have to be updated once the spec is finished.
-  shaderc_env_version_webgpu,
+  shaderc_env_version_webgpu,  // Deprecated, WebGPU env never defined versions
 } shaderc_env_version;
 
 // The known versions of SPIR-V.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/libshaderc/src/shaderc.cc 
new/shaderc-2020.5/libshaderc/src/shaderc.cc
--- old/shaderc-2020.4/libshaderc/src/shaderc.cc        2020-12-09 
22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc/src/shaderc.cc        2021-02-19 
22:08:08.000000000 +0100
@@ -279,7 +279,8 @@
     case shaderc_target_env_opengl_compat:
       return shaderc_util::Compiler::TargetEnv::OpenGLCompat;
     case shaderc_target_env_webgpu:
-      return shaderc_util::Compiler::TargetEnv::WebGPU;
+      assert(false);
+      break;
     case shaderc_target_env_vulkan:
     default:
       break;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/shaderc-2020.4/libshaderc_util/include/libshaderc_util/compiler.h 
new/shaderc-2020.5/libshaderc_util/include/libshaderc_util/compiler.h
--- old/shaderc-2020.4/libshaderc_util/include/libshaderc_util/compiler.h       
2020-12-09 22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc_util/include/libshaderc_util/compiler.h       
2021-02-19 22:08:08.000000000 +0100
@@ -76,7 +76,6 @@
     Vulkan,        // Default to Vulkan 1.0
     OpenGL,        // Default to OpenGL 4.5
     OpenGLCompat,  // Deprecated.
-    WebGPU,
   };
 
   // Target environment versions.  These numbers match those used by Glslang.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/shaderc-2020.4/libshaderc_util/include/libshaderc_util/message.h 
new/shaderc-2020.5/libshaderc_util/include/libshaderc_util/message.h
--- old/shaderc-2020.4/libshaderc_util/include/libshaderc_util/message.h        
2020-12-09 22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc_util/include/libshaderc_util/message.h        
2021-02-19 22:08:08.000000000 +0100
@@ -53,6 +53,9 @@
 //   source_name="", line_number="", rest="Message"
 // "ERROR: 2 errors found."
 //   source_name="2", line_number="", rest="errors found".
+//
+// Note that filenames can contain colons:
+//   "ERROR: foo:bar.comp.hlsl:2: 'a' : unknown variable"
 MessageType ParseGlslangOutput(const shaderc_util::string_piece& message,
                                bool warnings_as_errors, bool suppress_warnings,
                                shaderc_util::string_piece* source_name,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/shaderc-2020.4/libshaderc_util/include/libshaderc_util/spirv_tools_wrapper.h
 
new/shaderc-2020.5/libshaderc_util/include/libshaderc_util/spirv_tools_wrapper.h
--- 
old/shaderc-2020.4/libshaderc_util/include/libshaderc_util/spirv_tools_wrapper.h
    2020-12-09 22:30:21.000000000 +0100
+++ 
new/shaderc-2020.5/libshaderc_util/include/libshaderc_util/spirv_tools_wrapper.h
    2021-02-19 22:08:08.000000000 +0100
@@ -46,7 +46,6 @@
   kLegalizationPasses,
   kPerformancePasses,
   kSizePasses,
-  kVulkanToWebGPUPasses,
 
   // SPIRV-Tools specific passes
   kNullPass,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/libshaderc_util/src/compiler.cc 
new/shaderc-2020.5/libshaderc_util/src/compiler.cc
--- old/shaderc-2020.4/libshaderc_util/src/compiler.cc  2020-12-09 
22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc_util/src/compiler.cc  2021-02-19 
22:08:08.000000000 +0100
@@ -84,7 +84,6 @@
     case Compiler::TargetEnv::OpenGL:
       result = static_cast<EShMessages>(result | EShMsgSpvRules);
       break;
-    case Compiler::TargetEnv::WebGPU:
     case Compiler::TargetEnv::Vulkan:
       result =
           static_cast<EShMessages>(result | EShMsgSpvRules | 
EShMsgVulkanRules);
@@ -184,17 +183,9 @@
   std::vector<uint32_t>& compilation_output_data = std::get<1>(result_tuple);
   size_t& compilation_output_data_size_in_bytes = std::get<2>(result_tuple);
 
-  // glslang doesn't currently support WebGPU, so we need to fake it by having
-  // it generate Vulkan1.1 and then use spirv-opt later to convert to WebGPU.
-  bool is_webgpu = target_env_ == Compiler::TargetEnv::WebGPU;
-  TargetEnv internal_target_env =
-      !is_webgpu ? target_env_ : Compiler::TargetEnv::Vulkan;
-  TargetEnvVersion internal_target_env_version =
-      !is_webgpu ? target_env_version_ : 
Compiler::TargetEnvVersion::Vulkan_1_1;
-
   // Check target environment.
   const auto target_client_info = GetGlslangClientInfo(
-      error_tag, internal_target_env, internal_target_env_version,
+      error_tag, target_env_, target_env_version_,
       target_spirv_version_, target_spirv_version_is_forced_);
   if (!target_client_info.error.empty()) {
     *error_stream << target_client_info.error;
@@ -297,7 +288,7 @@
   shader.setNanMinMaxClamp(nan_clamp_);
 
   const EShMessages rules =
-      GetMessageRules(internal_target_env, source_language_, hlsl_offsets_,
+      GetMessageRules(target_env_, source_language_, hlsl_offsets_,
                       generate_debug_info_);
 
   bool success = shader.parse(&limits_, default_version_, default_profile_,
@@ -347,14 +338,9 @@
   opt_passes.insert(opt_passes.end(), enabled_opt_passes_.begin(),
                     enabled_opt_passes_.end());
 
-  // WebGPU goes last, since it is converting the env.
-  if (is_webgpu) {
-    opt_passes.push_back(PassId::kVulkanToWebGPUPasses);
-  }
-
   if (!opt_passes.empty()) {
     std::string opt_errors;
-    if (!SpirvToolsOptimize(internal_target_env, internal_target_env_version,
+    if (!SpirvToolsOptimize(target_env_, target_env_version_,
                             opt_passes, &spirv, &opt_errors)) {
       *error_stream << "shaderc: internal error: compilation succeeded but "
                        "failed to optimize: "
@@ -365,8 +351,6 @@
 
   if (output_type == OutputType::SpirvAssemblyText) {
     std::string text_or_error;
-    // spirv-tools does know about WebGPU, so don't need to punt to Vulkan1.1
-    // here.
     if (!SpirvToolsDisassemble(target_env_, target_env_version_, spirv,
                                &text_or_error)) {
       *error_stream << "shaderc: internal error: compilation succeeded but "
@@ -464,14 +448,6 @@
 std::tuple<bool, std::string, std::string> Compiler::PreprocessShader(
     const std::string& error_tag, const string_piece& shader_source,
     const string_piece& shader_preamble, CountingIncluder& includer) const {
-  // glslang doesn't currently support WebGPU, so we need to fake it by having
-  // it generate Vulkan1.1 and then use spirv-opt later to convert to WebGPU.
-  bool is_webgpu = target_env_ == Compiler::TargetEnv::WebGPU;
-  TargetEnv internal_target_env =
-      !is_webgpu ? target_env_ : Compiler::TargetEnv::Vulkan;
-  TargetEnvVersion internal_target_env_version =
-      !is_webgpu ? target_env_version_ : 
Compiler::TargetEnvVersion::Vulkan_1_1;
-
   // The stage does not matter for preprocessing.
   glslang::TShader shader(EShLangVertex);
   const char* shader_strings = shader_source.data();
@@ -481,7 +457,7 @@
                                        &string_names, 1);
   shader.setPreamble(shader_preamble.data());
   auto target_client_info = GetGlslangClientInfo(
-      error_tag, internal_target_env, internal_target_env_version,
+      error_tag, target_env_, target_env_version_,
       target_spirv_version_, target_spirv_version_is_forced_);
   if (!target_client_info.error.empty()) {
     return std::make_tuple(false, "", target_client_info.error);
@@ -499,7 +475,7 @@
   // flag.
   const auto rules = static_cast<EShMessages>(
       EShMsgOnlyPreprocessor |
-      GetMessageRules(internal_target_env, source_language_, hlsl_offsets_,
+      GetMessageRules(target_env_, source_language_, hlsl_offsets_,
                       false));
 
   std::string preprocessed_shader;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/libshaderc_util/src/message.cc 
new/shaderc-2020.5/libshaderc_util/src/message.cc
--- old/shaderc-2020.4/libshaderc_util/src/message.cc   2020-12-09 
22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc_util/src/message.cc   2021-02-19 
22:08:08.000000000 +0100
@@ -45,41 +45,72 @@
 }
 
 // Deduces a location specification from the given message. A location
-// specification is of the form "<source-name>:<line-number>:". If the 
deduction
-// is successful, returns true and updates source_name and line_number to the
-// deduced source name and line numer respectively. The prefix standing for the
-// location specification in message is skipped. Otherwise, returns false and
-// keeps all parameters untouched.
+// specification is of the form "<source-name>:<line-number>:" and a trailing
+// space.  If the deduction is successful, returns true and updates source_name
+// and line_number to the deduced source name and line numer respectively. The
+// prefix standing for the location specification in message is skipped.
+// Otherwise, returns false and keeps all parameters untouched.
 bool DeduceLocationSpec(string_piece* message, string_piece* source_name,
                         string_piece* line_number) {
-  // TODO(antiagainst): we use ':' as a delimiter here. It may be a valid
-  // character in the filename. Also be aware of other special characters,
-  // for example, ' '.
-  string_piece rest(*message);
-  size_t colon_after_source = rest.find_first_of(':');
-  if (colon_after_source == string_piece::npos) return false;
-
-  string_piece source = rest.substr(0, colon_after_source);
-  rest = rest.substr(colon_after_source + 1);
-  size_t colon_after_line = rest.find_first_of(':');
-  if (source.size() == 1 && ::isalpha(source.front()) && rest.size() > 0 &&
-      rest.front() == '\\') {
-    // Handle Windows path.
-    colon_after_source += colon_after_line + 1;
-    source = message->substr(0, colon_after_source);
-    rest = rest.substr(colon_after_line + 1);
-    colon_after_line = rest.find_first_of(':');
+  if (!message || message->empty()) {
+    return false;
   }
 
-  if (colon_after_line == string_piece::npos) return false;
-  const string_piece line = rest.substr(0, colon_after_line);
-
-  if (!std::all_of(line.begin(), line.end(), ::isdigit)) return false;
+  // When we find a pattern like this:
+  //     colon
+  //     digits
+  //     colon
+  //     space
+  // Then deduce that the source_name is the text before the first colon,
+  // the line number is the digits, and the message is the text after the
+  // second colon.
+
+  const size_t size = message->size();
+  if (size <= 4) {
+    // A valid message must have a colon, a digit, a colon, and a space.
+    return false;
+  }
+  // The last possible position of the first colon.
+  const size_t first_colon_cutoff = size - 4;
+  // The last possible position of the second colon.
+  const size_t next_colon_cutoff = size - 2;
+
+  for (size_t first_colon_pos = message->find_first_of(':'), next_colon_pos = 
0;
+
+       // There is a first colon, and it's not too close to the end
+       (first_colon_pos != string_piece::npos) &&
+       (first_colon_pos <= first_colon_cutoff);
+
+       // Try the next pair of colons.
+       first_colon_pos = next_colon_pos) {
+    // We're guaranteed to have at least 3 more characters.
+    // Guarantee progress toward the end of the string.
+    next_colon_pos = message->find_first_of(':', first_colon_pos + 1);
+    if ((next_colon_pos == string_piece::npos) ||
+        (next_colon_pos > next_colon_cutoff)) {
+      // No valid solution.
+      return false;
+    }
+    if (first_colon_pos + 1 == next_colon_pos) {
+      // There is no room for digits.
+      continue;
+    }
+    if ((message->data()[next_colon_pos + 1] != ' ')) {
+      // There is no space character after the second colon.
+      continue;
+    }
+    if (message->find_first_not_of("0123456789", first_colon_pos + 1) ==
+        next_colon_pos) {
+      // We found the first solution.
+      *source_name = message->substr(0, first_colon_pos);
+      *line_number = message->substr(first_colon_pos + 1,
+                                     next_colon_pos - 1 - first_colon_pos);
+      *message = message->substr(next_colon_pos + 2);
+      return true;
+    }
+  }
 
-  *source_name = source;
-  *line_number = line;
-  *message = rest.substr(colon_after_line + 1).strip_whitespace();
-  return true;
+  return false;
 }
 
 // Returns true if the given message is a summary message.
@@ -114,6 +145,8 @@
   // <location-specification> is of the form:
   //   <filename-or-string-number>:<line-number>:
   // It doesn't exist if the warning/error message is a global one.
+  //
+  // See Glslang's TInfoSink class implementation for details.
 
   bool is_error = false;
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/shaderc-2020.4/libshaderc_util/src/message_test.cc 
new/shaderc-2020.5/libshaderc_util/src/message_test.cc
--- old/shaderc-2020.4/libshaderc_util/src/message_test.cc      2020-12-09 
22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc_util/src/message_test.cc      2021-02-19 
22:08:08.000000000 +0100
@@ -135,6 +135,8 @@
   string_piece line_number;
   string_piece rest;
 
+  // Glslang reading from strings can give string segment numbers as
+  // the filename part.
   EXPECT_EQ(
       MessageType::Error,
       ParseGlslangOutput("ERROR: 0:2: '#' : invalid directive: foo", false,
@@ -154,7 +156,7 @@
             rest.str());
 }
 
-TEST(ParseGlslangOutputTest, FileName) {
+TEST(ParseGlslangOutputTest, FileName_BaseAndExtension) {
   string_piece source_name;
   string_piece line_number;
   string_piece rest;
@@ -165,6 +167,12 @@
   EXPECT_EQ("shader.vert", source_name.str());
   EXPECT_EQ("5", line_number.str());
   EXPECT_EQ("something wrong", rest.str());
+}
+
+TEST(ParseGlslangOutputTest, FileName_BaseOnly) {
+  string_piece source_name;
+  string_piece line_number;
+  string_piece rest;
 
   EXPECT_EQ(MessageType::Warning,
             ParseGlslangOutput("WARNING: file:42: something wrong", false,
@@ -172,6 +180,12 @@
   EXPECT_EQ("file", source_name.str());
   EXPECT_EQ("42", line_number.str());
   EXPECT_EQ("something wrong", rest.str());
+}
+
+TEST(ParseGlslangOutputTest, FileName_HexNumber) {
+  string_piece source_name;
+  string_piece line_number;
+  string_piece rest;
 
   EXPECT_EQ(MessageType::Warning,
             ParseGlslangOutput("WARNING: 0xdeedbeef:0: wa:ha:ha", false, false,
@@ -181,6 +195,60 @@
   EXPECT_EQ("wa:ha:ha", rest.str());
 }
 
+TEST(ParseGlslangOutputTest, FileName_ContainsColons) {
+  string_piece source_name;
+  string_piece line_number;
+  string_piece rest;
+
+  EXPECT_EQ(MessageType::Warning,
+            ParseGlslangOutput("WARNING:  foo:bar:0: wa:ha:ha", false, false,
+                               &source_name, &line_number, &rest));
+  EXPECT_EQ("foo:bar", source_name.str());
+  EXPECT_EQ("0", line_number.str());
+  EXPECT_EQ("wa:ha:ha", rest.str());
+}
+
+TEST(ParseGlslangOutputTest, NoFile) {
+  string_piece source_name;
+  string_piece line_number;
+  string_piece rest;
+
+  EXPECT_EQ(MessageType::Warning,
+            ParseGlslangOutput("WARNING:  :12: abc", false, false, 
&source_name,
+                               &line_number, &rest));
+  EXPECT_EQ("", source_name.str());
+  EXPECT_EQ("12", line_number.str());
+  EXPECT_EQ("abc", rest.str());
+}
+
+TEST(ParseGlslangOutputTest, NoLineNumber_InferredAsGlobalNoLocation) {
+  string_piece source_name;
+  string_piece line_number;
+  string_piece rest;
+
+  // No solution since there is no room for digits.
+  EXPECT_EQ(MessageType::GlobalWarning,
+            ParseGlslangOutput("WARNING:  foo:: abc", false, false,
+                               &source_name, &line_number, &rest));
+  EXPECT_EQ("", source_name.str());
+  EXPECT_EQ("", line_number.str());
+  EXPECT_EQ("foo:: abc", rest.str());
+}
+
+TEST(ParseGlslangOutputTest, NoSpaceAfterColon_InferredAsGlobalNoLocation) {
+  string_piece source_name;
+  string_piece line_number;
+  string_piece rest;
+
+  // No solution since there is no space after the line-number-and-colon.
+  EXPECT_EQ(MessageType::GlobalWarning,
+            ParseGlslangOutput("WARNING:  foo:12:abc", false, false,
+                               &source_name, &line_number, &rest));
+  EXPECT_EQ("", source_name.str());
+  EXPECT_EQ("", line_number.str());
+  EXPECT_EQ("foo:12:abc", rest.str());
+}
+
 TEST(ParseGlslangOutputTest, WindowsPath) {
   string_piece source_name;
   string_piece line_number;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/shaderc-2020.4/libshaderc_util/src/spirv_tools_wrapper.cc 
new/shaderc-2020.5/libshaderc_util/src/spirv_tools_wrapper.cc
--- old/shaderc-2020.4/libshaderc_util/src/spirv_tools_wrapper.cc       
2020-12-09 22:30:21.000000000 +0100
+++ new/shaderc-2020.5/libshaderc_util/src/spirv_tools_wrapper.cc       
2021-02-19 22:08:08.000000000 +0100
@@ -45,8 +45,6 @@
       return SPV_ENV_OPENGL_4_5;
     case Compiler::TargetEnv::OpenGLCompat:  // Deprecated
       return SPV_ENV_OPENGL_4_5;
-    case Compiler::TargetEnv::WebGPU:
-      return SPV_ENV_WEBGPU_0;
   }
   assert(false && "unexpected target environment or version");
   return SPV_ENV_VULKAN_1_0;
@@ -145,9 +143,6 @@
       case PassId::kSizePasses:
         optimizer.RegisterSizePasses();
         break;
-      case PassId::kVulkanToWebGPUPasses:
-        optimizer.RegisterVulkanToWebGPUPasses();
-        break;
       case PassId::kNullPass:
         // We actually don't need to do anything for null pass.
         break;

Reply via email to