func->impl = NULL;
func->is_entrypoint = false;
func->is_preamble = false;
+ func->dont_inline = false;
+ func->should_inline = false;
return func;
}
bool is_entrypoint;
bool is_preamble;
+ /* from SPIR-V function control */
+ bool should_inline;
+ bool dont_inline; /* from SPIR-V */
} nir_function;
typedef enum {
}
nfxn->is_entrypoint = fxn->is_entrypoint;
nfxn->is_preamble = fxn->is_preamble;
+ nfxn->should_inline = fxn->should_inline;
+ nfxn->dont_inline = fxn->dont_inline;
/* At first glance, it looks like we should clone the function_impl here.
* However, call instructions need to be able to reference at least the
{
FILE *fp = state->fp;
- fprintf(fp, "decl_function %s (%d params)", function->name,
- function->num_params);
+ fprintf(fp, "decl_function %s (%d params) %s", function->name,
+ function->num_params, function->dont_inline ? "(noinline)" :
+ function->should_inline ? "(inline)" : "");
fprintf(fp, "\n");
flags |= 0x4;
if (fxn->impl)
flags |= 0x8;
+ if (fxn->should_inline)
+ flags |= 0x10;
+ if (fxn->dont_inline)
+ flags |= 0x20;
blob_write_uint32(ctx->blob, flags);
if (fxn->name)
blob_write_string(ctx->blob, fxn->name);
fxn->is_preamble = flags & 0x2;
if (flags & 0x8)
fxn->impl = NIR_SERIALIZE_FUNC_HAS_IMPL;
+ fxn->should_inline = flags & 0x10;
+ fxn->dont_inline = flags & 0x20;
}
static void
if (func_type->return_type->base_type != vtn_base_type_void)
num_params++;
+ func->should_inline = b->func->control & SpvFunctionControlInlineMask;
+ func->dont_inline = b->func->control & SpvFunctionControlDontInlineMask;
+
func->num_params = num_params;
func->params = ralloc_array(b->shader, nir_parameter, num_params);