st/nine: Print warnings for r500 when shader is likely to go wrong
authorAxel Davy <axel.davy@ens.fr>
Wed, 7 Jan 2015 10:21:00 +0000 (11:21 +0100)
committerAxel Davy <axel.davy@ens.fr>
Thu, 5 Feb 2015 23:07:18 +0000 (00:07 +0100)
r500 hasn't enough float constants for vs to fill all needs.
Overlapping issues can happen with complex shaders.
The fix would be to recompile shaders to include the integer
and boolean constants, instead of reserving slots for them.

Reviewed-by: Tiziano Bacocco <tizbac2@gmail.com>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/nine_shader.c

index b0dd07f820d8bbbca9ebf941f60d950409ecc047..eeab27f934fa407450fecf307f18cce15f6705c6 100644 (file)
@@ -3173,6 +3173,12 @@ nine_translate_shader(struct NineDevice9 *device, struct nine_shader_info *info)
         hr = D3D_OK;
     }
 
+    /* r500 */
+    if (info->const_float_slots > device->max_vs_const_f &&
+        (info->const_int_slots || info->const_bool_slots))
+        ERR("Overlapping constant slots. The shader is likely to be buggy\n");
+
+
     if (tx->indirect_const_access) /* vs only */
         info->const_float_slots = device->max_vs_const_f;