wined3d: Don't use GLSL if the supported version isn't at least 1.20.
This commit is contained in:
parent
ae623815ee
commit
2381c9529d
|
@ -24,6 +24,7 @@
|
|||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include "wined3d_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(d3d);
|
||||
|
@ -31,7 +32,6 @@ WINE_DECLARE_DEBUG_CHANNEL(d3d_caps);
|
|||
|
||||
#define GLINFO_LOCATION (*gl_info)
|
||||
#define WINE_DEFAULT_VIDMEM (64 * 1024 * 1024)
|
||||
#define MAKEDWORD_VERSION(maj, min) ((maj & 0xffff) << 16) | (min & 0xffff)
|
||||
|
||||
/* The d3d device ID */
|
||||
static const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } };
|
||||
|
@ -2414,7 +2414,13 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_adapter *adapter)
|
|||
if (gl_info->supported[ARB_SHADING_LANGUAGE_100])
|
||||
{
|
||||
const char *str = (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION_ARB);
|
||||
unsigned int major, minor;
|
||||
|
||||
TRACE_(d3d_caps)("GLSL version string: %s.\n", debugstr_a(str));
|
||||
|
||||
/* The format of the GLSL version string is "major.minor[.release] [vendor info]". */
|
||||
sscanf(str, "%u.%u", &major, &minor);
|
||||
gl_info->glsl_version = MAKEDWORD_VERSION(major, minor);
|
||||
}
|
||||
if (gl_info->supported[NV_LIGHT_MAX_EXPONENT])
|
||||
{
|
||||
|
|
|
@ -2766,8 +2766,10 @@ UINT wined3d_log2i(UINT32 x)
|
|||
* and the user preferences in wined3d_settings. */
|
||||
void select_shader_mode(const struct wined3d_gl_info *gl_info, int *ps_selected, int *vs_selected)
|
||||
{
|
||||
BOOL glsl = wined3d_settings.glslRequested && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 20);
|
||||
|
||||
if (wined3d_settings.vs_mode == VS_NONE) *vs_selected = SHADER_NONE;
|
||||
else if (gl_info->supported[ARB_VERTEX_SHADER] && wined3d_settings.glslRequested)
|
||||
else if (gl_info->supported[ARB_VERTEX_SHADER] && glsl)
|
||||
{
|
||||
/* Geforce4 cards support GLSL but for vertex shaders only. Further its reported GLSL caps are
|
||||
* wrong. This combined with the fact that glsl won't offer more features or performance, use ARB
|
||||
|
@ -2779,7 +2781,7 @@ void select_shader_mode(const struct wined3d_gl_info *gl_info, int *ps_selected,
|
|||
else *vs_selected = SHADER_NONE;
|
||||
|
||||
if (wined3d_settings.ps_mode == PS_NONE) *ps_selected = SHADER_NONE;
|
||||
else if (gl_info->supported[ARB_FRAGMENT_SHADER] && wined3d_settings.glslRequested) *ps_selected = SHADER_GLSL;
|
||||
else if (gl_info->supported[ARB_FRAGMENT_SHADER] && glsl) *ps_selected = SHADER_GLSL;
|
||||
else if (gl_info->supported[ARB_FRAGMENT_PROGRAM]) *ps_selected = SHADER_ARB;
|
||||
else if (gl_info->supported[ATI_FRAGMENT_SHADER]) *ps_selected = SHADER_ATI;
|
||||
else *ps_selected = SHADER_NONE;
|
||||
|
|
|
@ -1418,6 +1418,7 @@ struct wined3d_gl_limits
|
|||
|
||||
struct wined3d_gl_info
|
||||
{
|
||||
DWORD glsl_version;
|
||||
UINT vidmem;
|
||||
struct wined3d_gl_limits limits;
|
||||
DWORD reserved_glsl_constants;
|
||||
|
@ -3034,4 +3035,6 @@ void stretch_rect_fbo(IWineD3DDevice *iface, IWineD3DSurface *src_surface,
|
|||
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
|
||||
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
|
||||
|
||||
#define MAKEDWORD_VERSION(maj, min) (((maj & 0xffff) << 16) | (min & 0xffff))
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue