mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 14:20:11 +01:00
nir,vtn: Add exported bool to nir_function
For optimizing libraries. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25498>
This commit is contained in:
parent
103d20e657
commit
6014f745d5
4 changed files with 13 additions and 3 deletions
|
|
@ -503,6 +503,9 @@ nir_function_create(nir_shader *shader, const char *name)
|
|||
func->dont_inline = false;
|
||||
func->should_inline = false;
|
||||
|
||||
/* Only meaningful for shader libraries, so don't export by default. */
|
||||
func->is_exported = false;
|
||||
|
||||
return func;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3465,6 +3465,8 @@ typedef struct nir_function {
|
|||
nir_function_impl *impl;
|
||||
|
||||
bool is_entrypoint;
|
||||
/* from SPIR-V linkage, only for libraries */
|
||||
bool is_exported;
|
||||
bool is_preamble;
|
||||
/* from SPIR-V function control */
|
||||
bool should_inline;
|
||||
|
|
|
|||
|
|
@ -2224,9 +2224,13 @@ print_function(nir_function *function, print_state *state)
|
|||
{
|
||||
FILE *fp = state->fp;
|
||||
|
||||
fprintf(fp, "decl_function %s (%d params) %s", function->name,
|
||||
function->num_params, function->dont_inline ? "(noinline)" :
|
||||
function->should_inline ? "(inline)" : "");
|
||||
/* clang-format off */
|
||||
fprintf(fp, "decl_function %s (%d params)%s%s", function->name,
|
||||
function->num_params,
|
||||
function->dont_inline ? " (noinline)" :
|
||||
function->should_inline ? " (inline)" : "",
|
||||
function->is_exported ? " (exported)" : "");
|
||||
/* clang-format on */
|
||||
|
||||
fprintf(fp, "\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ vtn_cfg_handle_prepass_instruction(struct vtn_builder *b, SpvOp opcode,
|
|||
|
||||
func->should_inline = b->func->control & SpvFunctionControlInlineMask;
|
||||
func->dont_inline = b->func->control & SpvFunctionControlDontInlineMask;
|
||||
func->is_exported = b->func->linkage == SpvLinkageTypeExport;
|
||||
|
||||
func->num_params = num_params;
|
||||
func->params = ralloc_array(b->shader, nir_parameter, num_params);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue