summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/v3d
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2018-12-30 08:59:54 -0800
committerEric Anholt <eric@anholt.net>2019-01-02 14:12:29 -0800
commit49d8e2aff1d7f7da6311dbae8621d6e79cea2d78 (patch)
tree849a9d95ec888cecb537501f2e52fef9f5e1a81d /src/gallium/drivers/v3d
parent3a81c753a3cfdcea215268c00f98ac87a09902e1 (diff)
v3d: Don't forget to include RT writes in precompiles.
Looking at some assembly dumps for an optimization, we were clearly missing important parts of the shader!
Diffstat (limited to 'src/gallium/drivers/v3d')
-rw-r--r--src/gallium/drivers/v3d/v3d_program.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_program.c b/src/gallium/drivers/v3d/v3d_program.c
index ef80069baab..ec9d0339528 100644
--- a/src/gallium/drivers/v3d/v3d_program.c
+++ b/src/gallium/drivers/v3d/v3d_program.c
@@ -197,6 +197,16 @@ v3d_shader_precompile(struct v3d_context *v3d,
.base.shader_state = so,
};
+ nir_foreach_variable(var, &s->outputs) {
+ if (var->data.location == FRAG_RESULT_COLOR) {
+ key.nr_cbufs = 1;
+ } else if (var->data.location == FRAG_RESULT_DATA0) {
+ key.nr_cbufs = MAX2(key.nr_cbufs,
+ var->data.location -
+ FRAG_RESULT_DATA0 + 1);
+ }
+ }
+
v3d_setup_shared_precompile_key(so, &key.base);
v3d_get_compiled_shader(v3d, &key.base);
} else {