qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 034/142] meson: generate shader headers


From: Paolo Bonzini
Subject: [PATCH 034/142] meson: generate shader headers
Date: Tue, 28 Jan 2020 18:51:54 +0100

From: Marc-André Lureau <address@hidden>

Signed-off-by: Marc-André Lureau <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
 Makefile              | 19 -------------------
 meson.build           |  1 +
 ui/meson.build        |  2 ++
 ui/shader/meson.build | 15 +++++++++++++++
 4 files changed, 18 insertions(+), 19 deletions(-)
 create mode 100644 ui/shader/meson.build

diff --git a/Makefile b/Makefile
index b77014faa4..a1cddb8476 100644
--- a/Makefile
+++ b/Makefile
@@ -364,7 +364,6 @@ clean: recurse-clean
        rm -f $(filter-out %.tlb,$(TOOLS)) $(HELPERS-y) TAGS cscope.* *.pod *~ 
*/*~
        rm -f fsdev/*.pod scsi/*.pod
        rm -f qemu-img-cmds.h
-       rm -f ui/shader/*-vert.h ui/shader/*-frag.h
        rm -f $(foreach f,$(generated-files-y),$(f) $(f)-timestamp)
        rm -f config-all-devices.mak
 
@@ -586,24 +585,6 @@ endif
        $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \
         done
 
-# opengl shader programs
-ui/shader/%-vert.h: $(SRC_PATH)/ui/shader/%.vert 
$(SRC_PATH)/scripts/shaderinclude.pl
-       @mkdir -p $(dir $@)
-       $(call quiet-command,\
-               perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
-               "VERT","$@")
-
-ui/shader/%-frag.h: $(SRC_PATH)/ui/shader/%.frag 
$(SRC_PATH)/scripts/shaderinclude.pl
-       @mkdir -p $(dir $@)
-       $(call quiet-command,\
-               perl $(SRC_PATH)/scripts/shaderinclude.pl $< > $@,\
-               "FRAG","$@")
-
-ui/shader.o: $(SRC_PATH)/ui/shader.c \
-       ui/shader/texture-blit-vert.h \
-       ui/shader/texture-blit-flip-vert.h \
-       ui/shader/texture-blit-frag.h
-
 # documentation
 MAKEINFO=makeinfo
 MAKEINFOINCLUDES= -I docs -I $(<D) -I $(@D)
diff --git a/meson.build b/meson.build
index afa53bee00..c0122a1ab9 100644
--- a/meson.build
+++ b/meson.build
@@ -117,6 +117,7 @@ have_block = have_system or have_tools
 
 # Generators
 
+shaderinclude = find_program('scripts/shaderinclude.pl')
 qapi_gen = find_program('scripts/qapi-gen.py')
 qapi_gen_depends = [ meson.source_root() / 'scripts/qapi/__init__.py',
                      meson.source_root() / 'scripts/qapi/commands.py',
diff --git a/ui/meson.build b/ui/meson.build
index cad97635d8..81577546e0 100644
--- a/ui/meson.build
+++ b/ui/meson.build
@@ -32,3 +32,5 @@ foreach e : keymaps
                           '--varname', 
'qemu_input_map_@0@_to_@1@'.format(e[0], e[1]),
                           'code-map', '@INPUT0@', e[0], e[1]])
 endforeach
+
+subdir('shader')
diff --git a/ui/shader/meson.build b/ui/shader/meson.build
new file mode 100644
index 0000000000..26c7a187b0
--- /dev/null
+++ b/ui/shader/meson.build
@@ -0,0 +1,15 @@
+shaders = [
+  ['texture-blit', 'frag'],
+  ['texture-blit', 'vert'],
+  ['texture-blit-flip', 'vert'],
+]
+
+foreach e : shaders
+  output = '@0@-@1@.h'.format(e[0], e[1])
+  custom_target(output,
+                output: output,
+                capture: true,
+                build_by_default: true, # to be removed when added to a target
+                input: files('@0@.@1@'.format(e[0], e[1])),
+                command: [shaderinclude, '@INPUT0@'])
+endforeach
-- 
2.21.0





reply via email to

[Prev in Thread] Current Thread [Next in Thread]