summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_shader.h
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-11-14 09:09:51 +0100
committerMarek Olšák <[email protected]>2016-11-21 21:44:35 +0100
commitef6c84b301ce15022d4907dfb0db5764e31e68f5 (patch)
treeb74d83cfe33e5098e7eec2ff78b5f596bceda22b /src/gallium/drivers/radeonsi/si_shader.h
parent7e76f9a7a8041e2fe6aa557f1520358f1c323553 (diff)
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 <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_shader.h')
-rw-r--r--src/gallium/drivers/radeonsi/si_shader.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/radeonsi/si_shader.h b/src/gallium/drivers/radeonsi/si_shader.h
index fc9c9131be8..aa37676f887 100644
--- a/src/gallium/drivers/radeonsi/si_shader.h
+++ b/src/gallium/drivers/radeonsi/si_shader.h
@@ -322,10 +322,6 @@ struct si_vs_prolog_bits {
/* Common VS bits between the shader key and the epilog key. */
struct si_vs_epilog_bits {
unsigned export_prim_id:1; /* when PS needs it and GS is disabled */
- /* TODO:
- * - skip layer, viewport, clipdist, and culldist parameter exports
- * if PS doesn't read them
- */
};
/* Common TCS bits between the shader key and the epilog key. */
@@ -440,6 +436,8 @@ struct si_shader_key {
/* Optimization flags for asynchronous compilation only. */
union {
struct {
+ uint64_t kill_outputs; /* "get_unique_index" bits */
+ uint32_t kill_outputs2; /* "get_unique_index2" bits */
unsigned clip_disable:1;
} hw_vs; /* HW VS (it can be VS, TES, GS) */
} opt;
@@ -468,6 +466,7 @@ enum {
EXP_PARAM_DEFAULT_VAL_0001,
EXP_PARAM_DEFAULT_VAL_1110,
EXP_PARAM_DEFAULT_VAL_1111,
+ EXP_PARAM_UNDEFINED = 255,
};
/* GCN-specific shader info. */