From 6fcc2c887279e6c03b2e7df0f869bd05c99faf28 Mon Sep 17 00:00:00 2001 From: Axel Davy Date: Wed, 7 Jan 2015 11:21:00 +0100 Subject: [PATCH] st/nine: Print warnings for r500 when shader is likely to go wrong 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 Signed-off-by: Axel Davy --- src/gallium/state_trackers/nine/nine_shader.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index b0dd07f820d..eeab27f934f 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -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; -- 2.30.2