Module: wine Branch: master Commit: 56a4680b695963b9b16bed8f7252cb0b54bbb11d URL: http://source.winehq.org/git/wine.git/?a=commit;h=56a4680b695963b9b16bed8f72...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Fri Feb 3 13:42:47 2012 +0100
wined3d: Complain when the hardware may not be able to run a shader.
---
dlls/wined3d/glsl_shader.c | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 8521c7a..682e740 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -38,6 +38,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d_shader); WINE_DECLARE_DEBUG_CHANNEL(d3d_constants); WINE_DECLARE_DEBUG_CHANNEL(d3d_caps); WINE_DECLARE_DEBUG_CHANNEL(d3d); +WINE_DECLARE_DEBUG_CHANNEL(winediag);
#define WINED3D_GLSL_SAMPLE_PROJECTED 0x1 #define WINED3D_GLSL_SAMPLE_RECT 0x2 @@ -960,6 +961,17 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont max_constantsF -= count_bits(reg_maps->boolean_constants); /* Set by driver quirks in directx.c */ max_constantsF -= gl_info->reserved_glsl_constants; + + if (max_constantsF < shader->limits.constant_float) + { + static unsigned int once; + + if (!once++) + ERR_(winediag)("The hardware does not support enough uniform components to run this shader," + " it may not render correctly.\n"); + else + WARN("The hardware does not support enough uniform components to run this shader.\n"); + } } else {