summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_context.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2016-08-03 11:55:55 -0700
committerEric Anholt <[email protected]>2016-08-04 08:48:27 -0700
commit2350569a78c60d32e3b751b4386ea7e6d7e2ebe9 (patch)
treebfa6665039f9d99215394493858761f2c6a99df5 /src/gallium/drivers/vc4/vc4_context.h
parent62ea2461edbd4db2b82df02f7a77bcb707e65656 (diff)
vc4: Avoid VS shader recompiles by keeping a set of FS inputs seen so far.
We don't want to bake the whole array into the FS key, because of the hashing overhead. But we can keep a set of the arrays seen, and use a pointer to the copy in as the array's proxy. Between this and the previous patch, gl-1.0-blend-func now passes on hardware, where previously it was filling the 256MB CMA area with shaders and OOMing. Drops 712 shaders from shader-db.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_context.h')
-rw-r--r--src/gallium/drivers/vc4/vc4_context.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/gallium/drivers/vc4/vc4_context.h b/src/gallium/drivers/vc4/vc4_context.h
index b656539611c..c3474a04963 100644
--- a/src/gallium/drivers/vc4/vc4_context.h
+++ b/src/gallium/drivers/vc4/vc4_context.h
@@ -69,6 +69,7 @@
#define VC4_DIRTY_COMPILED_CS (1 << 23)
#define VC4_DIRTY_COMPILED_VS (1 << 24)
#define VC4_DIRTY_COMPILED_FS (1 << 25)
+#define VC4_DIRTY_FS_INPUTS (1 << 26)
struct vc4_sampler_view {
struct pipe_sampler_view base;
@@ -123,6 +124,17 @@ struct vc4_ubo_range {
uint32_t size;
};
+struct vc4_fs_inputs {
+ /**
+ * Array of the meanings of the VPM inputs this shader needs.
+ *
+ * It doesn't include those that aren't part of the VPM, like
+ * point/line coordinates.
+ */
+ struct vc4_varying_slot *input_slots;
+ uint32_t num_inputs;
+};
+
struct vc4_compiled_shader {
uint64_t program_id;
struct vc4_bo *bo;
@@ -152,13 +164,7 @@ struct vc4_compiled_shader {
uint8_t vattr_offsets[9];
uint8_t vattrs_live;
- /**
- * Array of the meanings of the VPM inputs this shader needs.
- *
- * It doesn't include those that aren't part of the VPM, like
- * point/line coordinates.
- */
- struct vc4_varying_slot *input_slots;
+ const struct vc4_fs_inputs *fs_inputs;
};
struct vc4_program_stateobj {
@@ -270,6 +276,7 @@ struct vc4_context {
struct primconvert_context *primconvert;
struct hash_table *fs_cache, *vs_cache;
+ struct set *fs_inputs_set;
uint32_t next_uncompiled_program_id;
uint64_t next_compiled_program_id;