radeonsi: eliminate VS outputs that aren't used by PS at runtime
authorMarek Olšák <marek.olsak@amd.com>
Mon, 14 Nov 2016 08:09:51 +0000 (09:09 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 21 Nov 2016 20:44:35 +0000 (21:44 +0100)
commitef6c84b301ce15022d4907dfb0db5764e31e68f5
treeb74d83cfe33e5098e7eec2ff78b5f596bceda22b
parent7e76f9a7a8041e2fe6aa557f1520358f1c323553
radeonsi: eliminate VS outputs that aren't used by PS at runtime

A past commit added the ability to compile "optimized" shader variants
asynchronously (not stalling the app).

This commit builds upon that and adds what is basically a runtime shader
linker. If a VS output isn't used by the currently-bound PS, a new VS
compilation is started without that output. The new shader variant
is used when it's ready.

All apps using separate shader objects I've seen had unused VS outputs.

Eliminating unused/useless VS outputs also eliminates the corresponding
vertex attribute loads.

Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/drivers/radeonsi/si_shader.c
src/gallium/drivers/radeonsi/si_shader.h
src/gallium/drivers/radeonsi/si_state_shaders.c