From 107684b00d65eac84e4bf2dfd34073d309230d50 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 16 May 2024 18:55:58 +0200 Subject: move shader compilation from runtime to compile-time --- makefile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index e024267..34c19bf 100644 --- a/makefile +++ b/makefile @@ -5,6 +5,7 @@ LDFLAGS += -lGLEW CFLAGS += -g .PHONY: FORCE +.SECONDARY: # do not remove intermediate files all: main FORCE @@ -18,12 +19,13 @@ main: hello_vert.o main.o: hello_vert.h main.o: hello_frag.h -%_frag.o %_frag.h &: %.frag - ld -r -b binary -o $*_frag.o $< - ./blobheader $< > $*_frag.h -%_vert.o %_vert.h &: %.vert - ld -r -b binary -o $*_vert.o $< - ./blobheader $< > $*_vert.h +%.s %.h &: %.spv + ./blob $< $* + +%_frag.spv: %.frag + glslc -o $@ $< +%_vert.spv: %.vert + glslc -o $@ $< clean: FORCE git clean -fxdi -- cgit v1.2.3