diff options
author | Rob Clark <[email protected]> | 2014-10-03 10:02:31 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2014-10-03 14:19:52 -0400 |
commit | af4d08839581c2372f17f75f1ad0fd1284ea7d8b (patch) | |
tree | 4b0f6995e4111153dad63c126ae651a4f63b2a8b /src/gallium/drivers/freedreno/ir3/ir3_compiler.c | |
parent | cabc93c5adc9ea62be901621eff5ce4cb9574791 (diff) |
freedreno/ir3: fix lockups with lame FRAG shaders
Shaders like:
FRAG
PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1
DCL IN[0], GENERIC[0], PERSPECTIVE
DCL OUT[0], COLOR
DCL SAMP[0]
DCL TEMP[0], LOCAL
IMM[0] FLT32 { 0.0000, 1.0000, 0.0000, 0.0000}
0: TEX TEMP[0], IN[0].xyyy, SAMP[0], 2D
1: MOV OUT[0], IMM[0].xyxx
2: END
cause unhappyness. They have an IN[], but once this is compiled the
useless TEX instruction goes away. Leaving a varying that is never
fetched, which makes the hw unhappy.
In the process fix a signed vs unsigned compare. If the vertex shader
has max_reg=-1, MAX2() vs an unsigned would not give the desired result.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/ir3/ir3_compiler.c')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_compiler.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c index 66f78a80f6d..80676830dd7 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_compiler.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_compiler.c @@ -3068,7 +3068,7 @@ ir3_compile_shader(struct ir3_shader_variant *so, struct ir3_block *block; struct ir3_instruction **inputs; unsigned i, j, actual_in; - int ret = 0; + int ret = 0, max_bary; assert(!so->ir); @@ -3183,7 +3183,7 @@ ir3_compile_shader(struct ir3_shader_variant *so, } ret = ir3_block_ra(block, so->type, key.half_precision, - so->frag_coord, so->frag_face, &so->has_samp); + so->frag_coord, so->frag_face, &so->has_samp, &max_bary); if (ret) { DBG("RA failed!"); goto out; @@ -3230,6 +3230,8 @@ ir3_compile_shader(struct ir3_shader_variant *so, */ if (so->type == SHADER_VERTEX) so->total_in = actual_in; + else + so->total_in = align(max_bary + 1, 4); out: if (ret) { |