[Mesa-dev] [PATCH 10/14] glsl_to_tgsi: remove subroutine support

Marek Olšák maraeo at gmail.com
Mon Oct 17 18:47:13 UTC 2016


On Mon, Oct 17, 2016 at 8:21 PM, Brian Paul <brianp at vmware.com> wrote:
> The series looks OK to me.
>
> Acked-by: Brian Paul <brianp at vmware.com>
>
> I guess I have a general question though.  Over the years of debugging GL
> apps I've seen a few that generate pretty huge shaders (in terms of TGSI
> instructions).  I recall one (can't remember the app) in which a moderate
> size shader compiled into several 10s of thousands of instruction.  The
> cause was all the function call inlining.
>
> I'm wondering if there are cases where not inlining everything and using
> actual subroutines would make sense.  Has anyone ever taken a look into
> that?  Do any modern devices have a limit on program instructions?

No, there is no limit on program instructions since DX10 I think.
Shaders are just memory allocations that end with an "end"
instruction.

I guess compilation takes longer with longer shaders, but function
inlining usually decreases register usage, which increases GPU
occupancy and improves latency hiding, which means better performance.

Marek


More information about the mesa-dev mailing list