aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-03-21 12:05:54 -0700
committerEric Anholt <[email protected]>2018-03-21 14:02:34 -0700
commitbaeb6a4b4a275bc418037b718c904180e9e5c690 (patch)
tree9b494ffe59b3e1bc8fa579ec70eb2b7e68654e1f /src/gallium
parent61603f0e4219fee2d288ece9d1b4105a8657fe38 (diff)
broadcom/vc5: Fix up the NIR types of FS outputs generated by NIR-to-TGSI.
Unfortunately TGSI doesn't record the type of the FS output like GLSL does, but VC5's TLB writes depend on the output's base type. Just record the type in the key at variant compile time when we've got a TGSI input and then fix it up. Fixes KHR-GLES3.packed_pixels.pbo_rectangle.rgba32i/ui and apparently a GPU hang that breaks most tests that come after it.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc5/vc5_context.h7
-rw-r--r--src/gallium/drivers/vc5/vc5_program.c9
2 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_context.h b/src/gallium/drivers/vc5/vc5_context.h
index 28b2e165a9d..1ab5a6b1532 100644
--- a/src/gallium/drivers/vc5/vc5_context.h
+++ b/src/gallium/drivers/vc5/vc5_context.h
@@ -132,6 +132,13 @@ struct vc5_uncompiled_shader {
struct v3d_varying_slot *tf_outputs;
uint16_t tf_specs[PIPE_MAX_SO_BUFFERS];
uint32_t num_tf_specs;
+
+ /**
+ * Flag for if the NIR in this shader originally came from TGSI. If
+ * so, we need to do some fixups at compile time, due to missing
+ * information in TGSI that exists in NIR.
+ */
+ bool was_tgsi;
};
struct vc5_compiled_shader {
diff --git a/src/gallium/drivers/vc5/vc5_program.c b/src/gallium/drivers/vc5/vc5_program.c
index ae3850a64b3..87c21abe8b1 100644
--- a/src/gallium/drivers/vc5/vc5_program.c
+++ b/src/gallium/drivers/vc5/vc5_program.c
@@ -170,6 +170,8 @@ vc5_shader_state_create(struct pipe_context *pctx,
fprintf(stderr, "\n");
}
s = tgsi_to_nir(cso->tokens, &v3d_nir_options);
+
+ so->was_tgsi = true;
}
NIR_PASS_V(s, nir_opt_global_to_local);
@@ -414,6 +416,13 @@ vc5_update_compiled_fs(struct vc5_context *vc5, uint8_t prim_mode)
desc->channel[0].size == 32) {
key->f32_color_rb |= 1 << i;
}
+
+ if (vc5->prog.bind_fs->was_tgsi) {
+ if (util_format_is_pure_uint(cbuf->format))
+ key->uint_color_rb |= 1 << i;
+ else if (util_format_is_pure_sint(cbuf->format))
+ key->int_color_rb |= 1 << i;
+ }
}
if (key->is_points) {