diff --git a/.gitignore b/.gitignore index 91cbb3d..2a1cdce 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /shaderc-7d8582b.tar.gz /shaderc-34c412f.tar.gz /shaderc-f76bb2f.tar.gz +/shaderc-7c2aa93.tar.gz diff --git a/0001-Fix-SPIRV-includes-location.patch b/0001-Fix-SPIRV-includes-location.patch deleted file mode 100644 index 1b9307f..0000000 --- a/0001-Fix-SPIRV-includes-location.patch +++ /dev/null @@ -1,73 +0,0 @@ -From eb3e5917134ec42590e6a27dea7b75b870b22d38 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Robert-Andr=C3=A9=20Mauchin?= -Date: Sun, 2 Feb 2020 23:03:53 +0100 -Subject: [PATCH] Fix SPIRV includes location -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -SPIRV includes have been moved under glslang/ in the latest version. - -Signed-off-by: Robert-André Mauchin ---- - libshaderc/src/shaderc.cc | 2 +- - libshaderc/src/shaderc_cpp_test.cc | 2 +- - libshaderc/src/shaderc_test.cc | 2 +- - libshaderc_util/src/compiler.cc | 2 +- - 4 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc -index fe57c76..82c47ef 100644 ---- a/libshaderc/src/shaderc.cc -+++ b/libshaderc/src/shaderc.cc -@@ -20,7 +20,7 @@ - #include - #include - --#include "SPIRV/spirv.hpp" -+#include "glslang/SPIRV/spirv.hpp" - - #include "libshaderc_util/compiler.h" - #include "libshaderc_util/counting_includer.h" -diff --git a/libshaderc/src/shaderc_cpp_test.cc b/libshaderc/src/shaderc_cpp_test.cc -index 407d8f4..addb347 100644 ---- a/libshaderc/src/shaderc_cpp_test.cc -+++ b/libshaderc/src/shaderc_cpp_test.cc -@@ -18,7 +18,7 @@ - #include - #include - --#include "SPIRV/spirv.hpp" -+#include "glslang/SPIRV/spirv.hpp" - #include "spirv-tools/libspirv.hpp" - - #include "common_shaders_for_test.h" -diff --git a/libshaderc/src/shaderc_test.cc b/libshaderc/src/shaderc_test.cc -index a54b87c..cab5224 100644 ---- a/libshaderc/src/shaderc_test.cc -+++ b/libshaderc/src/shaderc_test.cc -@@ -18,7 +18,7 @@ - #include - #include - --#include "SPIRV/spirv.hpp" -+#include "glslang/SPIRV/spirv.hpp" - - #include "common_shaders_for_test.h" - #include "shaderc/shaderc.h" -diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc -index 1809eab..a485b12 100644 ---- a/libshaderc_util/src/compiler.cc -+++ b/libshaderc_util/src/compiler.cc -@@ -19,7 +19,7 @@ - #include - #include - --#include "SPIRV/GlslangToSpv.h" -+#include "glslang/SPIRV/GlslangToSpv.h" - #include "libshaderc_util/format.h" - #include "libshaderc_util/io.h" - #include "libshaderc_util/message.h" --- -2.24.1 - diff --git a/0001-Handle-new-Glslang-profile-enum-in-switch.patch b/0001-Handle-new-Glslang-profile-enum-in-switch.patch deleted file mode 100644 index 4400bac..0000000 --- a/0001-Handle-new-Glslang-profile-enum-in-switch.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 3d99fad173cc0c00d370eeb6663784fc67efd480 Mon Sep 17 00:00:00 2001 -From: David Neto -Date: Fri, 24 Jan 2020 15:41:21 -0500 -Subject: [PATCH] Handle new Glslang profile enum in switch (#973) - -* Handle new Glslang profile enum in switch ---- - libshaderc/src/shaderc.cc | 1 + - 1 files changed, 1 insertions(+), 0 deletion(-) - -diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc -index abbab548..fe57c76b 100644 ---- a/libshaderc/src/shaderc.cc -+++ b/libshaderc/src/shaderc.cc -@@ -779,6 +779,7 @@ bool shaderc_parse_version_profile(const char* str, int* version, - *profile = shaderc_profile_none; - return true; - case EBadProfile: -+ case EProfileCount: - return false; - } - diff --git a/0001-Rolling-5-dependencies-and-fixing-build.patch b/0001-Rolling-5-dependencies-and-fixing-build.patch new file mode 100644 index 0000000..9c68d57 --- /dev/null +++ b/0001-Rolling-5-dependencies-and-fixing-build.patch @@ -0,0 +1,25 @@ +From e27b4381be1af80b4cadd74b7357a1895721121a Mon Sep 17 00:00:00 2001 +From: Ryan Harrison +Date: Mon, 4 May 2020 14:17:34 -0400 +Subject: [PATCH] Rolling 5 dependencies and fixing build + +Roll third_party/glslang/ f03cb290a..b5f003d7a (7 commits) + +Fixes #1056 +--- + libshaderc_util/src/resources.cc | 2 +- + 2 files changed, 1 insertions(+), 1 deletions(-) + +diff --git a/libshaderc_util/src/resources.cc b/libshaderc_util/src/resources.cc +index 458a63f5..d64e47fa 100644 +--- a/libshaderc_util/src/resources.cc ++++ b/libshaderc_util/src/resources.cc +@@ -125,7 +125,7 @@ const TBuiltInResource kDefaultTBuiltInR + /* .maxTaskWorkGroupSizeY_NV = */ 1, + /* .maxTaskWorkGroupSizeZ_NV = */ 1, + /* .maxMeshViewCountNV = */ 4, +- /* .maxDualSourceDrawBuffersEXT = */ 1, ++ + // This is the glslang TLimits structure. + // It defines whether or not the following features are enabled. + // We want them to all be enabled. diff --git a/CHANGES b/CHANGES new file mode 100644 index 0000000..ff3ef43 --- /dev/null +++ b/CHANGES @@ -0,0 +1,223 @@ +Revision history for Shaderc + +v2020.1 2020-06-09 + This is the last version that officially supports VS2013. + + - General: + - Added warning signs about unsupported downloads (#1041) + - Added .NET bindings to README.md (#1060) + - Only add -fPIC if supported by the compiler. (#1061) + + - glslc, libshaderc: + - Removed Singleton pattern around access to glslang (#1059) + + - spvc: + - Added concept of comparison sampler to API (#1036) + - Added support for options.hlsl.nonwritable_uav_texture_as_srv (#1048) + - Support forcing storage buffers to be always declared as UAV. (#1076) + +v2020.0 2020-03-06 + - General: + - Getting spirv.hpp from SPIRV-Headers instead of not glslang (#992) + - Added clarification about status of artifacts in downloads.md (#1012) + + - glslc, libshaderc: + - Added support for new Glslang profile enum, EProfileCount (#973) + - Updated user documentation for -S in glslc (#978) + - Add documentation for Vulkan 1.2 and SPIR-V 1.5 (#980) + - Removed NV_EXTENSIONS conditionals (#1003) + - Added support for generating WebGPU SPIR-V to libshaderc (#1021) + - Rolled in all DEPS for provisional SPIR-V extensions for raytracing + + - spvc: + - Normalized API behaviour (#967) + - Added source_set target for libshaderc_spvc (#976) + - Added in support for spvc logging to the terminal (#981) + - Internal refactoring to reduce boiler plate in API implementations (#984) + - Added newline to logging messages to make them readable (#985) + - Added reflection support for Dawn: + - storage textures (#1001) + - storage texture format (#1005) + - texture dimension for storage textures (#1008) + - is storage texture declared as multisampled texture (#1011) + - Converted compile options to require explicit environments (#1019) + - Added knob to control force_zero_initialized_variables in SPIRV-Cross (#1028) + +v2019.1 2020-01-22 + - glslc, libshaderc: + - Add -fnan-clamp: Generate code for max and min builtins so that, + given a NaN operand, will return the other operand. Similarly, the + clamp builtin favours non-NaN operands, as if clamp was implemented + as the composition of max and min. + - Add -finvert-y + - Using SetBeforeHlslLegalization for more relaxed validation rules + - Added support for SPIR-V 1.5 + - Add --emit-line-directive option + - Added support for Vulkan 1.2 + - spvc: + - Add many options: + --flatten-multidimensional-arrays + --es + --no-es + --glsl-emit-push-constant-as-ubo + --msl-swizzle-texture-samples + --msl-platform=ios|macos + --msl-pad-fragment-output + --msl-capture-output + --msl-domain-lower-left + --msl-argument-buffers + --msl-discrete-descriptor-set= + --hlsl-enable-compat + - Reintroduce shaderc_spvc_compile_options_set_shader_model + - Added option to inject robust buffer access code + - Added support for emitting ToVulkan shaders + - Added spirv-opt based IR generation as alternative to built in spirv_cross IR gen + - Added API for specifying source and target execution environments + - Added option & reflection API methods neede by Dawn + - Substantial internal refactoring and code cleanup + - Large number of breaking changes to the API + - Replaced shaderc_spvc_compile_options_set_shader_model with + shaderc_spvc_compile_options_set_hlsl_shader_model + - Compiler initialization and shader generation moved into seperate calls + - Seperated return codes from shaderc ones + - Many small API changes + - Improvements to testing + - Refactoring and clean up of run_spirv_cross_tests.py + - Seperation of expectations into known failures, known invalids, and cases + that need investigation + - Tweaks and fixes to substantially increase passing cases + - Added support for running tests using spvc IR generation + - Infrastructure + - Update DEPS with cross-verified commits from associated repos. + - Add utils/roll-deps + - Infrastructure: + - Removed Appveyor artifacts link + - Improvements and clean up of DEPS rolling scripts + - Enabled warnings about implicit fallthrough + - Enabled improper semicolon warnings + - Restricted -fPIC to platforms that support it + - Converted remaining scripts to use Python 3 + - Replaced nosetest with unittest + - Removed assumptions aabout location of spirv-tools, effcee, and RE2 + - Migrated BUILD.gn spirv_cross dependency to local repo + - Fixes: + - Fix duplicate install paths when using VisualStudio + - Fixed BUILD.gn for Chromium, Dawn & Fuchsia + - Explicitly enabled HLSL support in glslang + - Added installing necessary headers in Android.mk + - Removed unsupported Unicode characters + - Fixed detection of spirv-headers directory + #666: Update Docker file to use Python3 + +v2019.0 2019-06-04 + - Add optional spvc, libshaderc_spvc as wrapper around SPIRV-Cross: + - Rejects bad modules by running the SPIR-V validator first + - Skips exception-heavy SPIRV-Cross SPIR-V parser + - Support NV extensions for shader stages + - Require SPIRV-Tools and SPIRV-Headers with SPIR-V 1.4 support + Build support: + - Use KhronosGroup/glslang instead of google/glslang + - Stop running tests on VS 2013 (googletest no longer supports VS2013) + - Require Python3 for building + - Support Chromium's GN build system + - Kokoro build fixes + - Cmake build fixes: Only build subdirs if those targets are not yet defined + - Use Android.mk from Glslang + - Dockerfile gets re2 and effcee sources + - Fixes for newer googletest + - Add address sanitizer presubmit bot + - Generate config files for pkg-config + Spvc: + - Add option to specify source environment. Spvc will transform from source + to target environment if they are different. This only works for WebGPU0 + and Vulkan 1.1. + Fixes: + #499: In HLSL compilation, relax layout and logical pointer validation rules + prior to running the legalization recipe. + +v2018.0 2018-10-01 + - Support -fhlsl_functionality1 (also -fhlsl-functionality1) + - Support NVIDIA Turing extensions. Requires updated Glslang and SPIRV-Tools. + - Use SPIR-V optimization and HLSL legalization recipes from SPIRV-Tools. + - Pass target environment into SPIRV-Tools code, e.g. from --target-env vulkan1.1 + - Add SONAME=1 property to shared library + - Support GN build for Chromium + Fixes: + #469: Add virtual dtor to classes with virtual functions. + #457: Fix writing SPIR-V binaries to standard output on Windows. + +v2017.2 2018-02-27 + - Add a shared library version of libshaderc + - Support GLSL 4.6 and ESSL 3.2 + - Fail compilation if a resource does not have a binding. + - Add options for automatically setting bindings for (uniform) resources that + don't have bindings set in shader source. + - Add options for automatically setting locations for pipline inputs and outputs. + - Add option for using HLSL IO mappings as expressed in source. + - Add options for setting resource binding base numbers. + - Add option to use HLSL resource register numbers for bindings. + - HLSL compilation now defaults to HLSL packing rules. + (This change is inherited from Glslang commit 7cca140.) + - HLSL compilation runs SPIR-V "legalization" transforms to reduce + manipulation of opaque handles (e.g. images), to satisfy Vulkan rules. + - Adapt to Glslang generator version numbers: + - To 2: a fix for code generation for atomicCounterDecrement. + - To 3: change memory barrier semantics masks + - To 4: generate more access chains for swizzles + - CMake install rules uses GNUInstallDirs. For example, install to lib64 + when that is the norm for the target system. + +v2017.1 2017-03-10 + - Add option to automatically assign bindings to uniform variables + that don't have an explicit 'binding' layout in the shader source. + - Enable NVIDIA extensions by default in GLSL compilation + - README mentions language bindings provided by 3rd parties. + - README describes the known-good branch on GitHub + - Fixed examples in shaderc.h; added C API use to examples/online-compile + - Fixes issues: + #289: Don't output an object file when compilation fails. + #296: Enable use of the CMake in Android Studio. + +v2016.2 2016-12-13 + - Describe Shaderc's level of stability. + - Support HLSL compilation, exposing functionality in Glslang. + - Supported in C, C++ API + - glslc accepts "-x hlsl", and assumes .hlsl files are HLSL. + - glslc accepts "-fentry-point=" to set entry point name, + overriding default value "main". + - Support setting shader resource limits in C, C++ APIs, and in + glslc + - glslc adds -flimit= + - glslc adds --show-limits to display defaults and valid resource + limit syntax. + - glslc adds "-flimit-file " support to read Glslang resource + configuration files, i.e. the output of "glslangValidator -c". + - Enable AMD extensions by default in GLSL compilation + - Fixes issues: + #281: Work around Android build issue with abspath on Windows + #283: Increase default maxDrawBuffers to 4, to match Vulkan/GLES3.0 + +v2016.1 2016-10-12 + - C API for assembling now takes an options object + - Support compilation options to optimize for size. + - Maintain compatibility with recent SPIRV-Tools and Glslang versions. + - Update examples. + - Build cleanups. + - Fixes issues: + #238: Fix invocation of python scripts during build + +v2016.0 2016-07-07 + + - Adds v. versioning, with "-dev" suffix to indicate work in + progress. The intent is to summarize and report functionalities more easily + for incorporating into downstream projects. + + - Summary of functionalities (See the README.md for more details): + - Provides libraries and command line tools for generating SPIR-V modules + - Supports GLSL source code or SPIR-V assembly as input + - Supports SPIR-V binary or assembly text as output + - Command line options follow GCC/Clang conventions + - Supports various semantics (OpenGL, OpenGL Compatible and Vulkan) + - Supports #include + - Supports user-defined macros + - Supports dependency information dumping diff --git a/shaderc.spec b/shaderc.spec index e8fd0c0..528e7a5 100644 --- a/shaderc.spec +++ b/shaderc.spec @@ -1,15 +1,13 @@ -# Release 2019.1 -%global commit f76bb2f09f858c3014b329961d836964e515095d +# Release 2020.1 +%global commit 7c2aa93903558f017f31b35df163bce5fe849f45 %global shortcommit %(c=%{commit}; echo ${c:0:7}) -%global snapshotdate 20200202 -%global gitversion v2019.1 +%global snapshotdate 20200617 -# Need to keep this in sync with spirv-tools -%global spirv_commit dc77030acc9c6fe7ca21fff54c5a9d7b532d7da6 -%global spirv_version v1.5.1 +# Glslang revision from packaged version +%global glslang_version SDK-candidate-2-11-gc9b28b9f Name: shaderc -Version: 2019.1 +Version: 2020.1 Release: 1%{?dist} Summary: A collection of tools, libraries, and tests for Vulkan shader compilation @@ -21,10 +19,8 @@ Source0: %url/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Patch0: https://patch-diff.githubusercontent.com/raw/google/shaderc/pull/463.patch#/0001-Fix-the-link-order-of-libglslang-and-libHLSL.patch # Patch to unbundle 3rd party code Patch1: 0001-Drop-third-party-code-in-CMakeLists.txt.patch -# SPIRV includes have been moved under glslang/ in the latest version. -Patch2: 0001-Fix-SPIRV-includes-location.patch -# Handle new Glslang profile enum in switch -Patch3: 0001-Handle-new-Glslang-profile-enum-in-switch.patch +# Fix bug in latest version (to drop in next version) +Patch2: 0001-Rolling-5-dependencies-and-fixing-build.patch BuildRequires: cmake3 BuildRequires: gcc-c++ @@ -83,11 +79,14 @@ rm -rf third_party # Stolen from Gentoo # Create build-version.inc since we want to use our packaged # SPIRV-Tools and glslang -echo \"shaderc $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\?' CHANGES) %{gitversion}\" \ +echo \"shaderc $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\? [[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}$' CHANGES)\" \ > glslc/src/build-version.inc -echo \"spirv-tools $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\?' /usr/share/doc/spirv-tools/CHANGES) %{spirv_version}\" \ +echo \"spirv-tools $(grep -m1 -o '^v[[:digit:]]\{4\}\.[[:digit:]]\(-dev\)\? [[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}$' /usr/share/doc/spirv-tools/CHANGES)\" \ >> glslc/src/build-version.inc -echo \"glslang \'\'\" >> glslc/src/build-version.inc +echo \"glslang %{glslang_version}\" >> glslc/src/build-version.inc + +# Point to correct include +sed -i 's|SPIRV/GlslangToSpv.h|glslang/SPIRV/GlslangToSpv.h|' libshaderc_util/src/compiler.cc %build mkdir %_target_platform @@ -130,6 +129,9 @@ ctest -V %{_libdir}/pkgconfig/shaderc_combined.pc %changelog +* Wed Jun 17 20:15:27 CEST 2020 Robert-André Mauchin - 2020.1-1 +- Update to 2020.1 + * Sun Feb 02 20:53:01 CET 2020 Robert-André Mauchin - 2019.1-1 - Update to 2019.1 diff --git a/sources b/sources index 27dc491..2f94e46 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (shaderc-f76bb2f.tar.gz) = 50a4385056e59cf28c9422edf77604aa2f770d9c68d2779751ccd62b666dbdf5ac67782b820e843bb1986ca96907222f9935bebc7b39dffb4543e4775508e33d +SHA512 (shaderc-7c2aa93.tar.gz) = 4ec9a88e3790c3d3482a35111019d12d4d15a4b77c715f0659e52d35872f4a05fbd3182dd573b0c198e483548c4b08a98da5bc28427438fc4a67942da0452702