<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 26, 2016 at 8:12 AM, Rob Clark <span dir="ltr"><<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Mar 25, 2016 at 7:12 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
><br>
<br>
btw, will there be some point where we actually don't want to inline<br>
everything for vulkan and/or gl? Adreno does have call/return<br>
instructions (which I haven't really played with too much but I've<br>
seen blob use them in some cases).. and seems like at some threshold<br>
it would be better to have a smaller shader w/ call/ret rather than<br>
inline a large fxn that is called many times. (Above some size<br>
threshold, the shader needs to execute from external memory using<br>
internal memory as cache, rather than executing completely out of<br>
internal memory.)<br></blockquote><div><br></div><div>We have them too and have since gen4, I think. We've never used them to my knowledge. Sure, we may do so in the future, but it's probably still a ways off.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
otoh I still have enough assumptions in the ir3 code that there is<br>
just a single "main" fxn. Not sure if I should try to move away from<br>
those assumptions.. anyways, just random question this patch reminded<br>
me of.<br></blockquote><div><br></div><div>Same here. :-)<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
Reviewed-by: Rob Clark <<a href="mailto:robdclark@gmail.com">robdclark@gmail.com</a>><br>
<div><div class="h5"><br>
<br>
> ---<br>
> src/compiler/nir/nir.h | 11 +++++++++++<br>
> 1 file changed, 11 insertions(+)<br>
><br>
> diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h<br>
> index d46858e..d39c5fd 100644<br>
> --- a/src/compiler/nir/nir.h<br>
> +++ b/src/compiler/nir/nir.h<br>
> @@ -1816,6 +1816,17 @@ typedef struct nir_shader {<br>
> gl_shader_stage stage;<br>
> } nir_shader;<br>
><br>
> +static inline nir_function *<br>
> +nir_shader_get_entrypoint(nir_shader *shader)<br>
> +{<br>
> + assert(exec_list_length(&shader->functions) == 1);<br>
> + struct exec_node *func_node = exec_list_get_head(&shader->functions);<br>
> + nir_function *func = exec_node_data(nir_function, func_node, node);<br>
> + assert(func->return_type == glsl_void_type());<br>
> + assert(func->num_params == 0);<br>
> + return func;<br>
> +}<br>
> +<br>
> #define nir_foreach_function(shader, func) \<br>
> foreach_list_typed(nir_function, func, node, &(shader)->functions)<br>
><br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</div></div>> _______________________________________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</blockquote></div><br></div></div>