mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 13:26:02 +00:00
BC images are created decoded (RGBA8/R8/RG8/RGBA16F, keeping sRGB/SNORM meaning) and every buffer->image upload is a compute dispatch (shaders/bc_decode.comp, a GLSL port of bcdec with BC6H mode layouts generated from its source). The app's compute bindings are restored after. bcn_check: all 10 formats incl. every BC6H/BC7 mode bit-exact with bcdec; DXVK accepts the Mali-like device (BC, clip/cull, maintenance5 emulated) and its BC/clip checks pass. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KZqR8XUE8czvGzEpgSCVQR
21 lines
807 B
Bash
Executable File
21 lines
807 B
Bash
Executable File
#!/bin/bash
|
|
# Compiles the BCn decoder variants into app/src/main/cpp/vkbridge/bc_spv.h (committed, so a build
|
|
# needs no shader compiler). Needs glslangValidator; regenerates bc_tables.glsl first.
|
|
set -eu
|
|
cd "$(dirname "$0")"
|
|
python3 gen_bc_tables.py
|
|
out=../../../app/src/main/cpp/vkbridge/bc_spv.h
|
|
tmp=$(mktemp -d)
|
|
{
|
|
echo "/* Generated by tools/vkbridge/shaders/build.sh from bc_decode.comp - do not edit. */"
|
|
echo "#pragma once"
|
|
echo "#include <stdint.h>"
|
|
} > "$out"
|
|
for f in BC1 BC2 BC3 BC4 BC5 BC6H BC7; do
|
|
name=spv_$(echo $f | tr A-Z a-z)
|
|
glslangValidator -V --target-env vulkan1.1 -DFMT_$f --vn "$name" -o "$tmp/$name.h" bc_decode.comp >/dev/null
|
|
grep -v '^ *//\|#pragma once' "$tmp/$name.h" | sed 's/^const uint32_t/static const uint32_t/' >> "$out"
|
|
done
|
|
rm -rf "$tmp"
|
|
echo "wrote $out"
|