[PATCH 1/5] wined3d: Bump ps_1x_max_value.

Henri Verbeet hverbeet at codeweavers.com
Fri May 2 05:50:15 CDT 2014


Shader model 4 hardware should generally have real floats for everything, and
FLT_MAX matches the value from the Windows drivers for that kind of hardware.
OpenGL requires at least 2^10 for colors, and 2^32 for other floats.
---
 dlls/wined3d/glsl_shader.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index c86d400..cece6c1 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -34,6 +34,9 @@
 
 #include <limits.h>
 #include <stdio.h>
+#ifdef HAVE_FLOAT_H
+# include <float.h>
+#endif
 
 #include "wined3d_private.h"
 
@@ -6590,7 +6593,10 @@ static void shader_glsl_get_caps(const struct wined3d_gl_info *gl_info, struct s
      * the shader will generate incorrect results too. Unfortunately, GL deliberately doesn't
      * offer a way to query this.
      */
-    caps->ps_1x_max_value = 8.0;
+    if (shader_model >= 4)
+        caps->ps_1x_max_value = FLT_MAX;
+    else
+        caps->ps_1x_max_value = 1024.0f;
 
     /* Ideally we'd only set caps like sRGB writes here if supported by both
      * the shader backend and the fragment pipe, but we can get called before
-- 
1.7.10.4




More information about the wine-patches mailing list