[Mesa-dev] [RESEND 04/13] anv: don't pass xmlfile via stdin anv_entrypoints_gen.py

Dylan Baker dylan at pnwbakers.com
Wed Feb 22 23:35:15 UTC 2017


It's slow, and has the potential for encoding issues.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 src/intel/vulkan/Makefile.am            | 6 ++----
 src/intel/vulkan/anv_entrypoints_gen.py | 6 +++++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/Makefile.am b/src/intel/vulkan/Makefile.am
index 449188fe1e..5a0e4ef4ff 100644
--- a/src/intel/vulkan/Makefile.am
+++ b/src/intel/vulkan/Makefile.am
@@ -146,12 +146,10 @@ libvulkan_intel_la_SOURCES = $(VULKAN_GEM_FILES)
 vulkan_api_xml = $(top_srcdir)/src/vulkan/registry/vk.xml
 
 anv_entrypoints.h : anv_entrypoints_gen.py $(vulkan_api_xml)
-	$(AM_V_GEN) cat $(vulkan_api_xml) |\
-	$(PYTHON2) $(srcdir)/anv_entrypoints_gen.py header > $@
+	$(AM_V_GEN)$(PYTHON2) $(srcdir)/anv_entrypoints_gen.py header > $@
 
 anv_entrypoints.c : anv_entrypoints_gen.py $(vulkan_api_xml)
-	$(AM_V_GEN) cat $(vulkan_api_xml) |\
-	$(PYTHON2) $(srcdir)/anv_entrypoints_gen.py code > $@
+	$(AM_V_GEN)$(PYTHON2) $(srcdir)/anv_entrypoints_gen.py code > $@
 
 BUILT_SOURCES = $(VULKAN_GENERATED_FILES)
 CLEANFILES = $(BUILT_SOURCES) dev_icd.json intel_icd. at host_cpu@.json
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
index 40b8c805d5..5403bcb4bc 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -22,10 +22,14 @@
 # IN THE SOFTWARE.
 #
 
+import os
 import sys
 import textwrap
 import xml.etree.ElementTree as et
 
+VK_XML = os.path.join(
+    os.path.dirname(__file__), '..', '..', 'vulkan', 'registry', 'vk.xml')
+
 MAX_API_VERSION = 1.0
 
 SUPPORTED_EXTENSIONS = [
@@ -138,7 +142,7 @@ def get_entrypoints_defines(doc):
 
 
 def main():
-    doc = et.parse(sys.stdin)
+    doc = et.parse(VK_XML)
     entrypoints = get_entrypoints(doc, get_entrypoints_defines(doc))
 
     # Manually add CreateDmaBufImageINTEL for which we don't have an extension
-- 
2.11.1



More information about the mesa-dev mailing list