Blender's GPU Accelerated UI, Decoupled from it's original codebase. Supports Rust, Python, JS, React, C & C++. Twice as good as GPUI
#!/bin/sh
# Compiles bui_ui.hlsl into ../intern/gpu_d3d11_shaders.h (checked in, so
# builds need no shader compiler). FXC: path to fxc.exe (Windows SDK).
set -e
cd "$(dirname "$0")"
FXC=${FXC:-"C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x64/fxc.exe"}
OUT=../intern/gpu_d3d11_shaders.h
TMP=$(mktemp -d)
for e in vs_quad:vs_4_0 ps_quad:ps_4_0 vs_tri:vs_4_0 ps_tri:ps_4_0 vs_mesh:vs_4_0 ps_mesh:ps_4_0; do
name=${e%%:*}
prof=${e##*:}
"$FXC" //nologo //O3 //Qstrip_reflect //Qstrip_debug //T $prof //E $name //Vn g_$name //Fh "$TMP/$name.h" bui_ui.hlsl > /dev/null
done
{
echo "/* Generated by gpu/shaders/build.sh from bui_ui.hlsl. Do not edit. */"
cat "$TMP/vs_quad.h" "$TMP/ps_quad.h" "$TMP/vs_tri.h" "$TMP/ps_tri.h" "$TMP/vs_mesh.h" "$TMP/ps_mesh.h" |
sed -e '/^#if 0/,/^#endif/d' -e '/^\/\//d' -e '/^$/d'
} > "$OUT.tmp"
rm -rf "$TMP"
mv "$OUT.tmp" "$OUT"
echo "wrote $OUT"