pan/bi: Output binaries from standalone compiler

Useful for shader replacement.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12026>
This commit is contained in:
Alyssa Rosenzweig 2021-07-19 20:00:38 -04:00 committed by Marge Bot
parent 8cbabbd532
commit cdc79d2a03
1 changed files with 8 additions and 0 deletions

View File

@ -193,6 +193,14 @@ compile_shader(int stages, char **files)
util_dynarray_clear(&binary);
bifrost_compile_shader_nir(nir[i], &inputs, &binary, &info);
char *fn = NULL;
asprintf(&fn, "shader_%u.bin", i);
assert(fn != NULL);
FILE *fp = fopen(fn, "wb");
fwrite(binary.data, 1, binary.size, fp);
fclose(fp);
free(fn);
}
util_dynarray_fini(&binary);