Skip to contentSkip to conversation

spirv-cross: Initial recipe for SPIRV-Cross

PATCH Superseded Ankit Navik 2 participants 5 messages Dec 22, 2018

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spirv-cross: Initial recipe for SPIRV-Cross

Add generic recipe for SPIRV-Cross tool.

---
 ...0001-Add-install-PHONY-target-in-Makefile.patch | 31 ++++++++++++++++++++++
 meta-oe/recipes-graphics/spir/spirv-cross_git.bb   | 22 +++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch
 create mode 100644 meta-oe/recipes-graphics/spir/spirv-cross_git.bb
meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch new file +31 -0
new file mode 100644
index 0000000..78598ea
@@ -0,0 +1,31 @@
+From 8d9870b66c3cfcf12ce7e8e013946e2a215bb722 Mon Sep 17 00:00:00 2001
+From: Ankit Navik <[email protected]>
+Date: Sat, 22 Dec 2018 19:16:02 +0530
+Subject: [PATCH] Add install PHONY target in Makefile
+
+---
+ Makefile | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0564b65..0993372 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,13 @@ $(STATIC_LIB): $(OBJECTS)
+ %.o: %.cpp
+ 	$(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
+ 
++install:
++	mkdir -p $(TARGET_DIR_BIN)
++	mkdir -p $(TARGET_DIR_LIB)
++	cp $(TARGET) $(TARGET_DIR_BIN)/
++	cp $(STATIC_LIB) $(TARGET_DIR_LIB)/
++
+ clean:
+ 	rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
+ 
+-.PHONY: clean
++.PHONY: all install clean
+-- 
+2.7.4
+
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +22 -0
new file mode 100644
index 0000000..b787972
@@ -0,0 +1,22 @@
+SUMMARY  = "SPIRV-Cross is a tool designed for parsing and converting SPIR-V \
+to other shader languages"
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+SECTION = "graphics"
+
+S = "${WORKDIR}/git"
+SRCREV = "ed16b3e69985feaf565efbecea70a1cc2fca2a58"
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-Cross.git \
+	file://0001-Add-install-PHONY-target-in-Makefile.patch \
+"
+
+EXTRA_OEMAKE += 'TARGET_DIR_LIB="${D}${libdir}"' 
+EXTRA_OEMAKE += 'TARGET_DIR_BIN="${D}${bindir}"'
+
+do_compile () {
+	cd ${S} && oe_runmake
+}
+
+do_install () {
+	cd ${S} && oe_runmake install
+}
Signature · 1 line
2.7.4
#1 lore raw
Quoted 66 lines · Ankit Navik

Add generic recipe for SPIRV-Cross tool.

---
 ...0001-Add-install-PHONY-target-in-Makefile.patch | 31 ++++++++++++++++++++++
 meta-oe/recipes-graphics/spir/spirv-cross_git.bb   | 22 +++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch
 create mode 100644 meta-oe/recipes-graphics/spir/spirv-cross_git.bb
meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch new file +31 -0
new file mode 100644
index 0000000..78598ea
@@ -0,0 +1,31 @@
+From 8d9870b66c3cfcf12ce7e8e013946e2a215bb722 Mon Sep 17 00:00:00 2001
+From: Ankit Navik <[email protected]>
+Date: Sat, 22 Dec 2018 19:16:02 +0530
+Subject: [PATCH] Add install PHONY target in Makefile
+
+---
+ Makefile | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0564b65..0993372 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,13 @@ $(STATIC_LIB): $(OBJECTS)
+ %.o: %.cpp
+       $(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
+
++install:
++      mkdir -p $(TARGET_DIR_BIN)
++      mkdir -p $(TARGET_DIR_LIB)
++      cp $(TARGET) $(TARGET_DIR_BIN)/
++      cp $(STATIC_LIB) $(TARGET_DIR_LIB)/
++
+ clean:
+       rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
+
+-.PHONY: clean
++.PHONY: all install clean
+--
+2.7.4
+
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +12 -0
new file mode 100644
index 0000000..b787972
@@ -0,0 +1,22 @@
+SUMMARY  = "SPIRV-Cross is a tool designed for parsing and converting SPIR-V \
+to other shader languages"
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+SECTION = "graphics"
+
+S = "${WORKDIR}/git"
+SRCREV = "ed16b3e69985feaf565efbecea70a1cc2fca2a58"
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-Cross.git \
+       file://0001-Add-install-PHONY-target-in-Makefile.patch \
+"
+

meta-oe/recipes-graphics/spir/spirv-cross_git.bb line 22

Quoted 10 lines
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +10 -0
+EXTRA_OEMAKE += 'TARGET_DIR_LIB="${D}${libdir}"'
+EXTRA_OEMAKE += 'TARGET_DIR_BIN="${D}${bindir}"'
+
+do_compile () {
+       cd ${S} && oe_runmake
+}
+
+do_install () {
+       cd ${S} && oe_runmake install
+}

this is not inheriting cross class, I think its better to rename it something not cross
may be spirv-compiler or some such

#2 lore raw

Hi Raj,

Quoted 74 lines · Khem Raj
Quoted 72 lines · Ankit Navik

Add generic recipe for SPIRV-Cross tool.

---
 ...0001-Add-install-PHONY-target-in-Makefile.patch | 31 ++++++++++++++++++++++
 meta-oe/recipes-graphics/spir/spirv-cross_git.bb   | 22 +++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch
 create mode 100644 meta-oe/recipes-graphics/spir/spirv-cross_git.bb
meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch new file +31 -0
new file mode 100644
index 0000000..78598ea
@@ -0,0 +1,31 @@
+From 8d9870b66c3cfcf12ce7e8e013946e2a215bb722 Mon Sep 17 00:00:00 2001
+From: Ankit Navik <[email protected]>
+Date: Sat, 22 Dec 2018 19:16:02 +0530
+Subject: [PATCH] Add install PHONY target in Makefile
+
+---
+ Makefile | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0564b65..0993372 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,13 @@ $(STATIC_LIB): $(OBJECTS)
+ %.o: %.cpp
+       $(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
+
++install:
++      mkdir -p $(TARGET_DIR_BIN)
++      mkdir -p $(TARGET_DIR_LIB)
++      cp $(TARGET) $(TARGET_DIR_BIN)/
++      cp $(STATIC_LIB) $(TARGET_DIR_LIB)/
++
+ clean:
+       rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
+
+-.PHONY: clean
++.PHONY: all install clean
+--
+2.7.4
+
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +18 -0
new file mode 100644
index 0000000..b787972
@@ -0,0 +1,22 @@
+SUMMARY  = "SPIRV-Cross is a tool designed for parsing and converting SPIR-V \
+to other shader languages"
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+SECTION = "graphics"
+
+S = "${WORKDIR}/git"
+SRCREV = "ed16b3e69985feaf565efbecea70a1cc2fca2a58"
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-Cross.git \
+       file://0001-Add-install-PHONY-target-in-Makefile.patch \
+"
+
+EXTRA_OEMAKE += 'TARGET_DIR_LIB="${D}${libdir}"'
+EXTRA_OEMAKE += 'TARGET_DIR_BIN="${D}${bindir}"'
+
+do_compile () {
+       cd ${S} && oe_runmake
+}
Quoted 8 lines

meta-oe/recipes-graphics/spir/spirv-cross_git.bb line 22

Quoted 4 lines
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +4 -0
+
+do_install () {
+       cd ${S} && oe_runmake install
+}

this is not inheriting cross class, I think its better to rename it something not cross
may be spirv-compiler or some such

The SPIRV-cross is tool for parsing and converting from spirv to other shader language(s).
I kept PN similar to github source.
spirv-compiler may not be be a good idea, because there is a spirv-llvm (front end compiler).
Let me know any other suggestion.

Regards, Ankit

#3 lore raw
Quoted 86 lines · Ankit Navik

Hi Raj,

Quoted 74 lines · Khem Raj
Quoted 72 lines · Ankit Navik

Add generic recipe for SPIRV-Cross tool.

---
 ...0001-Add-install-PHONY-target-in-Makefile.patch | 31 ++++++++++++++++++++++
 meta-oe/recipes-graphics/spir/spirv-cross_git.bb   | 22 +++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch
 create mode 100644 meta-oe/recipes-graphics/spir/spirv-cross_git.bb
meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch new file +31 -0
new file mode 100644
index 0000000..78598ea
@@ -0,0 +1,31 @@
+From 8d9870b66c3cfcf12ce7e8e013946e2a215bb722 Mon Sep 17 00:00:00 2001
+From: Ankit Navik <[email protected]>
+Date: Sat, 22 Dec 2018 19:16:02 +0530
+Subject: [PATCH] Add install PHONY target in Makefile
+
+---
+ Makefile | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0564b65..0993372 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,13 @@ $(STATIC_LIB): $(OBJECTS)
+ %.o: %.cpp
+       $(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
+
++install:
++      mkdir -p $(TARGET_DIR_BIN)
++      mkdir -p $(TARGET_DIR_LIB)
++      cp $(TARGET) $(TARGET_DIR_BIN)/
++      cp $(STATIC_LIB) $(TARGET_DIR_LIB)/
++
+ clean:
+       rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
+
+-.PHONY: clean
++.PHONY: all install clean
+--
+2.7.4
+
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +18 -0
new file mode 100644
index 0000000..b787972
@@ -0,0 +1,22 @@
+SUMMARY  = "SPIRV-Cross is a tool designed for parsing and converting SPIR-V \
+to other shader languages"
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+SECTION = "graphics"
+
+S = "${WORKDIR}/git"
+SRCREV = "ed16b3e69985feaf565efbecea70a1cc2fca2a58"
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-Cross.git \
+       file://0001-Add-install-PHONY-target-in-Makefile.patch \
+"
+
+EXTRA_OEMAKE += 'TARGET_DIR_LIB="${D}${libdir}"'
+EXTRA_OEMAKE += 'TARGET_DIR_BIN="${D}${bindir}"'
+
+do_compile () {
+       cd ${S} && oe_runmake
+}
Quoted 8 lines

meta-oe/recipes-graphics/spir/spirv-cross_git.bb line 22

Quoted 4 lines
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +4 -0
+
+do_install () {
+       cd ${S} && oe_runmake install
+}

this is not inheriting cross class, I think its better to rename it something not cross
may be spirv-compiler or some such

Quoted 3 lines

The SPIRV-cross is tool for parsing and converting from spirv to other shader language(s).
I kept PN similar to github source.

Right, however -cross has slightly different semantics in OE cross compiling world
where cross would indicate this package runs on build host and generates code for
target host that OE defines. and there ares some assumptions bases on that. May be
spirv-shader-generator is better.

Quoted 5 lines

spirv-compiler may not be be a good idea, because there is a spirv-llvm (front end compiler).
Let me know any other suggestion.

Regards, Ankit

#4 lore raw

Hi Raj,

Quoted 92 lines · Khem Raj
Quoted 86 lines · Ankit Navik

Hi Raj,

Quoted 74 lines · Khem Raj
Quoted 72 lines · Ankit Navik

Add generic recipe for SPIRV-Cross tool.

---
 ...0001-Add-install-PHONY-target-in-Makefile.patch | 31 ++++++++++++++++++++++
 meta-oe/recipes-graphics/spir/spirv-cross_git.bb   | 22 +++++++++++++++
 2 files changed, 53 insertions(+)
 create mode 100644 meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch
 create mode 100644 meta-oe/recipes-graphics/spir/spirv-cross_git.bb
meta-oe/recipes-graphics/spir/files/0001-Add-install-PHONY-target-in-Makefile.patch new file +31 -0
new file mode 100644
index 0000000..78598ea
@@ -0,0 +1,31 @@
+From 8d9870b66c3cfcf12ce7e8e013946e2a215bb722 Mon Sep 17 00:00:00 2001
+From: Ankit Navik <[email protected]>
+Date: Sat, 22 Dec 2018 19:16:02 +0530
+Subject: [PATCH] Add install PHONY target in Makefile
+
+---
+ Makefile | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile b/Makefile
+index 0564b65..0993372 100644
+--- a/Makefile
++++ b/Makefile
+@@ -35,7 +35,13 @@ $(STATIC_LIB): $(OBJECTS)
+ %.o: %.cpp
+       $(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
+
++install:
++      mkdir -p $(TARGET_DIR_BIN)
++      mkdir -p $(TARGET_DIR_LIB)
++      cp $(TARGET) $(TARGET_DIR_BIN)/
++      cp $(STATIC_LIB) $(TARGET_DIR_LIB)/
++
+ clean:
+       rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
+
+-.PHONY: clean
++.PHONY: all install clean
+--
+2.7.4
+
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +18 -0
new file mode 100644
index 0000000..b787972
@@ -0,0 +1,22 @@
+SUMMARY  = "SPIRV-Cross is a tool designed for parsing and converting SPIR-V \
+to other shader languages"
+LICENSE  = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
+SECTION = "graphics"
+
+S = "${WORKDIR}/git"
+SRCREV = "ed16b3e69985feaf565efbecea70a1cc2fca2a58"
+SRC_URI = "git://github.com/KhronosGroup/SPIRV-Cross.git \
+       file://0001-Add-install-PHONY-target-in-Makefile.patch \
+"
+
+EXTRA_OEMAKE += 'TARGET_DIR_LIB="${D}${libdir}"'
+EXTRA_OEMAKE += 'TARGET_DIR_BIN="${D}${bindir}"'
+
+do_compile () {
+       cd ${S} && oe_runmake
+}
Quoted 8 lines

meta-oe/recipes-graphics/spir/spirv-cross_git.bb line 22

Quoted 4 lines
meta-oe/recipes-graphics/spir/spirv-cross_git.bb new file +4 -0
+
+do_install () {
+       cd ${S} && oe_runmake install
+}

this is not inheriting cross class, I think its better to rename it something not cross
may be spirv-compiler or some such

Quoted 3 lines

The SPIRV-cross is tool for parsing and converting from spirv to other shader language(s).
I kept PN similar to github source.

Quoted 7 lines

Right, however -cross has slightly different semantics in OE cross compiling world
where cross would indicate this package runs on build host and generates code for
target host that OE defines. and there ares some assumptions bases on that. May be
spirv-shader-generator is better.

Thank you for the clarification.
Will incorporate in v2 patch.
Regards, Ankit

Quoted 6 lines
Quoted 6 lines

spirv-compiler may not be be a good idea, because there is a spirv-llvm (front end compiler).
Let me know any other suggestion.

Regards, Ankit