r600g: fix calculation for gpr allocation
authorDave Airlie <airlied@redhat.com>
Tue, 1 Sep 2015 02:29:58 +0000 (12:29 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Sep 2015 06:43:22 +0000 (16:43 +1000)
I've been chasing a geom shader hang on rv635 since I wrote
r600 geom code, and finally I hacked some values from fglrx
in and I could run texelfetch without failures.

This is totally my fault as well, maths fail 101.

This makes geom shaders on r600 not fail heavily.

Cc: "10.6" "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan@alterapraxis.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/r600_state.c

index 5152763..89e959b 100644 (file)
@@ -2051,7 +2051,7 @@ bool r600_adjust_gprs(struct r600_context *rctx)
                        /* always privilege vs stage so that at worst we have the
                         * pixel stage producing wrong output (not the vertex
                         * stage) */
-                       new_num_ps_gprs = max_gprs - ((new_num_vs_gprs - new_num_es_gprs - new_num_gs_gprs) + def_num_clause_temp_gprs * 2);
+                       new_num_ps_gprs = max_gprs - ((new_num_vs_gprs + new_num_es_gprs + new_num_gs_gprs) + def_num_clause_temp_gprs * 2);
                        new_num_vs_gprs = num_vs_gprs;
                        new_num_gs_gprs = num_gs_gprs;
                        new_num_es_gprs = num_es_gprs;