diff options
author | Eric Anholt <[email protected]> | 2016-04-08 14:53:55 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-04-08 18:40:55 -0700 |
commit | 7030eadbed7cbcdb00ce41bbbc4ca93854314d71 (patch) | |
tree | 0eadc48132a04eb1cfc16cad3260b466ea5fc963 /src/gallium/drivers/vc4/vc4_program.c | |
parent | 40e77741cf1e9a74b867c7d132ca2346fe1584e4 (diff) |
vc4: Handle nir_intrinsic_load_user_clip_plane as a vec4.
I liked having all my NIR be scalar, but nir_validate() complains that the
intrinsic writes 4 components but the destination we set up was only 1
component. I could generate a new scalar variant, but it's a lot easier
to just leave it as a vec4. This doesn't hurt codegen since we GC unused
uniforms, and UCP dot products use all the components anyway.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_program.c')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_program.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_program.c b/src/gallium/drivers/vc4/vc4_program.c index 6a8fad939ca..fbefd217ce0 100644 --- a/src/gallium/drivers/vc4/vc4_program.c +++ b/src/gallium/drivers/vc4/vc4_program.c @@ -1572,8 +1572,10 @@ ntq_emit_intrinsic(struct vc4_compile *c, nir_intrinsic_instr *instr) break; case nir_intrinsic_load_user_clip_plane: - *dest = qir_uniform(c, QUNIFORM_USER_CLIP_PLANE, - instr->const_index[0]); + for (int i = 0; i < instr->num_components; i++) { + dest[i] = qir_uniform(c, QUNIFORM_USER_CLIP_PLANE, + instr->const_index[0] * 4 + i); + } break; case nir_intrinsic_load_sample_mask_in: |