import glslang-8.13.3559-1.20200128.git07a5583.el8

This commit is contained in:
CentOS Sources 2020-05-27 22:37:33 +00:00 committed by Andrew Lukoshko
parent 10bcac0ae8
commit bc3ef00821
6 changed files with 234 additions and 57 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/glslang-e99a26810f65314183163c07664a40e05647c15f.tar.gz SOURCES/glslang-07a55839eed550d84ef62e0c7f503e0d67692708.tar.gz

View File

@ -1 +1 @@
e353c3ca32360949af788df57b8da29623624c2b SOURCES/glslang-e99a26810f65314183163c07664a40e05647c15f.tar.gz a62e7be79f6d0be94c90922f839c2f01020ba9a5 SOURCES/glslang-07a55839eed550d84ef62e0c7f503e0d67692708.tar.gz

View File

@ -0,0 +1,190 @@
diff -up ./CMakeLists.txt.dma ./CMakeLists.txt
--- ./CMakeLists.txt.dma 2020-01-28 05:35:25.000000000 +1000
+++ ./CMakeLists.txt 2020-01-29 10:29:25.199187348 +1000
@@ -69,6 +69,13 @@ endmacro(glslang_pch)
project(glslang)
+# using pkg-config to configure include paths and link libraries
+include(FindPkgConfig)
+pkg_check_modules(SPIRV_TOOLS REQUIRED SPIRV-Tools>=2019.2.1)
+if(BUILD_SHARED_LIBS)
+ pkg_check_modules(SPIRV_TOOLS_SHARED REQUIRED SPIRV-Tools-shared>=2019.2.1)
+endif(BUILD_SHARED_LIBS)
+
if(ENABLE_CTEST)
include(CTest)
endif()
@@ -166,11 +173,7 @@ if(BUILD_EXTERNAL AND IS_DIRECTORY ${CMA
add_subdirectory(External)
endif()
-if(NOT TARGET SPIRV-Tools-opt)
- set(ENABLE_OPT OFF)
-endif()
-
-if(ENABLE_OPT)
+if(${SPIRV_TOOLS_FOUND} EQUAL 1)
message(STATUS "optimizer enabled")
add_definitions(-DENABLE_OPT=1)
else()
diff -up ./External/CMakeLists.txt.dma ./External/CMakeLists.txt
--- ./External/CMakeLists.txt.dma 2020-01-28 05:35:25.000000000 +1000
+++ ./External/CMakeLists.txt 2020-01-29 10:29:25.199187348 +1000
@@ -35,10 +35,3 @@ if(BUILD_TESTING)
endif()
endif()
-if(ENABLE_OPT AND NOT TARGET SPIRV-Tools-opt)
- if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools)
- set(SPIRV_SKIP_TESTS ON CACHE BOOL "Skip building SPIRV-Tools tests")
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/spirv-tools spirv-tools)
- endif()
-endif()
-
diff -up ./glslang/CMakeLists.txt.dma ./glslang/CMakeLists.txt
--- ./glslang/CMakeLists.txt.dma 2020-01-28 05:35:25.000000000 +1000
+++ ./glslang/CMakeLists.txt 2020-01-29 10:29:25.199187348 +1000
@@ -79,6 +79,7 @@ set(HEADERS
MachineIndependent/preprocessor/PpContext.h
MachineIndependent/preprocessor/PpTokens.h)
+set(VERSION 7.11.3113)
glslang_pch(SOURCES MachineIndependent/pch.cpp)
add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS})
@@ -115,7 +116,9 @@ if(ENABLE_GLSLANG_INSTALL)
install(TARGETS glslang EXPORT glslangTargets
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
- install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/glslang.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/glslang.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+ install(EXPORT glslangTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
endif(ENABLE_GLSLANG_INSTALL)
if(ENABLE_GLSLANG_INSTALL)
diff -up ./glslang/glslang.pc.cmake.in.dma ./glslang/glslang.pc.cmake.in
--- ./glslang/glslang.pc.cmake.in.dma 2020-01-29 10:29:25.199187348 +1000
+++ ./glslang/glslang.pc.cmake.in 2020-01-29 10:29:25.199187348 +1000
@@ -0,0 +1,11 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+ Name: @PROJECT_NAME@
+ Description: OpenGL and OpenGL ES shader front end and validator
+ Requires:
+ Version: @VERSION@
+ Libs: -L${libdir} -lglslang -lOSDependent -lHLSL -lOGLCompiler -lSPVRemapper
+ Cflags: -I${includedir}
\ No newline at end of file
diff -up ./SPIRV/CMakeLists.txt.dma ./SPIRV/CMakeLists.txt
--- ./SPIRV/CMakeLists.txt.dma 2020-01-28 05:35:25.000000000 +1000
+++ ./SPIRV/CMakeLists.txt 2020-01-29 10:29:25.200187375 +1000
@@ -40,6 +40,10 @@ target_include_directories(SPIRV PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+
+set(SPIRV_NAME spirv)
+set(SPIRV_VERSION 1.3)
+
if (ENABLE_SPVREMAPPER)
add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS})
set_property(TARGET SPVRemapper PROPERTY FOLDER glslang)
@@ -53,15 +57,21 @@ if(WIN32 AND BUILD_SHARED_LIBS)
endif()
endif()
+target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS})
+target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_CFLAGS_OTHER})
+target_link_libraries(SPIRV ${SPIRV_TOOLS_LIBRARIES})
+if(BUILD_SHARED_LIBS)
+ target_include_directories(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS})
+ target_compile_options(SPIRV PUBLIC ${SPIRV_TOOLS_SHARED_CFLAGS_OTHER})
+ target_link_libraries(SPIRV ${SPIRV_TOOLS_SHARED_LIBRARIES})
+endif(BUILD_SHARED_LIBS)
+
if(ENABLE_OPT)
target_include_directories(SPIRV
PRIVATE ${spirv-tools_SOURCE_DIR}/include
PRIVATE ${spirv-tools_SOURCE_DIR}/source
)
- target_link_libraries(SPIRV glslang SPIRV-Tools-opt)
- target_include_directories(SPIRV PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
+ target_link_libraries(SPIRV glslang)
else()
target_link_libraries(SPIRV glslang)
endif(ENABLE_OPT)
@@ -97,6 +107,9 @@ if(ENABLE_GLSLANG_INSTALL)
install(EXPORT SPIRVTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake)
+ # spirv.pc Configuration
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/spirv.pc.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/spirv.pc @ONLY)
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/spirv.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/SPIRV/)
install(FILES ${HEADERS} ${SPVREMAP_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/glslang/SPIRV/)
endif(ENABLE_GLSLANG_INSTALL)
diff -up ./SPIRV/spirv.pc.cmake.in.dma ./SPIRV/spirv.pc.cmake.in
--- ./SPIRV/spirv.pc.cmake.in.dma 2020-01-29 10:29:25.200187375 +1000
+++ ./SPIRV/spirv.pc.cmake.in 2020-01-29 10:29:25.200187375 +1000
@@ -0,0 +1,11 @@
+ prefix=@CMAKE_INSTALL_PREFIX@
+ exec_prefix=@CMAKE_INSTALL_PREFIX@
+ libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+ includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+
+ Name: @SPIRV_NAME@
+ Description: SPIR-V is a binary intermediate language for representing graphical-shader stages and compute kernels for multiple Khronos APIs, including OpenCL, OpenGL, and Vulkan
+ Requires:
+ Version: @SPIRV_VERSION@
+ Libs: -L${libdir} -lSPIRV
+ Cflags: -I${includedir}
\ No newline at end of file
diff -up ./SPIRV/SpvTools.cpp.dma ./SPIRV/SpvTools.cpp
--- ./SPIRV/SpvTools.cpp.dma 2020-01-28 05:35:25.000000000 +1000
+++ ./SPIRV/SpvTools.cpp 2020-01-29 10:29:25.200187375 +1000
@@ -43,8 +43,8 @@
#include <iostream>
#include "SpvTools.h"
-#include "spirv-tools/optimizer.hpp"
-#include "spirv-tools/libspirv.h"
+#include <spirv-tools/optimizer.hpp>
+#include <spirv-tools/libspirv.h>
namespace glslang {
diff -up ./StandAlone/CMakeLists.txt.dma ./StandAlone/CMakeLists.txt
--- ./StandAlone/CMakeLists.txt.dma 2020-01-29 10:29:09.052755158 +1000
+++ ./StandAlone/CMakeLists.txt 2020-01-29 10:29:25.201187402 +1000
@@ -23,6 +23,14 @@ if(ENABLE_SPVREMAPPER)
set(LIBRARIES ${LIBRARIES} SPVRemapper)
endif()
+if(BUILD_SHARED_LIBS)
+ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_SHARED_LIBRARIES})
+ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_SHARED_INCLUDE_DIRS})
+else()
+ set(LIBRARIES ${LIBRARIES} ${SPIRV_TOOLS_LIBRARIES})
+ target_include_directories(glslangValidator PUBLIC ${SPIRV_TOOLS_INCLUDE_DIRS})
+endif(BUILD_SHARED_LIBS)
+
if(WIN32)
set(LIBRARIES ${LIBRARIES} psapi)
elseif(UNIX)
@@ -32,9 +40,6 @@ elseif(UNIX)
endif(WIN32)
target_link_libraries(glslangValidator ${LIBRARIES})
-target_include_directories(glslangValidator PUBLIC
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../External>
- $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/External>)
if(ENABLE_SPVREMAPPER)
set(REMAPPER_SOURCES spirv-remap.cpp)

View File

@ -1,21 +0,0 @@
--- glslang-715c353a15836e5ae192a64a4cf54e2ce7e8d66a/Test/runtests
+++ glslang-715c353a15836e5ae192a64a4cf54e2ce7e8d66a-new/Test/runtests
@@ -2,8 +2,8 @@
TARGETDIR=localResults
BASEDIR=baseResults
-EXE=../build/install/bin/glslangValidator
-REMAPEXE=../build/install/bin/spirv-remap
+EXE=../build/StandAlone/glslangValidator
+REMAPEXE=../build/StandAlone/spirv-remap
HASERROR=0
mkdir -p localResults
--- glslang-715c353a15836e5ae192a64a4cf54e2ce7e8d66a/Test/glslangValidator
+++ glslang-715c353a15836e5ae192a64a4cf54e2ce7e8d66a-new/Test/glslangValidator
@@ -1,2 +1,2 @@
#!/usr/bin/env bash
-../build/install/bin/glslangValidator $*
+../build/StandAlone/glslangValidator $*

View File

@ -1,20 +0,0 @@
From: Jan Engelhardt <jengelh@inai.de>
Date: 2017-08-07 20:22:29.456870387 +0200
---
StandAlone/spirv-remap.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Index: glslang/StandAlone/spirv-remap.cpp
===================================================================
--- a/StandAlone/spirv-remap.cpp
+++ b/StandAlone/spirv-remap.cpp
@@ -227,7 +227,7 @@ namespace {
}
}
else if (arg == "--version" || arg == "-V") {
- std::cout << basename(argv[0]) << " version 0.97 " << __DATE__ << " " << __TIME__ << std::endl;
+ std::cout << basename(argv[0]) << " version 0.97 " << std::endl;
exit(0);
} else if (arg == "--input" || arg == "-i") {
// Collect input files

View File

@ -1,23 +1,26 @@
%global commit e99a26810f65314183163c07664a40e05647c15f %global commit 07a55839eed550d84ef62e0c7f503e0d67692708
%global shortcommit %(c=%{commit}; echo ${c:0:7}) %global shortcommit %(c=%{commit}; echo ${c:0:7})
%global commit_date 20180727 %global commit_date 20200128
%global gitrel .%{commit_date}.git%{shortcommit} %global gitrel .%{commit_date}.git%{shortcommit}
Name: glslang Name: glslang
Version: 3.1 Version: 8.13.3559
Release: 0.10%{?gitrel}%{?dist} Release: 1%{?gitrel}%{?dist}
Summary: OpenGL and OpenGL ES shader front end and validator Summary: OpenGL and OpenGL ES shader front end and validator
License: BSD and GPLv3+ and ASL 2.0 License: BSD and GPLv3+ and ASL 2.0
URL: https://github.com/KhronosGroup URL: https://github.com/KhronosGroup
Source0: %url/%{name}/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz Source0: %url/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
Patch0: nodate.patch
Patch1: glslang-default-resource-limits_staticlib.patch Patch1: glslang-default-resource-limits_staticlib.patch
Patch2: glslang_tests.patch # Patch to build against system spirv-tools
#Patch3: https://patch-diff.githubusercontent.com/raw/KhronosGroup/glslang/pull/1722.patch#/0001-pkg-config-compatibility.patch
Patch3: 0001-pkg-config-compatibility.patch
BuildRequires: cmake3 BuildRequires: cmake3
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: ninja-build BuildRequires: ninja-build
BuildRequires: python3
BuildRequires: spirv-tools-devel
%description %description
%{name} is the official reference compiler front end for the OpenGL %{name} is the official reference compiler front end for the OpenGL
@ -52,23 +55,25 @@ popd
%install %install
%{ninja_install} -C build %{ninja_install} -C build
%ifnarch s390x ppc64 # we don't want them in here
%check rm -rf %{buildroot}%{_includedir}/SPIRV
pushd Test
./runtests
popd
%endif
# Install libglslang-default-resource-limits.a # Install libglslang-default-resource-limits.a
install -pm 0644 build/StandAlone/libglslang-default-resource-limits.a %{buildroot}%{_libdir}/ install -pm 0644 build/StandAlone/libglslang-default-resource-limits.a %{buildroot}%{_libdir}/
%ifnarch s390x ppc64
%check
pushd Test
./runtests localResults ../build/StandAlone/glslangValidator ../build/StandAlone/spirv-remap
popd
%endif
%files %files
%doc README.md README-spirv-remap.txt %doc README.md README-spirv-remap.txt
%{_bindir}/glslangValidator %{_bindir}/glslangValidator
%{_bindir}/spirv-remap %{_bindir}/spirv-remap
%files devel %files devel
%{_includedir}/SPIRV/
%{_includedir}/glslang/ %{_includedir}/glslang/
%{_libdir}/libHLSL.a %{_libdir}/libHLSL.a
%{_libdir}/libOGLCompiler.a %{_libdir}/libOGLCompiler.a
@ -77,8 +82,31 @@ install -pm 0644 build/StandAlone/libglslang-default-resource-limits.a %{buildro
%{_libdir}/libSPVRemapper.a %{_libdir}/libSPVRemapper.a
%{_libdir}/libglslang.a %{_libdir}/libglslang.a
%{_libdir}/libglslang-default-resource-limits.a %{_libdir}/libglslang-default-resource-limits.a
%{_libdir}/pkgconfig/glslang.pc
%{_libdir}/pkgconfig/spirv.pc
%{_libdir}/cmake/*
%changelog %changelog
* Wed Jan 29 2020 Dave Airlie <airlied@redhat.com> - 8.13.3559-1
- Update glslang for 8.2.0 for vulkan 1.2
* Sat Dec 07 2019 Dave Airlie <airlied@redhat.com> - 7.13.3496-2
- Update for 8.2.0
* Tue Nov 12 2019 Dave Airlie <airlied@redhat.com> - 7.13.3496-1
- Update to latest snapshot
* Thu Aug 15 2019 Dave Airlie <airlied@redhat.com> - 7.11.3214-4
- Fix coverity scans (Kamil Dudka)
* Sat Aug 03 2019 Dave Airlie <airlied@redhat.com> - 7.11.3214-3
- Latest upstream snapshot for validation layers build
- Add patch to build against system spirv-tools
* Tue Feb 12 2019 Dave Airlie <airlied@redhat.com> - 3.1-0.11.20190329.gite0d59bb
- Update for vulkan 1.1.92.0
- Update for vulkan 1.1.101.0
* Tue Aug 07 2018 Leigh Scott <leigh123linux@googlemail.com> - 3.1-0.10.20180727.gite99a268 * Tue Aug 07 2018 Leigh Scott <leigh123linux@googlemail.com> - 3.1-0.10.20180727.gite99a268
- Update for vulkan 1.1.82.0 - Update for vulkan 1.1.82.0