[PATCH 1/1] wined3d: Complain when the hardware may not be able to run a shader.
Henri Verbeet
hverbeet at codeweavers.com
Fri Feb 3 06:42:47 CST 2012
---
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
{
--
1.7.3.4
More information about the wine-patches
mailing list