1# `regen.py`
2
3Regenerates magma.in and magma.attrib using
4[magma.json](https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/src/graphics/lib/magma/include/magma/magma.json)
5using some basic heuristics. This will overwrite any existing modifications to
6the output files. Subsequent verification is needed to ensure the interface and
7type definitions accurately match the API.
8
9# Regenerate encoder/decoder
10
11To regen the encoder/decoder, build ../generic-apigen and run the following commands:
12
13```
14mkdir -p enc_new
15mkdir -p dec_new
16vulkan-cereal/build/gfxstream-generic-apigen -i . -E enc_new/ -D dec_new/ magma
17```
18
19Note that both the `-E` and `-D` flags should be used together, as some
20definition errors are only visible during one of the two codegen phases. If
21codegen succeeded, the files should be moved to replace their existing
22counterparts:
23
24Encoder path: `$GOLDFISH_OPENGL/system/magma_enc`
25
26Decoder path: `$VULKAN_CEREAL/stream-servers/magma`
27