shaderc: 2020.3 -> 2020.4-0dbd899

This commit is contained in:
Danny Rawlins 2021-02-27 23:48:04 +11:00
parent 7aa4ae55f8
commit 293a8c9b0f
10 changed files with 63 additions and 189 deletions

View File

@ -21,4 +21,3 @@ drwxr-xr-x root/root usr/share/
drwxr-xr-x root/root usr/share/man/
drwxr-xr-x root/root usr/share/man/man1/
-rw-r--r-- root/root usr/share/man/man1/glslc.1.gz
-rw-r--r-- root/root usr/share/man/man1/spvc.1.gz

View File

@ -1,12 +1,9 @@
untrusted comment: verify with /etc/ports/contrib.pub
RWSagIOpLGJF3xmHJjlBtCzVb5NeEB4deERcrK/KVB8VUnSVWV7vqeCqHouRgiBoKi28tjkHX4NFJ7GrY+2gv//B5XE55ORS7QQ=
SHA256 (Pkgfile) = 07cdbb60a0c04dadcae7e9f2db6b793444e211f0ab990731a8c8090b576d5446
SHA256 (.footprint) = a55f4db9a8f36310df010a88256abef6d13753f525ff212c4e7dcb390e6c1e66
SHA256 (shaderc-v2020.3.tar.gz) = e595f71d0db0c37ee959b538cfda16e39e3f0dce8893a0bc0ac0080c342c0275
SHA256 (glslc.1) = 468467ab0ec0eac2b221563ef370826443c22cee55f11f6dc8be81b168e3e492
SHA256 (spvc.1) = 95b9a165ec12d022a58c41ece70f5783abf6127eab1676d4f66c88803e007a85
RWSagIOpLGJF36qnZ4jJ+jbs3rNk1CjqXFmZ+s6D0LO9aQYvHiS0HU2dbGuIroX/CHa2lBCEupOuq04Wh3y2u5VHlQSG5BRESQM=
SHA256 (Pkgfile) = dd1d5075d82c9943215113594fbb618221f903fa077b2b22030b4f75f327124f
SHA256 (.footprint) = 768c5796cba31503e5e8a1c1d874f1d8699d410d17d6b98d9a6588ae17462816
SHA256 (0dbd899941a43ffd55df527d65128b3b66e75c9c.zip) = ad7abeb81e37e900b7e21eb54b6be6f90fce6f9adcb5ac54f3ed8908ea2b2301
SHA256 (glslc.1) = 267cddf289bffa4855950a5ce662f04ef3b0dea7e46447a6a694214614032a7d
SHA256 (glslc-asciidoc.patch) = 685d97223af4fcd169921ee5f9b2c49a2df3d84b7bf7df7dd1f6def4361321a6
SHA256 (spvc-asciidoc.patch) = fd0c682186be4231fab5c83bf7625678f3b7905c980e3f7c9ae6cd5e212f9563
SHA256 (0001-Drop-third-party-code-in-CMakeLists.txt.patch) = 382d0dbd50f691c81d3bd941ef4d85fea1ba0eeed3537a3a9cc7a666ff6504af
SHA256 (shaderc-2020.3-system-glslang.patch) = 39a9e7a18824c255b125ed9af6bca3a732b52162faab716fb52cae994d73c9ce
SHA256 (0001-Fix-SPIRV-includes-location.patch) = dc4a3d51aeb77a6a599921801ff690620167aa0288513b414022e9a40e387cfe
SHA256 (0001-Drop-third-party-code-in-CMakeLists.txt.patch) = 060eb0e19a58b5e4c61ec087512de0ea52623b9aa33858f7a4b2f036f52169fb
SHA256 (glslang_linker_flags.patch) = 18c74c78ff62d53b522604e59aef595d442e8cae46233622dd9520571201d276

View File

@ -1,15 +1,12 @@
diff -up shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt.orig shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt
--- shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt.orig 2020-01-22 21:15:53.000000000 +0100
+++ shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt 2020-02-02 21:06:15.193583552 +0100
@@ -98,7 +98,6 @@ endif(MSVC)
@@ -102,18 +102,10 @@ endif(MSVC)
# Configure subdirectories.
# We depend on these for later projects, so they should come first.
-add_subdirectory(third_party)
if(SHADERC_ENABLE_SPVC)
add_subdirectory(libshaderc_spvc)
@@ -107,13 +106,6 @@ endif()
add_subdirectory(libshaderc_util)
add_subdirectory(libshaderc)
add_subdirectory(glslc)
@ -20,6 +17,6 @@ diff -up shaderc-f76bb2f09f858c3014b329961d836964e515095d/CMakeLists.txt.orig sh
- ${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

View File

@ -1,13 +0,0 @@
diff -pruN shaderc-2020.1.orig/libshaderc_util/src/compiler.cc shaderc-2020.1/libshaderc_util/src/compiler.cc
--- shaderc-2020.1.orig/libshaderc_util/src/compiler.cc 2020-07-24 01:06:21.397249832 +1000
+++ shaderc-2020.1/libshaderc_util/src/compiler.cc 2020-07-24 01:08:09.742590277 +1000
@@ -20,7 +20,7 @@
#include <thread>
#include <tuple>
-#include "SPIRV/GlslangToSpv.h"
+#include "glslang/SPIRV/GlslangToSpv.h"
#include "libshaderc_util/format.h"
#include "libshaderc_util/io.h"
#include "libshaderc_util/message.h"
Binary files shaderc-2020.1.orig/libshaderc_util/src/.compiler.cc.un~ and shaderc-2020.1/libshaderc_util/src/.compiler.cc.un~ differ

View File

@ -5,21 +5,21 @@
# Optional: asciidoctor
name=shaderc
version=2020.3
version=2020.4-0dbd899
release=1
source=(https://github.com/google/$name/archive/v$version/$name-v$version.tar.gz
glslc.1 spvc.1 glslc-asciidoc.patch spvc-asciidoc.patch
source=(#https://github.com/google/shaderc/archive/v$version/$name-v$version.tar.gz
https://github.com/google/shaderc/archive/0dbd899941a43ffd55df527d65128b3b66e75c9c.zip
glslc.1 glslc-asciidoc.patch
0001-Drop-third-party-code-in-CMakeLists.txt.patch
shaderc-2020.3-system-glslang.patch
0001-Fix-SPIRV-includes-location.patch)
glslang_linker_flags.patch)
build() {
mv $name-0dbd899941a43ffd55df527d65128b3b66e75c9c $name-$version
patch -d $name-$version/glslc -p0 -i $SRC/glslc-asciidoc.patch
patch -d $name-$version/spvc -p0 -i $SRC/spvc-asciidoc.patch
patch -p1 -d $name-$version -i $SRC/0001-Drop-third-party-code-in-CMakeLists.txt.patch
patch -p1 -d $name-$version -i $SRC/0001-Fix-SPIRV-includes-location.patch
patch -p1 -d $name-$version -i $SRC/shaderc-2020.3-system-glslang.patch
patch -p1 -d $name-$version -i $SRC/glslang_linker_flags.patch
# de-vendor libs and disable git versioning
sed '/examples/d;/third_party/d' -i $name-$version/CMakeLists.txt
@ -30,6 +30,9 @@ build() {
"$(prt-get info glslang | awk '/^Version:/ {print $2}')\\n"
EOF
# Point to correct include
sed -i 's|SPIRV/GlslangToSpv.h|glslang/SPIRV/GlslangToSpv.h|' $name-$version/libshaderc_util/src/compiler.cc
cmake -S $name-$version -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBDIR=lib \
@ -47,13 +50,7 @@ EOF
asciidoctor -b manpage README.asciidoc -o glslc.1
install -D -m 0644 -t $PKG/usr/share/man/man1 glslc.1
cd -
cd $name-$version/spvc
asciidoctor -b manpage README.asciidoc -o spvc.1
install -D -m 0644 -t $PKG/usr/share/man/man1 spvc.1
cd -
else
install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/glslc.1
install -D -m 0644 -t $PKG/usr/share/man/man1 $SRC/spvc.1
fi
}

View File

@ -0,0 +1,24 @@
--- a/libshaderc_util/CMakeLists.txt
+++ b/libshaderc_util/CMakeLists.txt
@@ -47,7 +47,7 @@
find_package(Threads)
target_link_libraries(shaderc_util PRIVATE
glslang OSDependent OGLCompiler HLSL glslang SPIRV
- SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
+ SPIRV-Tools-opt MachineIndependent GenericCodeGen ${CMAKE_THREAD_LIBS_INIT})
shaderc_add_tests(
TEST_PREFIX shaderc_util
--- a/glslc/CMakeLists.txt
+++ b/glslc/CMakeLists.txt
@@ -43,7 +43,7 @@
endif(SHADERC_ENABLE_WGSL_OUTPUT)
target_link_libraries(glslc PRIVATE
- glslang OSDependent OGLCompiler HLSL glslang SPIRV # Glslang libraries
+ glslang OSDependent OGLCompiler HLSL glslang SPIRV MachineIndependent GenericCodeGen # Glslang libraries
$<$<BOOL:${SHADERC_ENABLE_WGSL_OUTPUT}>:libtint> # Tint libraries, optional
shaderc_util shaderc # internal Shaderc libraries
${CMAKE_THREAD_LIBS_INIT})

View File

@ -1,13 +1,13 @@
'\" t
.\" Title: glslc
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.10
.\" Date: 2020-10-24
.\" Generator: Asciidoctor 2.0.12
.\" Date: 2021-02-27
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "`GLSLC`" "1" "2020-10-24" "\ \&" "\ \&"
.TH "`GLSLC`" "1" "2021-02-27" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
@ -33,6 +33,7 @@
.sp
.if n .RS 4
.nf
.fam C
glslc [\-\-help]
glslc [\-h]
@ -58,6 +59,7 @@ glslc [\-c|\-S|\-E]
[\-w] [\-Werror]
[\-o outfile]
shader...
.fam
.fi
.if n .RE
.SH "DESCRIPTION"
@ -886,7 +888,9 @@ In a GLSL shader, use a \f(CRlocation\fP layout qualifier:
.sp
.if n .RS 4
.nf
.fam C
layout(location = 1) in vec4 x;
.fam
.fi
.if n .RE
.sp
@ -903,11 +907,13 @@ In an HLSL shader, use a \f(CRvk::location\fP attribute:
.sp
.if n .RS 4
.nf
.fam C
[[vk::location(1)]] float4 FooShader(
[[vk::location(0)]] float4 a,
[[vk::location(2)]] float4 b) : COLOR0 {
return a + b;
}
.fam
.fi
.if n .RE
.SS "Warning and Error Options"
@ -1195,7 +1201,9 @@ a \f(CRbinding\fP layout qualifier. For example:
.sp
.if n .RS 4
.nf
.fam C
layout(binding = 12) uniform texture2D;
.fam
.fi
.if n .RE
.SS "\f(CR\-fhlsl\-iomap\fP"
@ -1259,9 +1267,11 @@ Example:
.sp
.if n .RS 4
.nf
.fam C
# For a texture in register t1, use set 1 binding 0.
# For a texture in register t2, use set 1 binding 3
glslc \-x hlsl foo.frag \-fresource\-set\-binding t1 1 0 t2 1 3
.fam
.fi
.if n .RE
.sp
@ -1269,9 +1279,11 @@ If a stage is specified, only affects the specified stage.
.sp
.if n .RS 4
.nf
.fam C
# Same as the previous example, but the settings only apply
# to fragment (pixel) shaders.
glslc \-x hlsl foo.frag \-fresource\-set\-binding frag t1 1 0 t2 1 3
.fam
.fi
.if n .RE
.SH "DIVERGENCE FROM AND EXTENSIONS TO GLSL SPECIFICATIONS"
@ -1324,9 +1336,11 @@ the following three forms:
.sp
.if n .RS 4
.nf
.fam C
#line line\-number
#line line\-number integer\-source\-string\-index
#line line\-number "source\-filename"
.fam
.fi
.if n .RE
.sp

View File

@ -1,39 +0,0 @@
Index: shaderc-2020.3/libshaderc_util/CMakeLists.txt
===================================================================
--- shaderc-2020.3/libshaderc_util/CMakeLists.txt
+++ shaderc-2020.3/libshaderc_util/CMakeLists.txt 2020-10-16 23:28:53.405312623 +0200
@@ -46,7 +46,7 @@
find_package(Threads)
target_link_libraries(shaderc_util PRIVATE
- glslang OSDependent OGLCompiler HLSL glslang SPIRV
+ glslang HLSL SPIRV
SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
shaderc_add_tests(
Index: shaderc-2020.3/libshaderc/CMakeLists.txt
===================================================================
--- shaderc-2020.3/libshaderc/CMakeLists.txt
+++ shaderc-2020.3/libshaderc/CMakeLists.txt 2020-10-16 23:29:11.120117663 +0200
@@ -62,7 +62,7 @@
find_package(Threads)
set(SHADERC_LIBS
- glslang OSDependent OGLCompiler glslang ${CMAKE_THREAD_LIBS_INIT}
+ glslang ${CMAKE_THREAD_LIBS_INIT}
shaderc_util
SPIRV # from glslang
SPIRV-Tools
Index: shaderc-2020.3/glslc/CMakeLists.txt
===================================================================
--- shaderc-2020.3/glslc/CMakeLists.txt
+++ shaderc-2020.3/glslc/CMakeLists.txt 2020-10-16 23:28:53.405312623 +0200
@@ -43,7 +43,7 @@
endif(SHADERC_ENABLE_WGSL_OUTPUT)
target_link_libraries(glslc PRIVATE
- glslang OSDependent OGLCompiler HLSL glslang SPIRV # Glslang libraries
+ glslang HLSL SPIRV # Glslang libraries
$<$<BOOL:${SHADERC_ENABLE_WGSL_OUTPUT}>:libtint> # Tint libraries, optional
shaderc_util shaderc # internal Shaderc libraries
${CMAKE_THREAD_LIBS_INIT})

View File

@ -1,8 +0,0 @@
--- README.asciidoc.orig 2019-10-12 13:12:51.338188365 +1100
+++ README.asciidoc 2019-10-12 13:13:14.557901897 +1100
@@ -1,4 +1,4 @@
-= spvc Manual
+= spvc(1)
:toc:
:toclevels: 3
:numbered:

View File

@ -1,94 +0,0 @@
'\" t
.\" Title: spvc
.\" Author: [see the "AUTHOR(S)" section]
.\" Generator: Asciidoctor 2.0.10
.\" Date: 2020-10-24
.\" Manual: \ \&
.\" Source: \ \&
.\" Language: English
.\"
.TH "`SPVC`" "1" "2020-10-24" "\ \&" "\ \&"
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.ss \n[.ss] 0
.nh
.ad l
.de URL
\fI\\$2\fP <\\$1>\\$3
..
.als MTO URL
.if \n[.g] \{\
. mso www.tmac
. am URL
. ad l
. .
. am MTO
. ad l
. .
. LINKSTYLE blue R < >
.\}
.SH "NAME"
`spvc` \- A validating SPIR\-V to GLSL/HLSL/MSL compiler with Clang\-compatible options.
.SH "SYNOPSIS"
.sp
.if n .RS 4
.nf
spvc [\-\-help]
spvc [\-\-version]
[\-\-validate=<target env>]
[\-o outfile]
shader...
.fi
.if n .RE
.SH "DESCRIPTION"
.sp
\f(CRspvc\fP is a wrapper around SPIRV\-Cross.
A SPIR\-V module must pass validation before it is given to SPIRV\-Cross for translation.
.SS "Input file languages"
.sp
Spvc accepts SPIR\-V binary files as input.
.SS "Output file naming"
.sp
If a name is specified via \f(CR\-o\fP, the output file will be given that name.
Otherwise the output file name is the same as the input file name except
with a \f(CR.glsl,\fP \f(CR.hlsl\fP or \f(CR.msl\fP extension, as appropriate.
.SH "COMMAND LINE OPTIONS"
.SS "Overall Options"
.SS "\f(CR\-\-help\fP"
.sp
\f(CR\-\-help\fP tells the spvc compiler to display all available options and exit.
.SS "\f(CR\-\-version\fP"
.sp
\f(CR\-\-version\fP displays version information.
.SS "\f(CR\-\-validate=<source env>\fP"
.sp
\f(CR\-\-validate\fP validates the input with the given environment, which is one of:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
vulkan1.0
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
. sp -1
. IP \(bu 2.3
.\}
vulkan1.1
.RE
.sp
The default is \f(CRvulkan1.0\fP.
.SS "\f(CR\-o\fP"
.sp
\f(CR\-o\fP lets you specify the output file\(cqs name. It cannot be used when there are
multiple files generated. A filename of \f(CR\-\fP represents standard output.