All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] add shaderc recipe
@ 2020-10-13 17:34 Jose Quaresma
  2020-10-13 17:34 ` [PATCH 1/5] spirv-tools: import from meta-oe to OE core Jose Quaresma
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 17:34 UTC (permalink / raw)
  To: openembedded-core

This patch series is for addressing an issue on 
a submited patch serie for update gstreamer from 1.16.3 to 1.18.0
https://patchwork.openembedded.org/series/26507
The issue it solves is discussed here:
https://lists.openembedded.org/g/openembedded-core/topic/77459442#143291

This fix the build of the vulkan plugin in gstreamer-plugin-bad 1.18.0
To build the vulkan gstreamer plugin there a dependency on a binary
that there is not present on OE-core. This binary is glslc.

It introduces three new receipes and one of then come from the layer
meta-oe.

* spirv-tools:
move it from meta-oe, add native build and install some extra header files.

* glslang:
is the official reference compiler front end for the OpenGL ES and
OpenGL shading languages.

* shaderc:
A collection of tools, libraries and tests for shader compilation that
provide the binary glslc need to build the vulkan plugin.

[PATCH 1/5] spirv-tools: import from meta-oe to OE core
[PATCH 2/5] spirv-tools: enable native build and install more header
[PATCH 3/5] glslang: add receipe
[PATCH 4/5] shaderc: add receipe
[PATCH 5/5] shaderc: enable only native build as the target is


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH 1/5] spirv-tools: import from meta-oe to OE core
  2020-10-13 17:34 [PATCH] add shaderc recipe Jose Quaresma
@ 2020-10-13 17:34 ` Jose Quaresma
  2020-10-13 17:34 ` [PATCH 2/5] spirv-tools: enable native build and install more header files Jose Quaresma
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 17:34 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

This receipe is needed to build the new shaderc

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 ...0001-Avoid-pessimizing-std-move-3124.patch | 50 +++++++++++++++++++
 ...STALL_LIBDIR-in-installed-CMake-file.patch | 35 +++++++++++++
 meta/recipes-graphics/spir/spirv-tools_git.bb | 35 +++++++++++++
 3 files changed, 120 insertions(+)
 create mode 100644 meta/recipes-graphics/spir/files/0001-Avoid-pessimizing-std-move-3124.patch
 create mode 100644 meta/recipes-graphics/spir/files/0001-Respect-CMAKE_INSTALL_LIBDIR-in-installed-CMake-file.patch
 create mode 100644 meta/recipes-graphics/spir/spirv-tools_git.bb

diff --git a/meta/recipes-graphics/spir/files/0001-Avoid-pessimizing-std-move-3124.patch b/meta/recipes-graphics/spir/files/0001-Avoid-pessimizing-std-move-3124.patch
new file mode 100644
index 0000000000..9b48cdcd09
--- /dev/null
+++ b/meta/recipes-graphics/spir/files/0001-Avoid-pessimizing-std-move-3124.patch
@@ -0,0 +1,50 @@
+From 4fffcd275b50d08b54b0411679ead98970651bad Mon Sep 17 00:00:00 2001
+From: David Neto <dneto@google.com>
+Date: Fri, 27 Dec 2019 12:05:58 -0500
+Subject: [PATCH] Avoid pessimizing std::move (#3124)
+
+Should fix a warning
+
+Upstream-Status: Backport [https://github.com/KhronosGroup/SPIRV-Tools/commit/8aa423930db37e37086665efcc55944d577c06e5]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ test/opt/pass_fixture.h | 9 +++------
+ 1 file changed, 3 insertions(+), 6 deletions(-)
+
+diff --git a/test/opt/pass_fixture.h b/test/opt/pass_fixture.h
+index 53fb206f..64c089d8 100644
+--- a/test/opt/pass_fixture.h
++++ b/test/opt/pass_fixture.h
+@@ -60,8 +60,7 @@ class PassTest : public TestT {
+   // from pass Process() function.
+   std::tuple<std::vector<uint32_t>, Pass::Status> OptimizeToBinary(
+       Pass* pass, const std::string& original, bool skip_nop) {
+-    context_ =
+-        std::move(BuildModule(env_, consumer_, original, assemble_options_));
++    context_ = BuildModule(env_, consumer_, original, assemble_options_);
+     EXPECT_NE(nullptr, context()) << "Assembling failed for shader:\n"
+                                   << original << std::endl;
+     if (!context()) {
+@@ -197,8 +196,7 @@ class PassTest : public TestT {
+   // messages.
+   template <typename PassT, typename... Args>
+   void SinglePassRunAndFail(const std::string& original, Args&&... args) {
+-    context_ =
+-        std::move(BuildModule(env_, consumer_, original, assemble_options_));
++    context_ = BuildModule(env_, consumer_, original, assemble_options_);
+     EXPECT_NE(nullptr, context()) << "Assembling failed for shader:\n"
+                                   << original << std::endl;
+     std::ostringstream errs;
+@@ -235,8 +233,7 @@ class PassTest : public TestT {
+   void RunAndCheck(const std::string& original, const std::string& expected) {
+     assert(manager_->NumPasses());
+ 
+-    context_ =
+-        std::move(BuildModule(env_, nullptr, original, assemble_options_));
++    context_ = BuildModule(env_, nullptr, original, assemble_options_);
+     ASSERT_NE(nullptr, context());
+ 
+     context()->set_preserve_bindings(OptimizerOptions()->preserve_bindings_);
+-- 
+2.24.1
+
diff --git a/meta/recipes-graphics/spir/files/0001-Respect-CMAKE_INSTALL_LIBDIR-in-installed-CMake-file.patch b/meta/recipes-graphics/spir/files/0001-Respect-CMAKE_INSTALL_LIBDIR-in-installed-CMake-file.patch
new file mode 100644
index 0000000000..5d37da8fe0
--- /dev/null
+++ b/meta/recipes-graphics/spir/files/0001-Respect-CMAKE_INSTALL_LIBDIR-in-installed-CMake-file.patch
@@ -0,0 +1,35 @@
+From caf59c46ea5dc49e4dbf756c642b03e52c1b5468 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 20 Dec 2019 07:02:24 -0800
+Subject: [PATCH] Respect CMAKE_INSTALL_LIBDIR in installed CMake files
+
+Upstream-Status: Submitted [https://github.com/google/effcee/pull/36]
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ CMakeLists.txt        | 1 +
+ effcee/CMakeLists.txt | 4 ++--
+ 2 files changed, 3 insertions(+), 2 deletions(-)
+
+--- a/external/effcee/CMakeLists.txt
++++ b/external/effcee/CMakeLists.txt
+@@ -27,6 +27,7 @@ endif()
+ 
+ include(cmake/setup_build.cmake)
+ include(cmake/utils.cmake)
++include(GNUInstallDirs)
+ 
+ add_subdirectory(third_party)
+ add_subdirectory(effcee)
+--- a/external/effcee/effcee/CMakeLists.txt
++++ b/external/effcee/effcee/CMakeLists.txt
+@@ -14,8 +14,8 @@ install(
+   DESTINATION
+     include/effcee)
+ install(TARGETS effcee
+-  LIBRARY DESTINATION lib
+-  ARCHIVE DESTINATION lib)
++  LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
++  ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ 
+ if(EFFCEE_BUILD_TESTING)
+   add_executable(effcee-test
diff --git a/meta/recipes-graphics/spir/spirv-tools_git.bb b/meta/recipes-graphics/spir/spirv-tools_git.bb
new file mode 100644
index 0000000000..8e8388e8d4
--- /dev/null
+++ b/meta/recipes-graphics/spir/spirv-tools_git.bb
@@ -0,0 +1,35 @@
+SUMMARY  = "The SPIR-V Tools project provides an API and commands for \
+processing SPIR-V modules"
+DESCRIPTION = "The project includes an assembler, binary module parser, \
+disassembler, validator, and optimizer for SPIR-V."
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+SECTION = "graphics"
+
+S = "${WORKDIR}/git"
+DEST_DIR = "${S}/external" 
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-Tools.git;name=spirv-tools \
+	git://github.com/KhronosGroup/SPIRV-Headers.git;name=spirv-headers;destsuffix=${DEST_DIR}/spirv-headers \
+	git://github.com/google/effcee.git;name=effcee;destsuffix=${DEST_DIR}/effcee \
+	git://github.com/google/re2.git;name=re2;destsuffix=${DEST_DIR}/re2 \
+	git://github.com/google/googletest.git;name=googletest;destsuffix=${DEST_DIR}/googletest \
+        file://0001-Respect-CMAKE_INSTALL_LIBDIR-in-installed-CMake-file.patch \
+        file://0001-Avoid-pessimizing-std-move-3124.patch \
+"
+SRCREV_spirv-tools = "c413b982c316b14e784f50d941814fc737b55b4a"
+SRCREV_spirv-headers = "af64a9e826bf5bb5fcd2434dd71be1e41e922563"
+SRCREV_effcee = "cd25ec17e9382f99a895b9ef53ff3c277464d07d"
+SRCREV_re2 = "5bd613749fd530b576b890283bfb6bc6ea6246cb"
+SRCREV_googletest = "f2fb48c3b3d79a75a88a99fba6576b25d42ec528"
+
+inherit cmake python3native
+
+EXTRA_OECMAKE += "-DSPIRV_WERROR=OFF"
+
+do_install_append() {
+	install -d ${D}/${includedir}/spirv
+	install -m 0644 ${DEST_DIR}/spirv-headers/include/spirv/1.2/* ${D}/${includedir}/spirv	
+}
+
+FILES_SOLIBSDEV = ""
+FILES_${PN} += "${libdir}/*.so"
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 2/5] spirv-tools: enable native build and install more header files
  2020-10-13 17:34 [PATCH] add shaderc recipe Jose Quaresma
  2020-10-13 17:34 ` [PATCH 1/5] spirv-tools: import from meta-oe to OE core Jose Quaresma
@ 2020-10-13 17:34 ` Jose Quaresma
  2020-10-13 17:35 ` [PATCH 3/5] glslang: add receipe Jose Quaresma
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 17:34 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 meta/recipes-graphics/spir/spirv-tools_git.bb | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-graphics/spir/spirv-tools_git.bb b/meta/recipes-graphics/spir/spirv-tools_git.bb
index 8e8388e8d4..89ebd72d31 100644
--- a/meta/recipes-graphics/spir/spirv-tools_git.bb
+++ b/meta/recipes-graphics/spir/spirv-tools_git.bb
@@ -28,8 +28,12 @@ EXTRA_OECMAKE += "-DSPIRV_WERROR=OFF"
 
 do_install_append() {
 	install -d ${D}/${includedir}/spirv
-	install -m 0644 ${DEST_DIR}/spirv-headers/include/spirv/1.2/* ${D}/${includedir}/spirv	
+	install -m 0644 ${DEST_DIR}/spirv-headers/include/spirv/1.2/* ${D}/${includedir}/spirv
+	install -d ${D}/${includedir}/spirv/unified1
+	install -m 0644 ${DEST_DIR}/spirv-headers/include/spirv/unified1/* ${D}/${includedir}/spirv/unified1
 }
 
 FILES_SOLIBSDEV = ""
 FILES_${PN} += "${libdir}/*.so"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 3/5] glslang: add receipe
  2020-10-13 17:34 [PATCH] add shaderc recipe Jose Quaresma
  2020-10-13 17:34 ` [PATCH 1/5] spirv-tools: import from meta-oe to OE core Jose Quaresma
  2020-10-13 17:34 ` [PATCH 2/5] spirv-tools: enable native build and install more header files Jose Quaresma
@ 2020-10-13 17:35 ` Jose Quaresma
  2020-10-13 18:54   ` [OE-core] " Andrey Zhizhikin
  2020-10-13 17:35 ` [PATCH 4/5] shaderc: " Jose Quaresma
  2020-10-13 17:35 ` [PATCH 5/5] shaderc: enable only native build as the target is failing Jose Quaresma
  4 siblings, 1 reply; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 17:35 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

Glslang is the official reference compiler front end for the
OpenGL ES and OpenGL shading languages. It implements a strict interpretation
of the specifications for these languages. It is open and free for anyone to use,
either from a command line or programmatically.

This receipe is needed to build the new shaderc

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 .../glslang/glslang_8.13.3559.bb              | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
 create mode 100644 meta/recipes-graphics/glslang/glslang_8.13.3559.bb

diff --git a/meta/recipes-graphics/glslang/glslang_8.13.3559.bb b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
new file mode 100644
index 0000000000..2008ba59d8
--- /dev/null
+++ b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
@@ -0,0 +1,19 @@
+SUMMARY = "OpenGL / OpenGL ES Reference Compiler"
+DESCRIPTION = "Glslang is the official reference compiler front end for the \
+OpenGL ES and OpenGL shading languages. It implements a strict interpretation \
+of the specifications for these languages. It is open and free for anyone to use, \
+either from a command line or programmatically."
+SECTION = "graphics"
+HOMEPAGE = "https://www.khronos.org/opengles/sdk/tools/Reference-Compiler"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=918e668376010a04448a312fb37ae69b"
+
+SRC_URI = "https://github.com/KhronosGroup/glslang/archive/${PV}.tar.gz"
+SRC_URI[md5sum] = "cb32322377cee2bc1cee5b60ebe46133"
+SRC_URI[sha256sum] = "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca"
+
+inherit cmake python3native
+
+EXTRA_OECMAKE = ""
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 4/5] shaderc: add receipe
  2020-10-13 17:34 [PATCH] add shaderc recipe Jose Quaresma
                   ` (2 preceding siblings ...)
  2020-10-13 17:35 ` [PATCH 3/5] glslang: add receipe Jose Quaresma
@ 2020-10-13 17:35 ` Jose Quaresma
  2020-10-13 18:58   ` [OE-core] " Alexander Kanavin
  2020-10-13 19:01   ` Andrey Zhizhikin
  2020-10-13 17:35 ` [PATCH 5/5] shaderc: enable only native build as the target is failing Jose Quaresma
  4 siblings, 2 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 17:35 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

A collection of tools, libraries and tests for shader compilation

This receipe is needed to build the gstreamer vulkan plugin
as it provides the binary glslc.

It is based on arch linux shaderc packge including the patches
https://github.com/archlinux/svntogit-packages/blob/91f0fa6ee3a220264a448527c1a8cf037caaad8e/trunk/PKGBUILD

    * 0001-fix-glslang-link-order.patch
      Upstream-Status: Backport [21c8be385b3fab5edcb934a6d99f69fd389c4e67]

    * 0002-shaderc-2019.0-fix-build-against-new-glslang.patch
      Upstream-Status: Pending

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 .../files/0001-fix-glslang-link-order.patch   | 44 +++++++++++++++
 ...2019.0-fix-build-against-new-glslang.patch | 54 +++++++++++++++++++
 .../shaderc/shaderc_2019.0.bb                 | 36 +++++++++++++
 3 files changed, 134 insertions(+)
 create mode 100644 meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
 create mode 100644 meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
 create mode 100644 meta/recipes-graphics/shaderc/shaderc_2019.0.bb

diff --git a/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
new file mode 100644
index 0000000000..a404c85839
--- /dev/null
+++ b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
@@ -0,0 +1,44 @@
+From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001
+From: Niklas Haas <git@haasn.xyz>
+Date: Tue, 29 May 2018 07:34:00 +0200
+Subject: [PATCH] Fix the link order of libglslang and libHLSL
+
+libglslang depends on libHLSL, so the latter needs to be specified last.
+This fixes an issue when trying to build shaderc against system-wide
+versions of libglslang/libHLSL, rather than the in-tree versions from
+third_party.
+
+Additionally, libshaderc_util also depends on SPIRV-Tools
+---
+ glslc/CMakeLists.txt           | 2 +-
+ libshaderc_util/CMakeLists.txt | 4 ++--
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
+index acf6fb0b..0f5d8886 100644
+--- a/glslc/CMakeLists.txt
++++ b/glslc/CMakeLists.txt
+@@ -18,7 +18,7 @@ add_library(glslc STATIC
+ shaderc_default_compile_options(glslc)
+ target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
+ target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
+-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
++  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
+ target_link_libraries(glslc PRIVATE shaderc_util shaderc)
+ 
+ add_executable(glslc_exe src/main.cc)
+diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
+index 873540ab..6d0c465c 100644
+--- a/libshaderc_util/CMakeLists.txt
++++ b/libshaderc_util/CMakeLists.txt
+@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
+ 
+ find_package(Threads)
+ target_link_libraries(shaderc_util PRIVATE
+-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
+-  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
++  glslang OSDependent OGLCompiler glslang HLSL SPIRV
++  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
+ 
+ shaderc_add_tests(
+   TEST_PREFIX shaderc_util
diff --git a/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
new file mode 100644
index 0000000000..807540cf62
--- /dev/null
+++ b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
@@ -0,0 +1,54 @@
+diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
+index 3c3c3de..b5fc6cb 100644
+--- a/libshaderc/src/shaderc.cc
++++ b/libshaderc/src/shaderc.cc
+@@ -20,7 +20,7 @@
+ #include <sstream>
+ #include <vector>
+ 
+-#include "SPIRV/spirv.hpp"
++#include "glslang/SPIRV/spirv.hpp"
+ 
+ #include "libshaderc_util/compiler.h"
+ #include "libshaderc_util/counting_includer.h"
+diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
+index ef7867f..acc172b 100644
+--- a/libshaderc_util/src/compiler.cc
++++ b/libshaderc_util/src/compiler.cc
+@@ -26,7 +26,7 @@
+ #include "libshaderc_util/string_piece.h"
+ #include "libshaderc_util/version_profile.h"
+ 
+-#include "SPIRV/GlslangToSpv.h"
++#include "glslang/SPIRV/GlslangToSpv.h"
+ 
+ namespace {
+ using shaderc_util::string_piece;
+@@ -291,17 +291,12 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile(
+       bases[static_cast<int>(UniformKind::StorageBuffer)]);
+   shader.setShiftUavBinding(
+       bases[static_cast<int>(UniformKind::UnorderedAccessView)]);
+-  shader.setHlslIoMapping(hlsl_iomap_);
+   shader.setResourceSetBinding(
+       hlsl_explicit_bindings_[static_cast<int>(used_shader_stage)]);
+   shader.setEnvClient(target_client_info.client,
+                       target_client_info.client_version);
+   shader.setEnvTarget(target_client_info.target_language,
+                       target_client_info.target_language_version);
+-  if (hlsl_functionality1_enabled_) {
+-    shader.setEnvTargetHlslFunctionality1();
+-  }
+-
+   const EShMessages rules = GetMessageRules(target_env_, source_language_,
+                                             hlsl_offsets_,
+                                             generate_debug_info_);
+@@ -478,9 +473,6 @@ std::tuple<bool, std::string, std::string> Compiler::PreprocessShader(
+   }
+   shader.setEnvClient(target_client_info.client,
+                       target_client_info.client_version);
+-  if (hlsl_functionality1_enabled_) {
+-    shader.setEnvTargetHlslFunctionality1();
+-  }
+ 
+   // The preprocessor might be sensitive to the target environment.
+   // So combine the existing rules with the just-give-me-preprocessor-output
diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
new file mode 100644
index 0000000000..ac3db09937
--- /dev/null
+++ b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
@@ -0,0 +1,36 @@
+SUMMARY  = "A collection of tools, libraries and tests for shader compilation"
+DESCRIPTION = ""
+SECTION = "graphics"
+HOMEPAGE = "https://github.com/google/shaderc"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
+
+SRC_URI = "https://github.com/google/shaderc/archive/v${PV}.tar.gz \
+           file://0001-fix-glslang-link-order.patch \
+           file://0002-shaderc-2019.0-fix-build-against-new-glslang.patch \
+"
+SRC_URI[md5sum] = "8eb2b40712db2762a5cc40b568fd8ad9"
+SRC_URI[sha256sum] = "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b"
+
+inherit cmake python3native
+
+DEPENDS = "spirv-tools-native glslang-native"
+
+EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Releas -DSHADERC_SKIP_TESTS=ON"
+
+do_configure_prepend() {
+    # de-vendor libs and disable git versioning
+    sed '/examples/d;/third_party/d' -i ${S}/CMakeLists.txt
+    sed '/build-version/d' -i ${S}/glslc/CMakeLists.txt
+    
+    # TODO: probably there is better solution for this.
+    # I dont know any method for get the version of a receipe dependent
+    # so do this ugly hack
+    cat <<- EOF > ${S}/glslc/src/build-version.inc
+"${PV}\\n"
+"$(pkg-config --modversion SPIRV-Tools)\\n"
+"$(glslangValidator --version | head -1 | cut -d' ' -f3)\\n"
+EOF
+}
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH 5/5] shaderc: enable only native build as the target is failing
  2020-10-13 17:34 [PATCH] add shaderc recipe Jose Quaresma
                   ` (3 preceding siblings ...)
  2020-10-13 17:35 ` [PATCH 4/5] shaderc: " Jose Quaresma
@ 2020-10-13 17:35 ` Jose Quaresma
  2020-10-13 18:58   ` [OE-core] " Andrey Zhizhikin
  4 siblings, 1 reply; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 17:35 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jose Quaresma

For now, only the native build its working.
The target build is failing, when we can build for target
this commit can be reverted.

Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
---
 .../shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
 rename meta/recipes-graphics/shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} (86%)

diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
similarity index 86%
rename from meta/recipes-graphics/shaderc/shaderc_2019.0.bb
rename to meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
index ac3db09937..4e095e1243 100644
--- a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
+++ b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
@@ -33,4 +33,8 @@ do_configure_prepend() {
 EOF
 }
 
-BBCLASSEXTEND = "native nativesdk"
+# TODO: for now only the native build its working
+# the target build is failing, when the target builds
+# we can drop this inherit and rename the receipe.
+inherit native
+#BBCLASSEXTEND = "native nativesdk"
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 3/5] glslang: add receipe
  2020-10-13 17:35 ` [PATCH 3/5] glslang: add receipe Jose Quaresma
@ 2020-10-13 18:54   ` Andrey Zhizhikin
  2020-10-13 18:57     ` Alexander Kanavin
  2020-10-13 20:39     ` Jose Quaresma
  0 siblings, 2 replies; 16+ messages in thread
From: Andrey Zhizhikin @ 2020-10-13 18:54 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: OE Core mailing list

On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
>
> Glslang is the official reference compiler front end for the
> OpenGL ES and OpenGL shading languages. It implements a strict interpretation
> of the specifications for these languages. It is open and free for anyone to use,
> either from a command line or programmatically.
>
> This receipe is needed to build the new shaderc
>
> Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> ---
>  .../glslang/glslang_8.13.3559.bb              | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
>  create mode 100644 meta/recipes-graphics/glslang/glslang_8.13.3559.bb
>
> diff --git a/meta/recipes-graphics/glslang/glslang_8.13.3559.bb b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> new file mode 100644
> index 0000000000..2008ba59d8
> --- /dev/null
> +++ b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> @@ -0,0 +1,19 @@
> +SUMMARY = "OpenGL / OpenGL ES Reference Compiler"
> +DESCRIPTION = "Glslang is the official reference compiler front end for the \
> +OpenGL ES and OpenGL shading languages. It implements a strict interpretation \
> +of the specifications for these languages. It is open and free for anyone to use, \
> +either from a command line or programmatically."
> +SECTION = "graphics"
> +HOMEPAGE = "https://www.khronos.org/opengles/sdk/tools/Reference-Compiler"
> +LICENSE = "BSD-3-Clause"
> +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=918e668376010a04448a312fb37ae69b"
> +
> +SRC_URI = "https://github.com/KhronosGroup/glslang/archive/${PV}.tar.gz"
> +SRC_URI[md5sum] = "cb32322377cee2bc1cee5b60ebe46133"
> +SRC_URI[sha256sum] = "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca"

Any reason why archive is preferred here over GIT? I can see that the
source repository has tags defined, so it would be better to use GIT
instead of archive here.

> +
> +inherit cmake python3native
> +
> +EXTRA_OECMAKE = ""
This is not needed, as there are no extra cmake arguments supplied anyway.

> +
> +BBCLASSEXTEND = "native nativesdk"
> --
> 2.28.0
>
>
> 
>


-- 
Regards,
Andrey.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 3/5] glslang: add receipe
  2020-10-13 18:54   ` [OE-core] " Andrey Zhizhikin
@ 2020-10-13 18:57     ` Alexander Kanavin
  2020-10-13 20:39     ` Jose Quaresma
  1 sibling, 0 replies; 16+ messages in thread
From: Alexander Kanavin @ 2020-10-13 18:57 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: Jose Quaresma, OE Core mailing list

[-- Attachment #1: Type: text/plain, Size: 2489 bytes --]

Also, github archives are not stable, and can change checksums over time.

Alex

On Tue, 13 Oct 2020 at 20:54, Andrey Zhizhikin <andrey.z@gmail.com> wrote:

> On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com>
> wrote:
> >
> > Glslang is the official reference compiler front end for the
> > OpenGL ES and OpenGL shading languages. It implements a strict
> interpretation
> > of the specifications for these languages. It is open and free for
> anyone to use,
> > either from a command line or programmatically.
> >
> > This receipe is needed to build the new shaderc
> >
> > Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > ---
> >  .../glslang/glslang_8.13.3559.bb              | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >  create mode 100644 meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> >
> > diff --git a/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> > new file mode 100644
> > index 0000000000..2008ba59d8
> > --- /dev/null
> > +++ b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> > @@ -0,0 +1,19 @@
> > +SUMMARY = "OpenGL / OpenGL ES Reference Compiler"
> > +DESCRIPTION = "Glslang is the official reference compiler front end for
> the \
> > +OpenGL ES and OpenGL shading languages. It implements a strict
> interpretation \
> > +of the specifications for these languages. It is open and free for
> anyone to use, \
> > +either from a command line or programmatically."
> > +SECTION = "graphics"
> > +HOMEPAGE = "
> https://www.khronos.org/opengles/sdk/tools/Reference-Compiler"
> > +LICENSE = "BSD-3-Clause"
> > +LIC_FILES_CHKSUM =
> "file://LICENSE.txt;md5=918e668376010a04448a312fb37ae69b"
> > +
> > +SRC_URI = "https://github.com/KhronosGroup/glslang/archive/${PV}.tar.gz
> "
> > +SRC_URI[md5sum] = "cb32322377cee2bc1cee5b60ebe46133"
> > +SRC_URI[sha256sum] =
> "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca"
>
> Any reason why archive is preferred here over GIT? I can see that the
> source repository has tags defined, so it would be better to use GIT
> instead of archive here.
>
> > +
> > +inherit cmake python3native
> > +
> > +EXTRA_OECMAKE = ""
> This is not needed, as there are no extra cmake arguments supplied anyway.
>
> > +
> > +BBCLASSEXTEND = "native nativesdk"
> > --
> > 2.28.0
> >
> >
> >
> >
>
>
> --
> Regards,
> Andrey.
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 3878 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 5/5] shaderc: enable only native build as the target is failing
  2020-10-13 17:35 ` [PATCH 5/5] shaderc: enable only native build as the target is failing Jose Quaresma
@ 2020-10-13 18:58   ` Andrey Zhizhikin
  2020-10-13 20:52     ` Jose Quaresma
  0 siblings, 1 reply; 16+ messages in thread
From: Andrey Zhizhikin @ 2020-10-13 18:58 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: OE Core mailing list

On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
>
> For now, only the native build its working.
> The target build is failing, when we can build for target
> this commit can be reverted.
>
> Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> ---
>  .../shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>  rename meta/recipes-graphics/shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} (86%)
>
> diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> similarity index 86%
> rename from meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> rename to meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> index ac3db09937..4e095e1243 100644
> --- a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> +++ b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> @@ -33,4 +33,8 @@ do_configure_prepend() {
>  EOF
>  }
>
> -BBCLASSEXTEND = "native nativesdk"
> +# TODO: for now only the native build its working
> +# the target build is failing, when the target builds
> +# we can drop this inherit and rename the receipe.
> +inherit native
> +#BBCLASSEXTEND = "native nativesdk"

Maybe BBCLASSEXTEND = "native" then? Why leave a stale commented code here?

More generic: should the failed target build be investigated further
here? Is there any severe technical problem that should be solved
here?

> --
> 2.28.0
>
>
> 
>


-- 
Regards,
Andrey.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 4/5] shaderc: add receipe
  2020-10-13 17:35 ` [PATCH 4/5] shaderc: " Jose Quaresma
@ 2020-10-13 18:58   ` Alexander Kanavin
  2020-10-13 20:40     ` Jose Quaresma
  2020-10-13 19:01   ` Andrey Zhizhikin
  1 sibling, 1 reply; 16+ messages in thread
From: Alexander Kanavin @ 2020-10-13 18:58 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 8117 bytes --]

Same here: please build from git://

Alex

On Tue, 13 Oct 2020 at 19:35, Jose Quaresma <quaresma.jose@gmail.com> wrote:

> A collection of tools, libraries and tests for shader compilation
>
> This receipe is needed to build the gstreamer vulkan plugin
> as it provides the binary glslc.
>
> It is based on arch linux shaderc packge including the patches
>
> https://github.com/archlinux/svntogit-packages/blob/91f0fa6ee3a220264a448527c1a8cf037caaad8e/trunk/PKGBUILD
>
>     * 0001-fix-glslang-link-order.patch
>       Upstream-Status: Backport [21c8be385b3fab5edcb934a6d99f69fd389c4e67]
>
>     * 0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>       Upstream-Status: Pending
>
> Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> ---
>  .../files/0001-fix-glslang-link-order.patch   | 44 +++++++++++++++
>  ...2019.0-fix-build-against-new-glslang.patch | 54 +++++++++++++++++++
>  .../shaderc/shaderc_2019.0.bb                 | 36 +++++++++++++
>  3 files changed, 134 insertions(+)
>  create mode 100644
> meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
>  create mode 100644
> meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>  create mode 100644 meta/recipes-graphics/shaderc/shaderc_2019.0.bb
>
> diff --git
> a/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> new file mode 100644
> index 0000000000..a404c85839
> --- /dev/null
> +++ b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> @@ -0,0 +1,44 @@
> +From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001
> +From: Niklas Haas <git@haasn.xyz>
> +Date: Tue, 29 May 2018 07:34:00 +0200
> +Subject: [PATCH] Fix the link order of libglslang and libHLSL
> +
> +libglslang depends on libHLSL, so the latter needs to be specified last.
> +This fixes an issue when trying to build shaderc against system-wide
> +versions of libglslang/libHLSL, rather than the in-tree versions from
> +third_party.
> +
> +Additionally, libshaderc_util also depends on SPIRV-Tools
> +---
> + glslc/CMakeLists.txt           | 2 +-
> + libshaderc_util/CMakeLists.txt | 4 ++--
> + 2 files changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
> +index acf6fb0b..0f5d8886 100644
> +--- a/glslc/CMakeLists.txt
> ++++ b/glslc/CMakeLists.txt
> +@@ -18,7 +18,7 @@ add_library(glslc STATIC
> + shaderc_default_compile_options(glslc)
> + target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
> + target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
> +-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
> ++  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
> + target_link_libraries(glslc PRIVATE shaderc_util shaderc)
> +
> + add_executable(glslc_exe src/main.cc)
> +diff --git a/libshaderc_util/CMakeLists.txt
> b/libshaderc_util/CMakeLists.txt
> +index 873540ab..6d0c465c 100644
> +--- a/libshaderc_util/CMakeLists.txt
> ++++ b/libshaderc_util/CMakeLists.txt
> +@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
> +
> + find_package(Threads)
> + target_link_libraries(shaderc_util PRIVATE
> +-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
> +-  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
> ++  glslang OSDependent OGLCompiler glslang HLSL SPIRV
> ++  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
> +
> + shaderc_add_tests(
> +   TEST_PREFIX shaderc_util
> diff --git
> a/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> new file mode 100644
> index 0000000000..807540cf62
> --- /dev/null
> +++
> b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> @@ -0,0 +1,54 @@
> +diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
> +index 3c3c3de..b5fc6cb 100644
> +--- a/libshaderc/src/shaderc.cc
> ++++ b/libshaderc/src/shaderc.cc
> +@@ -20,7 +20,7 @@
> + #include <sstream>
> + #include <vector>
> +
> +-#include "SPIRV/spirv.hpp"
> ++#include "glslang/SPIRV/spirv.hpp"
> +
> + #include "libshaderc_util/compiler.h"
> + #include "libshaderc_util/counting_includer.h"
> +diff --git a/libshaderc_util/src/compiler.cc
> b/libshaderc_util/src/compiler.cc
> +index ef7867f..acc172b 100644
> +--- a/libshaderc_util/src/compiler.cc
> ++++ b/libshaderc_util/src/compiler.cc
> +@@ -26,7 +26,7 @@
> + #include "libshaderc_util/string_piece.h"
> + #include "libshaderc_util/version_profile.h"
> +
> +-#include "SPIRV/GlslangToSpv.h"
> ++#include "glslang/SPIRV/GlslangToSpv.h"
> +
> + namespace {
> + using shaderc_util::string_piece;
> +@@ -291,17 +291,12 @@ std::tuple<bool, std::vector<uint32_t>, size_t>
> Compiler::Compile(
> +       bases[static_cast<int>(UniformKind::StorageBuffer)]);
> +   shader.setShiftUavBinding(
> +       bases[static_cast<int>(UniformKind::UnorderedAccessView)]);
> +-  shader.setHlslIoMapping(hlsl_iomap_);
> +   shader.setResourceSetBinding(
> +       hlsl_explicit_bindings_[static_cast<int>(used_shader_stage)]);
> +   shader.setEnvClient(target_client_info.client,
> +                       target_client_info.client_version);
> +   shader.setEnvTarget(target_client_info.target_language,
> +                       target_client_info.target_language_version);
> +-  if (hlsl_functionality1_enabled_) {
> +-    shader.setEnvTargetHlslFunctionality1();
> +-  }
> +-
> +   const EShMessages rules = GetMessageRules(target_env_,
> source_language_,
> +                                             hlsl_offsets_,
> +                                             generate_debug_info_);
> +@@ -478,9 +473,6 @@ std::tuple<bool, std::string, std::string>
> Compiler::PreprocessShader(
> +   }
> +   shader.setEnvClient(target_client_info.client,
> +                       target_client_info.client_version);
> +-  if (hlsl_functionality1_enabled_) {
> +-    shader.setEnvTargetHlslFunctionality1();
> +-  }
> +
> +   // The preprocessor might be sensitive to the target environment.
> +   // So combine the existing rules with the
> just-give-me-preprocessor-output
> diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> new file mode 100644
> index 0000000000..ac3db09937
> --- /dev/null
> +++ b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> @@ -0,0 +1,36 @@
> +SUMMARY  = "A collection of tools, libraries and tests for shader
> compilation"
> +DESCRIPTION = ""
> +SECTION = "graphics"
> +HOMEPAGE = "https://github.com/google/shaderc"
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
> +
> +SRC_URI = "https://github.com/google/shaderc/archive/v${PV}.tar.gz \
> +           file://0001-fix-glslang-link-order.patch \
> +           file://0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> \
> +"
> +SRC_URI[md5sum] = "8eb2b40712db2762a5cc40b568fd8ad9"
> +SRC_URI[sha256sum] =
> "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b"
> +
> +inherit cmake python3native
> +
> +DEPENDS = "spirv-tools-native glslang-native"
> +
> +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Releas -DSHADERC_SKIP_TESTS=ON"
> +
> +do_configure_prepend() {
> +    # de-vendor libs and disable git versioning
> +    sed '/examples/d;/third_party/d' -i ${S}/CMakeLists.txt
> +    sed '/build-version/d' -i ${S}/glslc/CMakeLists.txt
> +
> +    # TODO: probably there is better solution for this.
> +    # I dont know any method for get the version of a receipe dependent
> +    # so do this ugly hack
> +    cat <<- EOF > ${S}/glslc/src/build-version.inc
> +"${PV}\\n"
> +"$(pkg-config --modversion SPIRV-Tools)\\n"
> +"$(glslangValidator --version | head -1 | cut -d' ' -f3)\\n"
> +EOF
> +}
> +
> +BBCLASSEXTEND = "native nativesdk"
> --
> 2.28.0
>
>
> 
>
>

[-- Attachment #2: Type: text/html, Size: 10092 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 4/5] shaderc: add receipe
  2020-10-13 17:35 ` [PATCH 4/5] shaderc: " Jose Quaresma
  2020-10-13 18:58   ` [OE-core] " Alexander Kanavin
@ 2020-10-13 19:01   ` Andrey Zhizhikin
  2020-10-13 20:41     ` Jose Quaresma
  1 sibling, 1 reply; 16+ messages in thread
From: Andrey Zhizhikin @ 2020-10-13 19:01 UTC (permalink / raw)
  To: Jose Quaresma; +Cc: OE Core mailing list

On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
>
> A collection of tools, libraries and tests for shader compilation
>
> This receipe is needed to build the gstreamer vulkan plugin
> as it provides the binary glslc.
>
> It is based on arch linux shaderc packge including the patches
> https://github.com/archlinux/svntogit-packages/blob/91f0fa6ee3a220264a448527c1a8cf037caaad8e/trunk/PKGBUILD
>
>     * 0001-fix-glslang-link-order.patch
>       Upstream-Status: Backport [21c8be385b3fab5edcb934a6d99f69fd389c4e67]
>
>     * 0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>       Upstream-Status: Pending
>
> Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> ---
>  .../files/0001-fix-glslang-link-order.patch   | 44 +++++++++++++++
>  ...2019.0-fix-build-against-new-glslang.patch | 54 +++++++++++++++++++
>  .../shaderc/shaderc_2019.0.bb                 | 36 +++++++++++++
>  3 files changed, 134 insertions(+)
>  create mode 100644 meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
>  create mode 100644 meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>  create mode 100644 meta/recipes-graphics/shaderc/shaderc_2019.0.bb
>
> diff --git a/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> new file mode 100644
> index 0000000000..a404c85839
> --- /dev/null
> +++ b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> @@ -0,0 +1,44 @@
> +From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001
> +From: Niklas Haas <git@haasn.xyz>
> +Date: Tue, 29 May 2018 07:34:00 +0200
> +Subject: [PATCH] Fix the link order of libglslang and libHLSL
> +
> +libglslang depends on libHLSL, so the latter needs to be specified last.
> +This fixes an issue when trying to build shaderc against system-wide
> +versions of libglslang/libHLSL, rather than the in-tree versions from
> +third_party.
> +
> +Additionally, libshaderc_util also depends on SPIRV-Tools
> +---
> + glslc/CMakeLists.txt           | 2 +-
> + libshaderc_util/CMakeLists.txt | 4 ++--
> + 2 files changed, 3 insertions(+), 3 deletions(-)
> +
> +diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
> +index acf6fb0b..0f5d8886 100644
> +--- a/glslc/CMakeLists.txt
> ++++ b/glslc/CMakeLists.txt
> +@@ -18,7 +18,7 @@ add_library(glslc STATIC
> + shaderc_default_compile_options(glslc)
> + target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
> + target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
> +-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
> ++  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
> + target_link_libraries(glslc PRIVATE shaderc_util shaderc)
> +
> + add_executable(glslc_exe src/main.cc)
> +diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
> +index 873540ab..6d0c465c 100644
> +--- a/libshaderc_util/CMakeLists.txt
> ++++ b/libshaderc_util/CMakeLists.txt
> +@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
> +
> + find_package(Threads)
> + target_link_libraries(shaderc_util PRIVATE
> +-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
> +-  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
> ++  glslang OSDependent OGLCompiler glslang HLSL SPIRV
> ++  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
> +
> + shaderc_add_tests(
> +   TEST_PREFIX shaderc_util
> diff --git a/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> new file mode 100644
> index 0000000000..807540cf62
> --- /dev/null
> +++ b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch

This patch does not have any Header, Signed-of-by: and
Upstream-Status. Would be really hard to track it, and should actually
fail AB.

> @@ -0,0 +1,54 @@
> +diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
> +index 3c3c3de..b5fc6cb 100644
> +--- a/libshaderc/src/shaderc.cc
> ++++ b/libshaderc/src/shaderc.cc
> +@@ -20,7 +20,7 @@
> + #include <sstream>
> + #include <vector>
> +
> +-#include "SPIRV/spirv.hpp"
> ++#include "glslang/SPIRV/spirv.hpp"
> +
> + #include "libshaderc_util/compiler.h"
> + #include "libshaderc_util/counting_includer.h"
> +diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
> +index ef7867f..acc172b 100644
> +--- a/libshaderc_util/src/compiler.cc
> ++++ b/libshaderc_util/src/compiler.cc
> +@@ -26,7 +26,7 @@
> + #include "libshaderc_util/string_piece.h"
> + #include "libshaderc_util/version_profile.h"
> +
> +-#include "SPIRV/GlslangToSpv.h"
> ++#include "glslang/SPIRV/GlslangToSpv.h"
> +
> + namespace {
> + using shaderc_util::string_piece;
> +@@ -291,17 +291,12 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile(
> +       bases[static_cast<int>(UniformKind::StorageBuffer)]);
> +   shader.setShiftUavBinding(
> +       bases[static_cast<int>(UniformKind::UnorderedAccessView)]);
> +-  shader.setHlslIoMapping(hlsl_iomap_);
> +   shader.setResourceSetBinding(
> +       hlsl_explicit_bindings_[static_cast<int>(used_shader_stage)]);
> +   shader.setEnvClient(target_client_info.client,
> +                       target_client_info.client_version);
> +   shader.setEnvTarget(target_client_info.target_language,
> +                       target_client_info.target_language_version);
> +-  if (hlsl_functionality1_enabled_) {
> +-    shader.setEnvTargetHlslFunctionality1();
> +-  }
> +-
> +   const EShMessages rules = GetMessageRules(target_env_, source_language_,
> +                                             hlsl_offsets_,
> +                                             generate_debug_info_);
> +@@ -478,9 +473,6 @@ std::tuple<bool, std::string, std::string> Compiler::PreprocessShader(
> +   }
> +   shader.setEnvClient(target_client_info.client,
> +                       target_client_info.client_version);
> +-  if (hlsl_functionality1_enabled_) {
> +-    shader.setEnvTargetHlslFunctionality1();
> +-  }
> +
> +   // The preprocessor might be sensitive to the target environment.
> +   // So combine the existing rules with the just-give-me-preprocessor-output
> diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> new file mode 100644
> index 0000000000..ac3db09937
> --- /dev/null
> +++ b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> @@ -0,0 +1,36 @@
> +SUMMARY  = "A collection of tools, libraries and tests for shader compilation"
> +DESCRIPTION = ""
> +SECTION = "graphics"
> +HOMEPAGE = "https://github.com/google/shaderc"
> +LICENSE = "Apache-2.0"
> +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
> +
> +SRC_URI = "https://github.com/google/shaderc/archive/v${PV}.tar.gz \
> +           file://0001-fix-glslang-link-order.patch \
> +           file://0002-shaderc-2019.0-fix-build-against-new-glslang.patch \
> +"
> +SRC_URI[md5sum] = "8eb2b40712db2762a5cc40b568fd8ad9"
> +SRC_URI[sha256sum] = "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b"
> +
> +inherit cmake python3native
> +
> +DEPENDS = "spirv-tools-native glslang-native"
> +
> +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Releas -DSHADERC_SKIP_TESTS=ON"
> +
> +do_configure_prepend() {
> +    # de-vendor libs and disable git versioning
> +    sed '/examples/d;/third_party/d' -i ${S}/CMakeLists.txt
> +    sed '/build-version/d' -i ${S}/glslc/CMakeLists.txt
> +
> +    # TODO: probably there is better solution for this.
> +    # I dont know any method for get the version of a receipe dependent
> +    # so do this ugly hack
> +    cat <<- EOF > ${S}/glslc/src/build-version.inc
> +"${PV}\\n"
> +"$(pkg-config --modversion SPIRV-Tools)\\n"
> +"$(glslangValidator --version | head -1 | cut -d' ' -f3)\\n"
> +EOF
> +}
> +
> +BBCLASSEXTEND = "native nativesdk"
> --
> 2.28.0
>
>
> 
>


-- 
Regards,
Andrey.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 3/5] glslang: add receipe
  2020-10-13 18:54   ` [OE-core] " Andrey Zhizhikin
  2020-10-13 18:57     ` Alexander Kanavin
@ 2020-10-13 20:39     ` Jose Quaresma
  1 sibling, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 20:39 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: OE Core mailing list

Andrey Zhizhikin <andrey.z@gmail.com> escreveu no dia terça,
13/10/2020 à(s) 19:54:
>
> On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
> >
> > Glslang is the official reference compiler front end for the
> > OpenGL ES and OpenGL shading languages. It implements a strict interpretation
> > of the specifications for these languages. It is open and free for anyone to use,
> > either from a command line or programmatically.
> >
> > This receipe is needed to build the new shaderc
> >
> > Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > ---
> >  .../glslang/glslang_8.13.3559.bb              | 19 +++++++++++++++++++
> >  1 file changed, 19 insertions(+)
> >  create mode 100644 meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> >
> > diff --git a/meta/recipes-graphics/glslang/glslang_8.13.3559.bb b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> > new file mode 100644
> > index 0000000000..2008ba59d8
> > --- /dev/null
> > +++ b/meta/recipes-graphics/glslang/glslang_8.13.3559.bb
> > @@ -0,0 +1,19 @@
> > +SUMMARY = "OpenGL / OpenGL ES Reference Compiler"
> > +DESCRIPTION = "Glslang is the official reference compiler front end for the \
> > +OpenGL ES and OpenGL shading languages. It implements a strict interpretation \
> > +of the specifications for these languages. It is open and free for anyone to use, \
> > +either from a command line or programmatically."
> > +SECTION = "graphics"
> > +HOMEPAGE = "https://www.khronos.org/opengles/sdk/tools/Reference-Compiler"
> > +LICENSE = "BSD-3-Clause"
> > +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=918e668376010a04448a312fb37ae69b"
> > +
> > +SRC_URI = "https://github.com/KhronosGroup/glslang/archive/${PV}.tar.gz"
> > +SRC_URI[md5sum] = "cb32322377cee2bc1cee5b60ebe46133"
> > +SRC_URI[sha256sum] = "c58fdcf7e00943ba10f9ae565b2725ec9d5be7dab7c8e82cac72fcaa83c652ca"
>
> Any reason why archive is preferred here over GIT? I can see that the
> source repository has tags defined, so it would be better to use GIT
> instead of archive here.
>

There is no reason to use the archive here.
I will fix it in the next version and change it to git.

> > +
> > +inherit cmake python3native
> > +
> > +EXTRA_OECMAKE = ""
> This is not needed, as there are no extra cmake arguments supplied anyway.
>

I will remove it.

> > +
> > +BBCLASSEXTEND = "native nativesdk"
> > --
> > 2.28.0
> >
> >
> > 
> >
>
>
> --
> Regards,
> Andrey.



-- 
best regards,
José Quaresma

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 4/5] shaderc: add receipe
  2020-10-13 18:58   ` [OE-core] " Alexander Kanavin
@ 2020-10-13 20:40     ` Jose Quaresma
  0 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 20:40 UTC (permalink / raw)
  To: Alexander Kanavin; +Cc: OE-core

I will fix it and use git instead of the archive.

Alexander Kanavin <alex.kanavin@gmail.com> escreveu no dia terça,
13/10/2020 à(s) 19:59:
>
> Same here: please build from git://
>
> Alex
>
> On Tue, 13 Oct 2020 at 19:35, Jose Quaresma <quaresma.jose@gmail.com> wrote:
>>
>> A collection of tools, libraries and tests for shader compilation
>>
>> This receipe is needed to build the gstreamer vulkan plugin
>> as it provides the binary glslc.
>>
>> It is based on arch linux shaderc packge including the patches
>> https://github.com/archlinux/svntogit-packages/blob/91f0fa6ee3a220264a448527c1a8cf037caaad8e/trunk/PKGBUILD
>>
>>     * 0001-fix-glslang-link-order.patch
>>       Upstream-Status: Backport [21c8be385b3fab5edcb934a6d99f69fd389c4e67]
>>
>>     * 0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>>       Upstream-Status: Pending
>>
>> Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
>> ---
>>  .../files/0001-fix-glslang-link-order.patch   | 44 +++++++++++++++
>>  ...2019.0-fix-build-against-new-glslang.patch | 54 +++++++++++++++++++
>>  .../shaderc/shaderc_2019.0.bb                 | 36 +++++++++++++
>>  3 files changed, 134 insertions(+)
>>  create mode 100644 meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
>>  create mode 100644 meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>>  create mode 100644 meta/recipes-graphics/shaderc/shaderc_2019.0.bb
>>
>> diff --git a/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
>> new file mode 100644
>> index 0000000000..a404c85839
>> --- /dev/null
>> +++ b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
>> @@ -0,0 +1,44 @@
>> +From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001
>> +From: Niklas Haas <git@haasn.xyz>
>> +Date: Tue, 29 May 2018 07:34:00 +0200
>> +Subject: [PATCH] Fix the link order of libglslang and libHLSL
>> +
>> +libglslang depends on libHLSL, so the latter needs to be specified last.
>> +This fixes an issue when trying to build shaderc against system-wide
>> +versions of libglslang/libHLSL, rather than the in-tree versions from
>> +third_party.
>> +
>> +Additionally, libshaderc_util also depends on SPIRV-Tools
>> +---
>> + glslc/CMakeLists.txt           | 2 +-
>> + libshaderc_util/CMakeLists.txt | 4 ++--
>> + 2 files changed, 3 insertions(+), 3 deletions(-)
>> +
>> +diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
>> +index acf6fb0b..0f5d8886 100644
>> +--- a/glslc/CMakeLists.txt
>> ++++ b/glslc/CMakeLists.txt
>> +@@ -18,7 +18,7 @@ add_library(glslc STATIC
>> + shaderc_default_compile_options(glslc)
>> + target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
>> + target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
>> +-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
>> ++  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
>> + target_link_libraries(glslc PRIVATE shaderc_util shaderc)
>> +
>> + add_executable(glslc_exe src/main.cc)
>> +diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
>> +index 873540ab..6d0c465c 100644
>> +--- a/libshaderc_util/CMakeLists.txt
>> ++++ b/libshaderc_util/CMakeLists.txt
>> +@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
>> +
>> + find_package(Threads)
>> + target_link_libraries(shaderc_util PRIVATE
>> +-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
>> +-  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
>> ++  glslang OSDependent OGLCompiler glslang HLSL SPIRV
>> ++  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
>> +
>> + shaderc_add_tests(
>> +   TEST_PREFIX shaderc_util
>> diff --git a/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>> new file mode 100644
>> index 0000000000..807540cf62
>> --- /dev/null
>> +++ b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>> @@ -0,0 +1,54 @@
>> +diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
>> +index 3c3c3de..b5fc6cb 100644
>> +--- a/libshaderc/src/shaderc.cc
>> ++++ b/libshaderc/src/shaderc.cc
>> +@@ -20,7 +20,7 @@
>> + #include <sstream>
>> + #include <vector>
>> +
>> +-#include "SPIRV/spirv.hpp"
>> ++#include "glslang/SPIRV/spirv.hpp"
>> +
>> + #include "libshaderc_util/compiler.h"
>> + #include "libshaderc_util/counting_includer.h"
>> +diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
>> +index ef7867f..acc172b 100644
>> +--- a/libshaderc_util/src/compiler.cc
>> ++++ b/libshaderc_util/src/compiler.cc
>> +@@ -26,7 +26,7 @@
>> + #include "libshaderc_util/string_piece.h"
>> + #include "libshaderc_util/version_profile.h"
>> +
>> +-#include "SPIRV/GlslangToSpv.h"
>> ++#include "glslang/SPIRV/GlslangToSpv.h"
>> +
>> + namespace {
>> + using shaderc_util::string_piece;
>> +@@ -291,17 +291,12 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile(
>> +       bases[static_cast<int>(UniformKind::StorageBuffer)]);
>> +   shader.setShiftUavBinding(
>> +       bases[static_cast<int>(UniformKind::UnorderedAccessView)]);
>> +-  shader.setHlslIoMapping(hlsl_iomap_);
>> +   shader.setResourceSetBinding(
>> +       hlsl_explicit_bindings_[static_cast<int>(used_shader_stage)]);
>> +   shader.setEnvClient(target_client_info.client,
>> +                       target_client_info.client_version);
>> +   shader.setEnvTarget(target_client_info.target_language,
>> +                       target_client_info.target_language_version);
>> +-  if (hlsl_functionality1_enabled_) {
>> +-    shader.setEnvTargetHlslFunctionality1();
>> +-  }
>> +-
>> +   const EShMessages rules = GetMessageRules(target_env_, source_language_,
>> +                                             hlsl_offsets_,
>> +                                             generate_debug_info_);
>> +@@ -478,9 +473,6 @@ std::tuple<bool, std::string, std::string> Compiler::PreprocessShader(
>> +   }
>> +   shader.setEnvClient(target_client_info.client,
>> +                       target_client_info.client_version);
>> +-  if (hlsl_functionality1_enabled_) {
>> +-    shader.setEnvTargetHlslFunctionality1();
>> +-  }
>> +
>> +   // The preprocessor might be sensitive to the target environment.
>> +   // So combine the existing rules with the just-give-me-preprocessor-output
>> diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
>> new file mode 100644
>> index 0000000000..ac3db09937
>> --- /dev/null
>> +++ b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
>> @@ -0,0 +1,36 @@
>> +SUMMARY  = "A collection of tools, libraries and tests for shader compilation"
>> +DESCRIPTION = ""
>> +SECTION = "graphics"
>> +HOMEPAGE = "https://github.com/google/shaderc"
>> +LICENSE = "Apache-2.0"
>> +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
>> +
>> +SRC_URI = "https://github.com/google/shaderc/archive/v${PV}.tar.gz \
>> +           file://0001-fix-glslang-link-order.patch \
>> +           file://0002-shaderc-2019.0-fix-build-against-new-glslang.patch \
>> +"
>> +SRC_URI[md5sum] = "8eb2b40712db2762a5cc40b568fd8ad9"
>> +SRC_URI[sha256sum] = "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b"
>> +
>> +inherit cmake python3native
>> +
>> +DEPENDS = "spirv-tools-native glslang-native"
>> +
>> +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Releas -DSHADERC_SKIP_TESTS=ON"
>> +
>> +do_configure_prepend() {
>> +    # de-vendor libs and disable git versioning
>> +    sed '/examples/d;/third_party/d' -i ${S}/CMakeLists.txt
>> +    sed '/build-version/d' -i ${S}/glslc/CMakeLists.txt
>> +
>> +    # TODO: probably there is better solution for this.
>> +    # I dont know any method for get the version of a receipe dependent
>> +    # so do this ugly hack
>> +    cat <<- EOF > ${S}/glslc/src/build-version.inc
>> +"${PV}\\n"
>> +"$(pkg-config --modversion SPIRV-Tools)\\n"
>> +"$(glslangValidator --version | head -1 | cut -d' ' -f3)\\n"
>> +EOF
>> +}
>> +
>> +BBCLASSEXTEND = "native nativesdk"
>> --
>> 2.28.0
>>
>>
>> 
>>


-- 
best regards,
José Quaresma

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 4/5] shaderc: add receipe
  2020-10-13 19:01   ` Andrey Zhizhikin
@ 2020-10-13 20:41     ` Jose Quaresma
  0 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 20:41 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: OE Core mailing list

Andrey Zhizhikin <andrey.z@gmail.com> escreveu no dia terça,
13/10/2020 à(s) 20:01:
>
> On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
> >
> > A collection of tools, libraries and tests for shader compilation
> >
> > This receipe is needed to build the gstreamer vulkan plugin
> > as it provides the binary glslc.
> >
> > It is based on arch linux shaderc packge including the patches
> > https://github.com/archlinux/svntogit-packages/blob/91f0fa6ee3a220264a448527c1a8cf037caaad8e/trunk/PKGBUILD
> >
> >     * 0001-fix-glslang-link-order.patch
> >       Upstream-Status: Backport [21c8be385b3fab5edcb934a6d99f69fd389c4e67]
> >
> >     * 0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> >       Upstream-Status: Pending
> >
> > Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > ---
> >  .../files/0001-fix-glslang-link-order.patch   | 44 +++++++++++++++
> >  ...2019.0-fix-build-against-new-glslang.patch | 54 +++++++++++++++++++
> >  .../shaderc/shaderc_2019.0.bb                 | 36 +++++++++++++
> >  3 files changed, 134 insertions(+)
> >  create mode 100644 meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> >  create mode 100644 meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> >  create mode 100644 meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> >
> > diff --git a/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> > new file mode 100644
> > index 0000000000..a404c85839
> > --- /dev/null
> > +++ b/meta/recipes-graphics/shaderc/files/0001-fix-glslang-link-order.patch
> > @@ -0,0 +1,44 @@
> > +From 21c8be385b3fab5edcb934a6d99f69fd389c4e67 Mon Sep 17 00:00:00 2001
> > +From: Niklas Haas <git@haasn.xyz>
> > +Date: Tue, 29 May 2018 07:34:00 +0200
> > +Subject: [PATCH] Fix the link order of libglslang and libHLSL
> > +
> > +libglslang depends on libHLSL, so the latter needs to be specified last.
> > +This fixes an issue when trying to build shaderc against system-wide
> > +versions of libglslang/libHLSL, rather than the in-tree versions from
> > +third_party.
> > +
> > +Additionally, libshaderc_util also depends on SPIRV-Tools
> > +---
> > + glslc/CMakeLists.txt           | 2 +-
> > + libshaderc_util/CMakeLists.txt | 4 ++--
> > + 2 files changed, 3 insertions(+), 3 deletions(-)
> > +
> > +diff --git a/glslc/CMakeLists.txt b/glslc/CMakeLists.txt
> > +index acf6fb0b..0f5d8886 100644
> > +--- a/glslc/CMakeLists.txt
> > ++++ b/glslc/CMakeLists.txt
> > +@@ -18,7 +18,7 @@ add_library(glslc STATIC
> > + shaderc_default_compile_options(glslc)
> > + target_include_directories(glslc PUBLIC ${glslang_SOURCE_DIR})
> > + target_link_libraries(glslc PRIVATE glslang OSDependent OGLCompiler
> > +-  HLSL glslang SPIRV ${CMAKE_THREAD_LIBS_INIT})
> > ++  glslang SPIRV HLSL ${CMAKE_THREAD_LIBS_INIT})
> > + target_link_libraries(glslc PRIVATE shaderc_util shaderc)
> > +
> > + add_executable(glslc_exe src/main.cc)
> > +diff --git a/libshaderc_util/CMakeLists.txt b/libshaderc_util/CMakeLists.txt
> > +index 873540ab..6d0c465c 100644
> > +--- a/libshaderc_util/CMakeLists.txt
> > ++++ b/libshaderc_util/CMakeLists.txt
> > +@@ -34,8 +34,8 @@ endif(SHADERC_ENABLE_INSTALL)
> > +
> > + find_package(Threads)
> > + target_link_libraries(shaderc_util PRIVATE
> > +-  glslang OSDependent OGLCompiler HLSL glslang SPIRV
> > +-  SPIRV-Tools-opt ${CMAKE_THREAD_LIBS_INIT})
> > ++  glslang OSDependent OGLCompiler glslang HLSL SPIRV
> > ++  SPIRV-Tools-opt SPIRV-Tools ${CMAKE_THREAD_LIBS_INIT})
> > +
> > + shaderc_add_tests(
> > +   TEST_PREFIX shaderc_util
> > diff --git a/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
> > new file mode 100644
> > index 0000000000..807540cf62
> > --- /dev/null
> > +++ b/meta/recipes-graphics/shaderc/files/0002-shaderc-2019.0-fix-build-against-new-glslang.patch
>
> This patch does not have any Header, Signed-of-by: and
> Upstream-Status. Would be really hard to track it, and should actually
> fail AB.

I will try to fix it and find the author of the patch.

>
> > @@ -0,0 +1,54 @@
> > +diff --git a/libshaderc/src/shaderc.cc b/libshaderc/src/shaderc.cc
> > +index 3c3c3de..b5fc6cb 100644
> > +--- a/libshaderc/src/shaderc.cc
> > ++++ b/libshaderc/src/shaderc.cc
> > +@@ -20,7 +20,7 @@
> > + #include <sstream>
> > + #include <vector>
> > +
> > +-#include "SPIRV/spirv.hpp"
> > ++#include "glslang/SPIRV/spirv.hpp"
> > +
> > + #include "libshaderc_util/compiler.h"
> > + #include "libshaderc_util/counting_includer.h"
> > +diff --git a/libshaderc_util/src/compiler.cc b/libshaderc_util/src/compiler.cc
> > +index ef7867f..acc172b 100644
> > +--- a/libshaderc_util/src/compiler.cc
> > ++++ b/libshaderc_util/src/compiler.cc
> > +@@ -26,7 +26,7 @@
> > + #include "libshaderc_util/string_piece.h"
> > + #include "libshaderc_util/version_profile.h"
> > +
> > +-#include "SPIRV/GlslangToSpv.h"
> > ++#include "glslang/SPIRV/GlslangToSpv.h"
> > +
> > + namespace {
> > + using shaderc_util::string_piece;
> > +@@ -291,17 +291,12 @@ std::tuple<bool, std::vector<uint32_t>, size_t> Compiler::Compile(
> > +       bases[static_cast<int>(UniformKind::StorageBuffer)]);
> > +   shader.setShiftUavBinding(
> > +       bases[static_cast<int>(UniformKind::UnorderedAccessView)]);
> > +-  shader.setHlslIoMapping(hlsl_iomap_);
> > +   shader.setResourceSetBinding(
> > +       hlsl_explicit_bindings_[static_cast<int>(used_shader_stage)]);
> > +   shader.setEnvClient(target_client_info.client,
> > +                       target_client_info.client_version);
> > +   shader.setEnvTarget(target_client_info.target_language,
> > +                       target_client_info.target_language_version);
> > +-  if (hlsl_functionality1_enabled_) {
> > +-    shader.setEnvTargetHlslFunctionality1();
> > +-  }
> > +-
> > +   const EShMessages rules = GetMessageRules(target_env_, source_language_,
> > +                                             hlsl_offsets_,
> > +                                             generate_debug_info_);
> > +@@ -478,9 +473,6 @@ std::tuple<bool, std::string, std::string> Compiler::PreprocessShader(
> > +   }
> > +   shader.setEnvClient(target_client_info.client,
> > +                       target_client_info.client_version);
> > +-  if (hlsl_functionality1_enabled_) {
> > +-    shader.setEnvTargetHlslFunctionality1();
> > +-  }
> > +
> > +   // The preprocessor might be sensitive to the target environment.
> > +   // So combine the existing rules with the just-give-me-preprocessor-output
> > diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> > new file mode 100644
> > index 0000000000..ac3db09937
> > --- /dev/null
> > +++ b/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> > @@ -0,0 +1,36 @@
> > +SUMMARY  = "A collection of tools, libraries and tests for shader compilation"
> > +DESCRIPTION = ""
> > +SECTION = "graphics"
> > +HOMEPAGE = "https://github.com/google/shaderc"
> > +LICENSE = "Apache-2.0"
> > +LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
> > +
> > +SRC_URI = "https://github.com/google/shaderc/archive/v${PV}.tar.gz \
> > +           file://0001-fix-glslang-link-order.patch \
> > +           file://0002-shaderc-2019.0-fix-build-against-new-glslang.patch \
> > +"
> > +SRC_URI[md5sum] = "8eb2b40712db2762a5cc40b568fd8ad9"
> > +SRC_URI[sha256sum] = "1018cd02be52295272fdbffa056ee24b881be277c83d039ad554d91230f4e11b"
> > +
> > +inherit cmake python3native
> > +
> > +DEPENDS = "spirv-tools-native glslang-native"
> > +
> > +EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Releas -DSHADERC_SKIP_TESTS=ON"
> > +
> > +do_configure_prepend() {
> > +    # de-vendor libs and disable git versioning
> > +    sed '/examples/d;/third_party/d' -i ${S}/CMakeLists.txt
> > +    sed '/build-version/d' -i ${S}/glslc/CMakeLists.txt
> > +
> > +    # TODO: probably there is better solution for this.
> > +    # I dont know any method for get the version of a receipe dependent
> > +    # so do this ugly hack
> > +    cat <<- EOF > ${S}/glslc/src/build-version.inc
> > +"${PV}\\n"
> > +"$(pkg-config --modversion SPIRV-Tools)\\n"
> > +"$(glslangValidator --version | head -1 | cut -d' ' -f3)\\n"
> > +EOF
> > +}
> > +
> > +BBCLASSEXTEND = "native nativesdk"
> > --
> > 2.28.0
> >
> >
> > 
> >
>
>
> --
> Regards,
> Andrey.



-- 
best regards,
José Quaresma

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 5/5] shaderc: enable only native build as the target is failing
  2020-10-13 18:58   ` [OE-core] " Andrey Zhizhikin
@ 2020-10-13 20:52     ` Jose Quaresma
  2020-10-13 22:03       ` Jose Quaresma
  0 siblings, 1 reply; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 20:52 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: OE Core mailing list

Andrey Zhizhikin <andrey.z@gmail.com> escreveu no dia terça,
13/10/2020 à(s) 19:58:
>
> On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
> >
> > For now, only the native build its working.
> > The target build is failing, when we can build for target
> > this commit can be reverted.
> >
> > Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > ---
> >  .../shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >  rename meta/recipes-graphics/shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} (86%)
> >
> > diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> > similarity index 86%
> > rename from meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> > rename to meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> > index ac3db09937..4e095e1243 100644
> > --- a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> > +++ b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> > @@ -33,4 +33,8 @@ do_configure_prepend() {
> >  EOF
> >  }
> >
> > -BBCLASSEXTEND = "native nativesdk"
> > +# TODO: for now only the native build its working
> > +# the target build is failing, when the target builds
> > +# we can drop this inherit and rename the receipe.
> > +inherit native
> > +#BBCLASSEXTEND = "native nativesdk"
>
> Maybe BBCLASSEXTEND = "native" then? Why leave a stale commented code here?

with BBCLASSEXTEND = "native" the build fail when i run: bitbake shaderc

>
> More generic: should the failed target build be investigated further
> here? Is there any severe technical problem that should be solved
> here?

This commit is only to find some help in building shaderc for the target.
If anyone needs to build the gstreamer plugin on the target it will need
the shaderc on the target.

Because of these constraints in building for the target I rename the
recipe to only support native build.
Some extra pacthes are required to build it for the target and I need
some help for this.

>
> > --
> > 2.28.0
> >
> >
> > 
> >
>
>
> --
> Regards,
> Andrey.



-- 
best regards,
José Quaresma

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [OE-core] [PATCH 5/5] shaderc: enable only native build as the target is failing
  2020-10-13 20:52     ` Jose Quaresma
@ 2020-10-13 22:03       ` Jose Quaresma
  0 siblings, 0 replies; 16+ messages in thread
From: Jose Quaresma @ 2020-10-13 22:03 UTC (permalink / raw)
  To: Andrey Zhizhikin; +Cc: OE Core mailing list

I have fixed this!

the mistake are:

-DEPENDS = "spirv-tools-native glslang-native"
+DEPENDS = "spirv-tools glslang"

I drop this patch on V2

Jose Quaresma <quaresma.jose@gmail.com> escreveu no dia terça,
13/10/2020 à(s) 21:52:
>
> Andrey Zhizhikin <andrey.z@gmail.com> escreveu no dia terça,
> 13/10/2020 à(s) 19:58:
> >
> > On Tue, Oct 13, 2020 at 7:35 PM Jose Quaresma <quaresma.jose@gmail.com> wrote:
> > >
> > > For now, only the native build its working.
> > > The target build is failing, when we can build for target
> > > this commit can be reverted.
> > >
> > > Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
> > > ---
> > >  .../shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} | 6 +++++-
> > >  1 file changed, 5 insertions(+), 1 deletion(-)
> > >  rename meta/recipes-graphics/shaderc/{shaderc_2019.0.bb => shaderc-native_2019.0.bb} (86%)
> > >
> > > diff --git a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> > > similarity index 86%
> > > rename from meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> > > rename to meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> > > index ac3db09937..4e095e1243 100644
> > > --- a/meta/recipes-graphics/shaderc/shaderc_2019.0.bb
> > > +++ b/meta/recipes-graphics/shaderc/shaderc-native_2019.0.bb
> > > @@ -33,4 +33,8 @@ do_configure_prepend() {
> > >  EOF
> > >  }
> > >
> > > -BBCLASSEXTEND = "native nativesdk"
> > > +# TODO: for now only the native build its working
> > > +# the target build is failing, when the target builds
> > > +# we can drop this inherit and rename the receipe.
> > > +inherit native
> > > +#BBCLASSEXTEND = "native nativesdk"
> >
> > Maybe BBCLASSEXTEND = "native" then? Why leave a stale commented code here?
>
> with BBCLASSEXTEND = "native" the build fail when i run: bitbake shaderc
>
> >
> > More generic: should the failed target build be investigated further
> > here? Is there any severe technical problem that should be solved
> > here?
>
> This commit is only to find some help in building shaderc for the target.
> If anyone needs to build the gstreamer plugin on the target it will need
> the shaderc on the target.
>
> Because of these constraints in building for the target I rename the
> recipe to only support native build.
> Some extra pacthes are required to build it for the target and I need
> some help for this.
>
> >
> > > --
> > > 2.28.0
> > >
> > >
> > > 
> > >
> >
> >
> > --
> > Regards,
> > Andrey.
>
>
>
> --
> best regards,
> José Quaresma



-- 
best regards,
José Quaresma

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-10-13 22:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-13 17:34 [PATCH] add shaderc recipe Jose Quaresma
2020-10-13 17:34 ` [PATCH 1/5] spirv-tools: import from meta-oe to OE core Jose Quaresma
2020-10-13 17:34 ` [PATCH 2/5] spirv-tools: enable native build and install more header files Jose Quaresma
2020-10-13 17:35 ` [PATCH 3/5] glslang: add receipe Jose Quaresma
2020-10-13 18:54   ` [OE-core] " Andrey Zhizhikin
2020-10-13 18:57     ` Alexander Kanavin
2020-10-13 20:39     ` Jose Quaresma
2020-10-13 17:35 ` [PATCH 4/5] shaderc: " Jose Quaresma
2020-10-13 18:58   ` [OE-core] " Alexander Kanavin
2020-10-13 20:40     ` Jose Quaresma
2020-10-13 19:01   ` Andrey Zhizhikin
2020-10-13 20:41     ` Jose Quaresma
2020-10-13 17:35 ` [PATCH 5/5] shaderc: enable only native build as the target is failing Jose Quaresma
2020-10-13 18:58   ` [OE-core] " Andrey Zhizhikin
2020-10-13 20:52     ` Jose Quaresma
2020-10-13 22:03       ` Jose Quaresma

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.