Commit Graph

6 Commits

Author SHA1 Message Date
Philip Rideout
20680e8170 Improve resgen speed and avoid using static.
(1)
Generating the C file (only used for WebAssembly) causes slowness in the
build so this makes it into an option. Also, we were flushing too often,
which made it even slower.

(2)
Using "static" in a header was causing symbol duplication.
2018-11-29 17:21:27 -08:00
Philip Rideout
239317ee10 Use resgen for libshaders. 2018-11-29 07:37:56 -08:00
Philip Rideout
12754fd7eb Minor resgen improvements.
This adds a couple optional features:

1) Preserve file extensions when generating symbols.
   This is useful to distinguish foo.vs from foo.fs

2) Append null characters to data blobs.
   Useful when treating FOO_DATA as a C string.
2018-11-28 16:58:41 -08:00
Philip Rideout
30092dc12b Add style guidelines for strings.
This also adds the std:: qualifier to resgen (see also PR #356)
2018-11-27 09:05:57 -08:00
Philip Rideout
0807cfbaaa Fix Windows build. 2018-11-21 22:14:22 -08:00
Philip Rideout
e90b53fdce Introduce resgen tool for embedding binary blobs.
This tool can be used to replace inc files for built-in materials. The
inc files are unfriendly to IDE's and do not extend to non-material
resource types such as baked texture data.

The tool aggregates a sequence of binary blobs, each of which becomes a
"resource" whose id is the basename of the input file. It produces the
following set of files:

    resources.h ......... declares sizes and offsets for each resource
    resources.S ......... small assembly file with incbin directive
    resources.apple.S ... ditto but with different rodata name
    resources.bin ....... the aggregated binary blob
    resources.c ......... large xxd-style array (only for WASM)

We did an experiment to test the incbin directive on a variety of
platforms in PR #510.
2018-11-21 17:18:21 -08:00