Files
Toastconcern--FrameStudio/tools/debugview/gen_debug_spirv.sh
T
ToastconcernandClaude Opus 5.5 f7345a5ac3 Frame Studio and Frame Home: cross-platform builds
Frame Studio now builds for Windows (x64, x86, ARM64), Linux (x64, x86, ARM64)
and macOS (Apple Silicon, Intel):
- studio/platform.h with Win32 and POSIX implementations (dialogs through
  tinyfiledialogs on Linux/macOS), a GLFW window beside the Win32 one, and a
  platform-neutral frame pacer
- MoltenVK support in the renderer (portability enumeration) and bundled in
  the macOS app
- 32-bit builds: large-address-aware, LZMA packing within a 32-bit address space
- unaligned file reads in the loaders go through loadUnaligned (no UB)
- scripts/build-studio.sh, studio/build_windows.bat [x64|x86|arm64],
  cmake/llvm-mingw.cmake, and a GitHub Actions workflow building every target

Frame Home installs without Studio: frame/install-frame-home.{sh,ps1} and
"Install Frame Home.bat" (packaged as FrameHome-installer.zip).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 12:03:25 -05:00

23 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# Regenerates src/debug_spirv.h from debug.vert / debug.frag (needs glslc: the Frame has it in /usr/bin).
set -e
cd "$(dirname "$0")"
glslc -O --target-env=vulkan1.1 -fshader-stage=vert debug.vert -o /tmp/debug.vert.spv
glslc -O --target-env=vulkan1.1 -fshader-stage=frag debug.frag -o /tmp/debug.frag.spv
python3 - /tmp/debug.vert.spv /tmp/debug.frag.spv > ../../src/debug_spirv.h <<'PY'
import struct, sys
print("#pragma once")
print("// GENERATED by tools/debugview/gen_debug_spirv.sh from tools/debugview/debug.{vert,frag}. Do not edit by hand.")
print("// vert: in vec3 position @0; set0 b0 buffer { Draw { mat4 clipFromModel[2]; mat4 worldFromModel; vec4 color; } d[]; } by gl_InstanceIndex")
print("// frag: out = color, faceted shading when spec 0 = 1")
print("#include <cstddef>\n#include <cstdint>\n")
for name, path in (("Vert", sys.argv[1]), ("Frag", sys.argv[2])):
data = open(path, "rb").read()
words = struct.unpack("<%dI" % (len(data) // 4), data)
print("static const uint32_t kDebug%sSpirv[] = {" % name)
for i in range(0, len(words), 8):
print(" " + ",".join("0x%08x" % w for w in words[i:i + 8]) + ",")
print("};")
print("static const size_t kDebug%sSize = sizeof(kDebug%sSpirv);\n" % (name, name))
PY