gtk/gsk/gpu/shaders/process-glsl-includes.py
Benjamin Otte 1a85d569e3 gpu: Add ability to run shaders
This heaves over an inital chunk of code from the Vulkan renderer to
execute shaders.

The only shader that exists for now is a shader that draws a single
texture.
We use that to replace the blit op we were doing before.
2024-01-07 07:22:49 +01:00

26 lines
491 B
Python

#!/usr/bin/env python3
import sys
import re
import os
loaded_files = []
def load (path):
if (path in loaded_files):
return
loaded_files.append (path)
with open(path) as f:
lines = f.readlines()
for line in lines:
match = re.search (r"^#include \"(.*)\"$", line)
if (match):
load (os.path.join (os.path.dirname(path), match.group(1)))
else:
print (line, end="")
load (sys.argv[1])