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_shader.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_shader.c')
-rw-r--r-- | src/gallium/drivers/freedreno/ir3/ir3_shader.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_shader.c b/src/gallium/drivers/freedreno/ir3/ir3_shader.c index ed7c639c930..31e302b92c2 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_shader.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_shader.c @@ -91,12 +91,12 @@ fixup_vp_regfootprint(struct ir3_shader_variant *v) unsigned i; for (i = 0; i < v->inputs_count; i++) { if (v->inputs[i].compmask) { - uint32_t regid = (v->inputs[i].regid + 3) >> 2; + int32_t regid = (v->inputs[i].regid + 3) >> 2; v->info.max_reg = MAX2(v->info.max_reg, regid); } } for (i = 0; i < v->outputs_count; i++) { - uint32_t regid = (v->outputs[i].regid + 3) >> 2; + int32_t regid = (v->outputs[i].regid + 3) >> 2; v->info.max_reg = MAX2(v->info.max_reg, regid); } } |