From 1c4c0f91aaca21cfad4fc2ca8784940f59a2c7eb82875e8ced98417ca54cc5ac Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 19 Nov 2019 08:41:45 +0000 Subject: [PATCH] - Enable HLSL optimizer. Add opt.diff. OBS-URL: https://build.opensuse.org/package/show/X11:Wayland/glslang?expand=0&rev=63 --- glslang.changes | 5 +++++ glslang.spec | 6 ++++-- opt.diff | 19 +++++++++++++++++++ ver.diff | 10 +++++----- 4 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 opt.diff diff --git a/glslang.changes b/glslang.changes index b1acaa2..fd7c487 100644 --- a/glslang.changes +++ b/glslang.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 19 08:41:02 UTC 2019 - Jan Engelhardt + +- Enable HLSL optimizer. Add opt.diff. + ------------------------------------------------------------------- Thu Nov 7 08:25:53 UTC 2019 - Jan Engelhardt diff --git a/glslang.spec b/glslang.spec index 9264dcc..a6ea7ff 100644 --- a/glslang.spec +++ b/glslang.spec @@ -1,7 +1,7 @@ # # spec file for package glslang # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 SUSE LLC. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -31,12 +31,14 @@ URL: https://www.khronos.org/opengles/sdk/tools/Reference-Compiler/ Source: %name-%version.tar.xz Patch1: ver.diff +Patch2: opt.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: bison BuildRequires: cmake >= 2.8 BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python3-base +BuildRequires: spirv-tools-devel %description glslang is a compiler front end for the OpenGL ES and OpenGL shading @@ -76,7 +78,7 @@ compressor's dictionary can find better cross module commonality. %build %global _lto_cflags %{_lto_cflags} -ffat-lto-objects # Trim -Wl,--no-undefined for now (https://github.com/KhronosGroup/glslang/issues/1484) -%cmake -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" +%cmake -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed -Wl,-z,now" -DENABLE_OPT=ON make %{?_smp_mflags} %install diff --git a/opt.diff b/opt.diff new file mode 100644 index 0000000..10ad636 --- /dev/null +++ b/opt.diff @@ -0,0 +1,19 @@ +--- + CMakeLists.txt | 4 ---- + 1 file changed, 4 deletions(-) + +Index: glslang-7.13.3496/CMakeLists.txt +=================================================================== +--- glslang-7.13.3496.orig/CMakeLists.txt ++++ glslang-7.13.3496/CMakeLists.txt +@@ -163,10 +163,6 @@ 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) + message(STATUS "optimizer enabled") + add_definitions(-DENABLE_OPT=1) diff --git a/ver.diff b/ver.diff index f38f057..f9187ea 100644 --- a/ver.diff +++ b/ver.diff @@ -26,7 +26,7 @@ Index: glslang-7.13.3496/SPIRV/CMakeLists.txt doc.h) add_library(SPIRV ${LIB_TYPE} ${SOURCES} ${HEADERS}) -+set_target_properties(SPIRV PROPERTIES SOVERSION suse8) ++set_target_properties(SPIRV PROPERTIES SOVERSION suse9) set_property(TARGET SPIRV PROPERTY FOLDER glslang) set_property(TARGET SPIRV PROPERTY POSITION_INDEPENDENT_CODE ON) target_include_directories(SPIRV PUBLIC @@ -34,7 +34,7 @@ Index: glslang-7.13.3496/SPIRV/CMakeLists.txt if (ENABLE_SPVREMAPPER) add_library(SPVRemapper ${LIB_TYPE} ${SPVREMAP_SOURCES} ${SPVREMAP_HEADERS}) -+ set_target_properties(SPVRemapper PROPERTIES SOVERSION suse8) ++ set_target_properties(SPVRemapper PROPERTIES SOVERSION suse9) set_property(TARGET SPVRemapper PROPERTY FOLDER glslang) set_property(TARGET SPVRemapper PROPERTY POSITION_INDEPENDENT_CODE ON) endif() @@ -45,7 +45,7 @@ Index: glslang-7.13.3496/StandAlone/CMakeLists.txt @@ -1,5 +1,6 @@ add_library(glslang-default-resource-limits ${CMAKE_CURRENT_SOURCE_DIR}/ResourceLimits.cpp) -+set_target_properties(glslang-default-resource-limits PROPERTIES SOVERSION suse8) ++set_target_properties(glslang-default-resource-limits PROPERTIES SOVERSION suse9) set_property(TARGET glslang-default-resource-limits PROPERTY FOLDER glslang) set_property(TARGET glslang-default-resource-limits PROPERTY POSITION_INDEPENDENT_CODE ON) @@ -57,7 +57,7 @@ Index: glslang-7.13.3496/glslang/CMakeLists.txt glslang_pch(SOURCES MachineIndependent/pch.cpp) add_library(glslang ${LIB_TYPE} ${BISON_GLSLParser_OUTPUT_SOURCE} ${SOURCES} ${HEADERS}) -+set_target_properties(glslang PROPERTIES SOVERSION suse8) ++set_target_properties(glslang PROPERTIES SOVERSION suse9) set_property(TARGET glslang PROPERTY FOLDER glslang) set_property(TARGET glslang PROPERTY POSITION_INDEPENDENT_CODE ON) target_link_libraries(glslang OGLCompiler OSDependent) @@ -69,7 +69,7 @@ Index: glslang-7.13.3496/hlsl/CMakeLists.txt glslang_pch(SOURCES pch.cpp) add_library(HLSL ${LIB_TYPE} ${SOURCES} ${HEADERS}) -+set_target_properties(HLSL PROPERTIES SOVERSION suse8) ++set_target_properties(HLSL PROPERTIES SOVERSION suse9) set_property(TARGET HLSL PROPERTY FOLDER hlsl) set_property(TARGET HLSL PROPERTY POSITION_INDEPENDENT_CODE ON)