diff options
author | Eric Anholt <[email protected]> | 2014-10-13 08:24:57 +0100 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-10-13 13:23:48 +0100 |
commit | 5d72a1c95662109b1338605da83329dd25e00859 (patch) | |
tree | b129986448bded3bc8f79c2f735c13aefb96b44a /src/gallium/drivers/vc4/vc4_qir.h | |
parent | d561a42bc1fb2d2bd090630d50ff4030aebd518e (diff) |
vc4: Match VS outputs to FS inputs.
If the VS doesn't output a value that the FS needs, we still need to read
the right contents for the remaining FS inputs, by emitting padding. And
if the VS outputs something the FS doesn't need, we shouldn't put it in
the VPM at all (so the code producing it can get DCEed).
Fixes 77 piglit tests.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qir.h')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_qir.h | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qir.h b/src/gallium/drivers/vc4/vc4_qir.h index 67355bb05a4..0e4b78c02b6 100644 --- a/src/gallium/drivers/vc4/vc4_qir.h +++ b/src/gallium/drivers/vc4/vc4_qir.h @@ -216,9 +216,21 @@ enum quniform_contents { QUNIFORM_ALPHA_REF, }; +struct vc4_varying_semantic { + uint8_t semantic; + uint8_t index; + uint8_t swizzle; +}; + struct vc4_compile { + struct vc4_context *vc4; struct tgsi_parse_context parser; struct qreg *temps; + /** + * Inputs to the shader, arranged by TGSI declaration order. + * + * Not all fragment shader QFILE_VARY reads are present in this array. + */ struct qreg *inputs; struct qreg *outputs; struct qreg *consts; @@ -231,6 +243,23 @@ struct vc4_compile { struct qreg line_x, point_x, point_y; struct qreg discard; + /** + * Array of the TGSI semantics of all FS QFILE_VARY reads. + * + * This includes those that aren't part of the VPM varyings, like + * point/line coordinates. + */ + struct vc4_varying_semantic *input_semantics; + uint32_t num_input_semantics; + uint32_t input_semantics_array_size; + + /** + * An entry per outputs[] in the VS indicating what the semantic of + * the output is. Used to emit from the VS in the order that the FS + * needs. + */ + struct vc4_varying_semantic *output_semantics; + struct pipe_shader_state *shader_state; struct vc4_key *key; struct vc4_fs_key *fs_key; @@ -257,7 +286,6 @@ struct vc4_compile { uint32_t qpu_inst_count; uint32_t qpu_inst_size; uint32_t num_inputs; - uint32_t color_inputs; }; struct vc4_compile *qir_compile_init(void); |