ReactOS 0.4.15-dev-8135-g1bc6c90
directx.c
Go to the documentation of this file.
1/*
2 * Copyright 2002-2004 Jason Edmeades
3 * Copyright 2003-2004 Raphael Junqueira
4 * Copyright 2004 Christian Costa
5 * Copyright 2005 Oliver Stieber
6 * Copyright 2007-2008 Stefan Dösinger for CodeWeavers
7 * Copyright 2009-2011 Henri Verbeet for CodeWeavers
8 *
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#include "config.h"
25#include "wine/port.h"
26
27#include <stdio.h>
28
29#include "wined3d_private.h"
30#include "wine/winternl.h"
31
35
36#define DEFAULT_REFRESH_RATE 0
37
38/* The driver names reflect the lowest GPU supported
39 * by a certain driver, so DRIVER_AMD_R300 supports
40 * R3xx, R4xx and R5xx GPUs. */
42{
60};
61
63{
69};
70
72{
78};
79
81{
91};
92
93/* The d3d device ID */
94static const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } };
95
96/* Extension detection */
98{
99 const char *extension_string;
101};
102
104{
105 /* APPLE */
106 {"GL_APPLE_fence", APPLE_FENCE },
107 {"GL_APPLE_float_pixels", APPLE_FLOAT_PIXELS },
108 {"GL_APPLE_flush_buffer_range", APPLE_FLUSH_BUFFER_RANGE },
109 {"GL_APPLE_ycbcr_422", APPLE_YCBCR_422 },
110
111 /* ARB */
112 {"GL_ARB_base_instance", ARB_BASE_INSTANCE },
113 {"GL_ARB_blend_func_extended", ARB_BLEND_FUNC_EXTENDED },
114 {"GL_ARB_clear_buffer_object", ARB_CLEAR_BUFFER_OBJECT },
115 {"GL_ARB_clear_texture", ARB_CLEAR_TEXTURE },
116 {"GL_ARB_clip_control", ARB_CLIP_CONTROL },
117 {"GL_ARB_color_buffer_float", ARB_COLOR_BUFFER_FLOAT },
118 {"GL_ARB_compute_shader", ARB_COMPUTE_SHADER },
119 {"GL_ARB_conservative_depth", ARB_CONSERVATIVE_DEPTH },
120 {"GL_ARB_copy_buffer", ARB_COPY_BUFFER },
121 {"GL_ARB_copy_image", ARB_COPY_IMAGE },
122 {"GL_ARB_cull_distance", ARB_CULL_DISTANCE },
123 {"GL_ARB_debug_output", ARB_DEBUG_OUTPUT },
124 {"GL_ARB_depth_buffer_float", ARB_DEPTH_BUFFER_FLOAT },
125 {"GL_ARB_depth_clamp", ARB_DEPTH_CLAMP },
126 {"GL_ARB_depth_texture", ARB_DEPTH_TEXTURE },
127 {"GL_ARB_derivative_control", ARB_DERIVATIVE_CONTROL },
128 {"GL_ARB_draw_buffers", ARB_DRAW_BUFFERS },
129 {"GL_ARB_draw_elements_base_vertex", ARB_DRAW_ELEMENTS_BASE_VERTEX },
130 {"GL_ARB_draw_indirect", ARB_DRAW_INDIRECT },
131 {"GL_ARB_draw_instanced", ARB_DRAW_INSTANCED },
132 {"GL_ARB_ES2_compatibility", ARB_ES2_COMPATIBILITY },
133 {"GL_ARB_ES3_compatibility", ARB_ES3_COMPATIBILITY },
134 {"GL_ARB_explicit_attrib_location", ARB_EXPLICIT_ATTRIB_LOCATION },
135 {"GL_ARB_fragment_coord_conventions", ARB_FRAGMENT_COORD_CONVENTIONS},
136 {"GL_ARB_fragment_layer_viewport", ARB_FRAGMENT_LAYER_VIEWPORT },
137 {"GL_ARB_fragment_program", ARB_FRAGMENT_PROGRAM },
138 {"GL_ARB_fragment_shader", ARB_FRAGMENT_SHADER },
139 {"GL_ARB_framebuffer_no_attachments", ARB_FRAMEBUFFER_NO_ATTACHMENTS},
140 {"GL_ARB_framebuffer_object", ARB_FRAMEBUFFER_OBJECT },
141 {"GL_ARB_framebuffer_sRGB", ARB_FRAMEBUFFER_SRGB },
142 {"GL_ARB_geometry_shader4", ARB_GEOMETRY_SHADER4 },
143 {"GL_ARB_gpu_shader5", ARB_GPU_SHADER5 },
144 {"GL_ARB_half_float_pixel", ARB_HALF_FLOAT_PIXEL },
145 {"GL_ARB_half_float_vertex", ARB_HALF_FLOAT_VERTEX },
146 {"GL_ARB_instanced_arrays", ARB_INSTANCED_ARRAYS },
147 {"GL_ARB_internalformat_query", ARB_INTERNALFORMAT_QUERY },
148 {"GL_ARB_internalformat_query2", ARB_INTERNALFORMAT_QUERY2 },
149 {"GL_ARB_map_buffer_alignment", ARB_MAP_BUFFER_ALIGNMENT },
150 {"GL_ARB_map_buffer_range", ARB_MAP_BUFFER_RANGE },
151 {"GL_ARB_multisample", ARB_MULTISAMPLE },
152 {"GL_ARB_multitexture", ARB_MULTITEXTURE },
153 {"GL_ARB_occlusion_query", ARB_OCCLUSION_QUERY },
154 {"GL_ARB_pipeline_statistics_query", ARB_PIPELINE_STATISTICS_QUERY },
155 {"GL_ARB_pixel_buffer_object", ARB_PIXEL_BUFFER_OBJECT },
156 {"GL_ARB_point_parameters", ARB_POINT_PARAMETERS },
157 {"GL_ARB_point_sprite", ARB_POINT_SPRITE },
158 {"GL_ARB_provoking_vertex", ARB_PROVOKING_VERTEX },
159 {"GL_ARB_sampler_objects", ARB_SAMPLER_OBJECTS },
160 {"GL_ARB_seamless_cube_map", ARB_SEAMLESS_CUBE_MAP },
161 {"GL_ARB_shader_atomic_counters", ARB_SHADER_ATOMIC_COUNTERS },
162 {"GL_ARB_shader_bit_encoding", ARB_SHADER_BIT_ENCODING },
163 {"GL_ARB_shader_image_load_store", ARB_SHADER_IMAGE_LOAD_STORE },
164 {"GL_ARB_shader_image_size", ARB_SHADER_IMAGE_SIZE },
165 {"GL_ARB_shader_storage_buffer_object", ARB_SHADER_STORAGE_BUFFER_OBJECT},
166 {"GL_ARB_shader_texture_lod", ARB_SHADER_TEXTURE_LOD },
167 {"GL_ARB_shading_language_100", ARB_SHADING_LANGUAGE_100 },
168 {"GL_ARB_shading_language_420pack", ARB_SHADING_LANGUAGE_420PACK },
169 {"GL_ARB_shading_language_packing", ARB_SHADING_LANGUAGE_PACKING },
170 {"GL_ARB_shadow", ARB_SHADOW },
171 {"GL_ARB_stencil_texturing", ARB_STENCIL_TEXTURING },
172 {"GL_ARB_sync", ARB_SYNC },
173 {"GL_ARB_tessellation_shader", ARB_TESSELLATION_SHADER },
174 {"GL_ARB_texture_border_clamp", ARB_TEXTURE_BORDER_CLAMP },
175 {"GL_ARB_texture_buffer_object", ARB_TEXTURE_BUFFER_OBJECT },
176 {"GL_ARB_texture_buffer_range", ARB_TEXTURE_BUFFER_RANGE },
177 {"GL_ARB_texture_compression", ARB_TEXTURE_COMPRESSION },
178 {"GL_ARB_texture_compression_bptc", ARB_TEXTURE_COMPRESSION_BPTC },
179 {"GL_ARB_texture_compression_rgtc", ARB_TEXTURE_COMPRESSION_RGTC },
180 {"GL_ARB_texture_cube_map", ARB_TEXTURE_CUBE_MAP },
181 {"GL_ARB_texture_cube_map_array", ARB_TEXTURE_CUBE_MAP_ARRAY },
182 {"GL_ARB_texture_env_combine", ARB_TEXTURE_ENV_COMBINE },
183 {"GL_ARB_texture_env_dot3", ARB_TEXTURE_ENV_DOT3 },
184 {"GL_ARB_texture_filter_anisotropic", ARB_TEXTURE_FILTER_ANISOTROPIC},
185 {"GL_ARB_texture_float", ARB_TEXTURE_FLOAT },
186 {"GL_ARB_texture_gather", ARB_TEXTURE_GATHER },
187 {"GL_ARB_texture_mirrored_repeat", ARB_TEXTURE_MIRRORED_REPEAT },
188 {"GL_ARB_texture_mirror_clamp_to_edge", ARB_TEXTURE_MIRROR_CLAMP_TO_EDGE},
189 {"GL_ARB_texture_multisample", ARB_TEXTURE_MULTISAMPLE },
190 {"GL_ARB_texture_non_power_of_two", ARB_TEXTURE_NON_POWER_OF_TWO },
191 {"GL_ARB_texture_query_levels", ARB_TEXTURE_QUERY_LEVELS },
192 {"GL_ARB_texture_rectangle", ARB_TEXTURE_RECTANGLE },
193 {"GL_ARB_texture_rg", ARB_TEXTURE_RG },
194 {"GL_ARB_texture_rgb10_a2ui", ARB_TEXTURE_RGB10_A2UI },
195 {"GL_ARB_texture_storage", ARB_TEXTURE_STORAGE },
196 {"GL_ARB_texture_storage_multisample", ARB_TEXTURE_STORAGE_MULTISAMPLE},
197 {"GL_ARB_texture_swizzle", ARB_TEXTURE_SWIZZLE },
198 {"GL_ARB_texture_view", ARB_TEXTURE_VIEW },
199 {"GL_ARB_timer_query", ARB_TIMER_QUERY },
200 {"GL_ARB_transform_feedback2", ARB_TRANSFORM_FEEDBACK2 },
201 {"GL_ARB_transform_feedback3", ARB_TRANSFORM_FEEDBACK3 },
202 {"GL_ARB_uniform_buffer_object", ARB_UNIFORM_BUFFER_OBJECT },
203 {"GL_ARB_vertex_array_bgra", ARB_VERTEX_ARRAY_BGRA },
204 {"GL_ARB_vertex_blend", ARB_VERTEX_BLEND },
205 {"GL_ARB_vertex_buffer_object", ARB_VERTEX_BUFFER_OBJECT },
206 {"GL_ARB_vertex_program", ARB_VERTEX_PROGRAM },
207 {"GL_ARB_vertex_shader", ARB_VERTEX_SHADER },
208 {"GL_ARB_vertex_type_2_10_10_10_rev", ARB_VERTEX_TYPE_2_10_10_10_REV},
209 {"GL_ARB_viewport_array", ARB_VIEWPORT_ARRAY },
210
211 /* ATI */
212 {"GL_ATI_fragment_shader", ATI_FRAGMENT_SHADER },
213 {"GL_ATI_separate_stencil", ATI_SEPARATE_STENCIL },
214 {"GL_ATI_texture_compression_3dc", ATI_TEXTURE_COMPRESSION_3DC },
215 {"GL_ATI_texture_env_combine3", ATI_TEXTURE_ENV_COMBINE3 },
216 {"GL_ATI_texture_mirror_once", ATI_TEXTURE_MIRROR_ONCE },
217
218 /* EXT */
219 {"GL_EXT_blend_color", EXT_BLEND_COLOR },
220 {"GL_EXT_blend_equation_separate", EXT_BLEND_EQUATION_SEPARATE },
221 {"GL_EXT_blend_func_separate", EXT_BLEND_FUNC_SEPARATE },
222 {"GL_EXT_blend_minmax", EXT_BLEND_MINMAX },
223 {"GL_EXT_blend_subtract", EXT_BLEND_SUBTRACT },
224 {"GL_EXT_depth_bounds_test", EXT_DEPTH_BOUNDS_TEST },
225 {"GL_EXT_draw_buffers2", EXT_DRAW_BUFFERS2 },
226 {"GL_EXT_fog_coord", EXT_FOG_COORD },
227 {"GL_EXT_framebuffer_blit", EXT_FRAMEBUFFER_BLIT },
228 {"GL_EXT_framebuffer_multisample", EXT_FRAMEBUFFER_MULTISAMPLE },
229 {"GL_EXT_framebuffer_object", EXT_FRAMEBUFFER_OBJECT },
230 {"GL_EXT_gpu_program_parameters", EXT_GPU_PROGRAM_PARAMETERS },
231 {"GL_EXT_gpu_shader4", EXT_GPU_SHADER4 },
232 {"GL_EXT_packed_depth_stencil", EXT_PACKED_DEPTH_STENCIL },
233 {"GL_EXT_packed_float", EXT_PACKED_FLOAT },
234 {"GL_EXT_point_parameters", EXT_POINT_PARAMETERS },
235 {"GL_EXT_polygon_offset_clamp", EXT_POLYGON_OFFSET_CLAMP },
236 {"GL_EXT_provoking_vertex", EXT_PROVOKING_VERTEX },
237 {"GL_EXT_secondary_color", EXT_SECONDARY_COLOR },
238 {"GL_EXT_stencil_two_side", EXT_STENCIL_TWO_SIDE },
239 {"GL_EXT_stencil_wrap", EXT_STENCIL_WRAP },
240 {"GL_EXT_texture3D", EXT_TEXTURE3D },
241 {"GL_EXT_texture_array", EXT_TEXTURE_ARRAY },
242 {"GL_EXT_texture_compression_rgtc", EXT_TEXTURE_COMPRESSION_RGTC },
243 {"GL_EXT_texture_compression_s3tc", EXT_TEXTURE_COMPRESSION_S3TC },
244 {"GL_EXT_texture_env_combine", EXT_TEXTURE_ENV_COMBINE },
245 {"GL_EXT_texture_env_dot3", EXT_TEXTURE_ENV_DOT3 },
246 {"GL_EXT_texture_filter_anisotropic", ARB_TEXTURE_FILTER_ANISOTROPIC},
247 {"GL_EXT_texture_integer", EXT_TEXTURE_INTEGER },
248 {"GL_EXT_texture_lod_bias", EXT_TEXTURE_LOD_BIAS },
249 {"GL_EXT_texture_mirror_clamp", EXT_TEXTURE_MIRROR_CLAMP },
250 {"GL_EXT_texture_shared_exponent", EXT_TEXTURE_SHARED_EXPONENT },
251 {"GL_EXT_texture_snorm", EXT_TEXTURE_SNORM },
252 {"GL_EXT_texture_sRGB", EXT_TEXTURE_SRGB },
253 {"GL_EXT_texture_sRGB_decode", EXT_TEXTURE_SRGB_DECODE },
254 {"GL_EXT_vertex_array_bgra", EXT_VERTEX_ARRAY_BGRA },
255
256 /* NV */
257 {"GL_NV_fence", NV_FENCE },
258 {"GL_NV_fog_distance", NV_FOG_DISTANCE },
259 {"GL_NV_fragment_program", NV_FRAGMENT_PROGRAM },
260 {"GL_NV_fragment_program2", NV_FRAGMENT_PROGRAM2 },
261 {"GL_NV_fragment_program_option", NV_FRAGMENT_PROGRAM_OPTION },
262 {"GL_NV_half_float", NV_HALF_FLOAT },
263 {"GL_NV_light_max_exponent", NV_LIGHT_MAX_EXPONENT },
264 {"GL_NV_point_sprite", NV_POINT_SPRITE },
265 {"GL_NV_register_combiners", NV_REGISTER_COMBINERS },
266 {"GL_NV_register_combiners2", NV_REGISTER_COMBINERS2 },
267 {"GL_NV_texgen_reflection", NV_TEXGEN_REFLECTION },
268 {"GL_NV_texture_env_combine4", NV_TEXTURE_ENV_COMBINE4 },
269 {"GL_NV_texture_shader", NV_TEXTURE_SHADER },
270 {"GL_NV_texture_shader2", NV_TEXTURE_SHADER2 },
271 {"GL_NV_vertex_program", NV_VERTEX_PROGRAM },
272 {"GL_NV_vertex_program1_1", NV_VERTEX_PROGRAM1_1 },
273 {"GL_NV_vertex_program2", NV_VERTEX_PROGRAM2 },
274 {"GL_NV_vertex_program2_option", NV_VERTEX_PROGRAM2_OPTION },
275 {"GL_NV_vertex_program3", NV_VERTEX_PROGRAM3 },
276 {"GL_NVX_gpu_memory_info", NVX_GPU_MEMORY_INFO },
277};
278
280{
281 {"WGL_ARB_pixel_format", WGL_ARB_PIXEL_FORMAT },
282 {"WGL_EXT_swap_control", WGL_EXT_SWAP_CONTROL },
283 {"WGL_WINE_pixel_format_passthrough", WGL_WINE_PIXEL_FORMAT_PASSTHROUGH},
284 {"WGL_WINE_query_renderer", WGL_WINE_QUERY_RENDERER },
285};
286
287/**********************************************************
288 * Utility functions follow
289 **********************************************************/
290
291const struct min_lookup minMipLookup[] =
292{
293 /* NONE POINT LINEAR */
294 {{GL_NEAREST, GL_NEAREST, GL_NEAREST}}, /* NONE */
297};
298
300{
301 /* NONE POINT LINEAR */
303};
304
306{
307 const struct wined3d_gl_info *gl_info = ctx->gl_info;
308
309 TRACE("Destroying caps GL context.\n");
310
311 /* Both glDeleteProgram and glDeleteBuffers silently ignore 0 IDs but
312 * this function might be called before the relevant function pointers
313 * in gl_info are initialized. */
314 if (ctx->test_program_id || ctx->test_vbo)
315 {
316 GL_EXTCALL(glDeleteProgram(ctx->test_program_id));
317 GL_EXTCALL(glDeleteBuffers(1, &ctx->test_vbo));
318 }
319
320 if (!wglMakeCurrent(NULL, NULL))
321 ERR("Failed to disable caps GL context.\n");
322
323 if (!wglDeleteContext(ctx->gl_ctx))
324 {
326 ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx->gl_ctx, err);
327 }
328
329 wined3d_release_dc(ctx->wnd, ctx->dc);
330 DestroyWindow(ctx->wnd);
331
332 if (ctx->restore_gl_ctx && !wglMakeCurrent(ctx->restore_dc, ctx->restore_gl_ctx))
333 ERR("Failed to restore previous GL context.\n");
334}
335
337 struct wined3d_gl_info *gl_info)
338{
339 HGLRC new_ctx;
340
341 if (!(gl_info->p_wglCreateContextAttribsARB = (void *)wglGetProcAddress("wglCreateContextAttribsARB")))
342 return TRUE;
343
344 if (!(new_ctx = context_create_wgl_attribs(gl_info, caps_gl_ctx->dc, NULL)))
345 {
346 gl_info->p_wglCreateContextAttribsARB = NULL;
347 return FALSE;
348 }
349
350 if (!wglMakeCurrent(caps_gl_ctx->dc, new_ctx))
351 {
352 ERR("Failed to make new context current, last error %#x.\n", GetLastError());
353 if (!wglDeleteContext(new_ctx))
354 ERR("Failed to delete new context, last error %#x.\n", GetLastError());
355 gl_info->p_wglCreateContextAttribsARB = NULL;
356 return TRUE;
357 }
358
359 if (!wglDeleteContext(caps_gl_ctx->gl_ctx))
360 ERR("Failed to delete old context, last error %#x.\n", GetLastError());
361 caps_gl_ctx->gl_ctx = new_ctx;
362
363 return TRUE;
364}
365
367{
369 int iPixelFormat;
370
371 TRACE("getting context...\n");
372
373 ctx->restore_dc = wglGetCurrentDC();
374 ctx->restore_gl_ctx = wglGetCurrentContext();
375
376 /* We need a fake window as a hdc retrieved using GetDC(0) can't be used for much GL purposes. */
377 ctx->wnd = CreateWindowA(WINED3D_OPENGL_WINDOW_CLASS_NAME, "WineD3D fake window",
378 WS_OVERLAPPEDWINDOW, 10, 10, 10, 10, NULL, NULL, NULL, NULL);
379 if (!ctx->wnd)
380 {
381 ERR("Failed to create a window.\n");
382 goto fail;
383 }
384
385 ctx->dc = GetDC(ctx->wnd);
386 if (!ctx->dc)
387 {
388 ERR("Failed to get a DC.\n");
389 goto fail;
390 }
391
392 /* PixelFormat selection */
393 ZeroMemory(&pfd, sizeof(pfd));
394 pfd.nSize = sizeof(pfd);
395 pfd.nVersion = 1;
396 pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW; /* PFD_GENERIC_ACCELERATED */
398 pfd.cColorBits = 32;
400
401 if (!(iPixelFormat = ChoosePixelFormat(ctx->dc, &pfd)))
402 {
403 /* If this happens something is very wrong as ChoosePixelFormat barely fails. */
404 ERR("Failed to find a suitable pixel format.\n");
405 goto fail;
406 }
407 DescribePixelFormat(ctx->dc, iPixelFormat, sizeof(pfd), &pfd);
409
410 /* Create a GL context. */
411 if (!(ctx->gl_ctx = wglCreateContext(ctx->dc)))
412 {
413 WARN("Failed to create default context for capabilities initialization.\n");
414 goto fail;
415 }
416
417 /* Make it the current GL context. */
418 if (!wglMakeCurrent(ctx->dc, ctx->gl_ctx))
419 {
420 ERR("Failed to make caps GL context current.\n");
421 goto fail;
422 }
423
424 ctx->gl_info = &adapter->gl_info;
425 return TRUE;
426
427fail:
428 if (ctx->gl_ctx) wglDeleteContext(ctx->gl_ctx);
429 ctx->gl_ctx = NULL;
430 if (ctx->dc) ReleaseDC(ctx->wnd, ctx->dc);
431 ctx->dc = NULL;
432 if (ctx->wnd) DestroyWindow(ctx->wnd);
433 ctx->wnd = NULL;
434 if (ctx->restore_gl_ctx && !wglMakeCurrent(ctx->restore_dc, ctx->restore_gl_ctx))
435 ERR("Failed to restore previous GL context.\n");
436
437 return FALSE;
438}
439
440/* Adjust the amount of used texture memory */
442{
443 adapter->vram_bytes_used += amount;
444 TRACE("Adjusted used adapter memory by 0x%s to 0x%s.\n",
445 wine_dbgstr_longlong(amount),
446 wine_dbgstr_longlong(adapter->vram_bytes_used));
447 return adapter->vram_bytes_used;
448}
449
451{
452 heap_free(adapter->gl_info.formats);
453 heap_free(adapter->cfgs);
454}
455
457{
459
460 TRACE("%p increasing refcount to %u.\n", wined3d, refcount);
461
462 return refcount;
463}
464
466{
468
469 TRACE("%p decreasing refcount to %u.\n", wined3d, refcount);
470
471 if (!refcount)
472 {
473 unsigned int i;
474
475 for (i = 0; i < wined3d->adapter_count; ++i)
476 {
478 }
480 }
481
482 return refcount;
483}
484
485/* Context activation is done by the caller. */
486static BOOL test_arb_vs_offset_limit(const struct wined3d_gl_info *gl_info)
487{
488 GLuint prog;
489 BOOL ret = FALSE;
490 static const char testcode[] =
491 "!!ARBvp1.0\n"
492 "PARAM C[66] = { program.env[0..65] };\n"
493 "ADDRESS A0;"
494 "PARAM zero = {0.0, 0.0, 0.0, 0.0};\n"
495 "ARL A0.x, zero.x;\n"
496 "MOV result.position, C[A0.x + 65];\n"
497 "END\n";
498
499 while (gl_info->gl_ops.gl.p_glGetError());
500 GL_EXTCALL(glGenProgramsARB(1, &prog));
501 if(!prog) {
502 ERR("Failed to create an ARB offset limit test program\n");
503 }
504 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog));
506 strlen(testcode), testcode));
507 if (gl_info->gl_ops.gl.p_glGetError())
508 {
509 TRACE("OpenGL implementation does not allow indirect addressing offsets > 63\n");
510 TRACE("error: %s\n", debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
511 ret = TRUE;
512 } else TRACE("OpenGL implementation allows offsets > 63\n");
513
514 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0));
515 GL_EXTCALL(glDeleteProgramsARB(1, &prog));
516 checkGLcall("ARB vp offset limit test cleanup");
517
518 return ret;
519}
520
522 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
524{
525 if (card_vendor != HW_VENDOR_AMD) return FALSE;
526 if (device == CARD_AMD_RADEON_9500) return TRUE;
527 if (device == CARD_AMD_RADEON_X700) return TRUE;
528 if (device == CARD_AMD_RADEON_X1600) return TRUE;
529 return FALSE;
530}
531
532static BOOL match_geforce5(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
533 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
535{
537 {
541 {
542 return TRUE;
543 }
544 }
545 return FALSE;
546}
547
548static BOOL match_apple(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
549 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
551{
552 /* MacOS has various specialities in the extensions it advertises. Some have to be loaded from
553 * the opengl 1.2+ core, while other extensions are advertised, but software emulated. So try to
554 * detect the Apple OpenGL implementation to apply some extension fixups afterwards.
555 *
556 * Detecting this isn't really easy. The vendor string doesn't mention Apple. Compile-time checks
557 * aren't sufficient either because a Linux binary may display on a macos X server via remote X11.
558 * So try to detect the GL implementation by looking at certain Apple extensions. Some extensions
559 * like client storage might be supported on other implementations too, but GL_APPLE_flush_render
560 * is specific to the Mac OS X window management, and GL_APPLE_ycbcr_422 is QuickTime specific. So
561 * the chance that other implementations support them is rather small since Win32 QuickTime uses
562 * DirectDraw, not OpenGL.
563 *
564 * This test has been moved into wined3d_guess_gl_vendor()
565 */
566 return gl_vendor == GL_VENDOR_APPLE;
567}
568
569/* Context activation is done by the caller. */
570static void test_pbo_functionality(struct wined3d_gl_info *gl_info)
571{
572 /* Some OpenGL implementations, namely Apple's Geforce 8 driver, advertises PBOs,
573 * but glTexSubImage from a PBO fails miserably, with the first line repeated over
574 * all the texture. This function detects this bug by its symptom and disables PBOs
575 * if the test fails.
576 *
577 * The test uploads a 4x4 texture via the PBO in the "native" format GL_BGRA,
578 * GL_UNSIGNED_INT_8_8_8_8_REV. This format triggers the bug, and it is what we use
579 * for D3DFMT_A8R8G8B8. Then the texture is read back without any PBO and the data
580 * read back is compared to the original. If they are equal PBOs are assumed to work,
581 * otherwise the PBO extension is disabled. */
583 static const unsigned int pattern[] =
584 {
585 0x00000000, 0x000000ff, 0x0000ff00, 0x40ff0000,
586 0x80ffffff, 0x40ffff00, 0x00ff00ff, 0x0000ffff,
587 0x00ffff00, 0x00ff00ff, 0x0000ffff, 0x000000ff,
588 0x80ff00ff, 0x0000ffff, 0x00ff00ff, 0x40ff00ff
589 };
590 unsigned int check[ARRAY_SIZE(pattern)];
591
592 /* No PBO -> No point in testing them. */
593 if (!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]) return;
594
595 while (gl_info->gl_ops.gl.p_glGetError());
596 gl_info->gl_ops.gl.p_glGenTextures(1, &texture);
597 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, texture);
598
599 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
600 gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0);
601 checkGLcall("Specifying the PBO test texture");
602
603 GL_EXTCALL(glGenBuffers(1, &pbo));
604 GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo));
606 checkGLcall("Specifying the PBO test pbo");
607
608 gl_info->gl_ops.gl.p_glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
609 checkGLcall("Loading the PBO test texture");
610
611 GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
612
613 gl_info->gl_ops.gl.p_glFinish(); /* just to be sure */
614
615 memset(check, 0, sizeof(check));
616 gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, check);
617 checkGLcall("Reading back the PBO test texture");
618
619 gl_info->gl_ops.gl.p_glDeleteTextures(1, &texture);
620 GL_EXTCALL(glDeleteBuffers(1, &pbo));
621 checkGLcall("PBO test cleanup");
622
623 if (memcmp(check, pattern, sizeof(check)))
624 {
625 WARN_(d3d_perf)("PBO test failed, read back data doesn't match original.\n"
626 "Disabling PBOs. This may result in slower performance.\n");
628 }
629 else
630 {
631 TRACE("PBO test successful.\n");
632 }
633}
634
635static BOOL match_apple_intel(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
636 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
638{
639 return (card_vendor == HW_VENDOR_INTEL) && (gl_vendor == GL_VENDOR_APPLE);
640}
641
643 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
645{
646 if (gl_vendor != GL_VENDOR_APPLE) return FALSE;
647 if (card_vendor != HW_VENDOR_AMD) return FALSE;
648 if (device == CARD_AMD_RADEON_X1600) return FALSE;
649 return TRUE;
650}
651
652static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
653 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
655{
656 /* DX9 cards support 40 single float varyings in hardware, most drivers report 32. ATI misreports
657 * 44 varyings. So assume that if we have more than 44 varyings we have a dx10 card.
658 * This detection is for the gl_ClipPos varying quirk. If a d3d9 card really supports more than 44
659 * varyings and we subtract one in dx9 shaders it's not going to hurt us because the dx9 limit is
660 * hardcoded
661 *
662 * dx10 cards usually have 64 varyings */
663 return gl_info->limits.glsl_varyings > 44;
664}
665
667 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
669{
670 return !match_dx10_capable(gl_info, ctx, gl_renderer, gl_vendor, card_vendor, device);
671}
672
673/* A GL context is provided by the caller */
675 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
677{
679 DWORD data[16];
680
681 if (!gl_info->supported[EXT_SECONDARY_COLOR])
682 return FALSE;
683
684 while (gl_info->gl_ops.gl.p_glGetError());
685 GL_EXTCALL(glSecondaryColorPointerEXT)(4, GL_UNSIGNED_BYTE, 4, data);
686 error = gl_info->gl_ops.gl.p_glGetError();
687
688 if (error == GL_NO_ERROR)
689 {
690 TRACE("GL Implementation accepts 4 component specular color pointers\n");
691 return TRUE;
692 }
693 else
694 {
695 TRACE("GL implementation does not accept 4 component specular colors, error %s\n",
697 return FALSE;
698 }
699}
700
701/* A GL context is provided by the caller */
703 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
705{
706 GLuint prog;
707 BOOL ret = FALSE;
708 GLint pos;
709 static const char testcode[] =
710 "!!ARBvp1.0\n"
711 "OPTION NV_vertex_program2;\n"
712 "MOV result.clip[0], 0.0;\n"
713 "MOV result.position, 0.0;\n"
714 "END\n";
715
716 if (!gl_info->supported[NV_VERTEX_PROGRAM2_OPTION]) return FALSE;
717
718 while (gl_info->gl_ops.gl.p_glGetError());
719
720 GL_EXTCALL(glGenProgramsARB(1, &prog));
721 if(!prog)
722 {
723 ERR("Failed to create the NVvp clip test program\n");
724 return FALSE;
725 }
726 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog));
728 strlen(testcode), testcode));
729 gl_info->gl_ops.gl.p_glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
730 if(pos != -1)
731 {
732 WARN("GL_NV_vertex_program2_option result.clip[] test failed\n");
733 TRACE("error: %s\n", debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
734 ret = TRUE;
735 while (gl_info->gl_ops.gl.p_glGetError());
736 }
737 else TRACE("GL_NV_vertex_program2_option result.clip[] test passed\n");
738
739 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0));
740 GL_EXTCALL(glDeleteProgramsARB(1, &prog));
741 checkGLcall("GL_NV_vertex_program2_option result.clip[] test cleanup");
742
743 return ret;
744}
745
746/* Context activation is done by the caller. */
748 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
750{
751 char data[4 * 4 * 4];
752 GLuint tex, fbo;
754
756
757 memset(data, 0xcc, sizeof(data));
758
759 gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
760 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
761 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
762 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
763 gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
764 checkGLcall("glTexImage2D");
765
766 gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
767 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
768 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
769 checkGLcall("glFramebufferTexture2D");
770
771 status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
772 if (status != GL_FRAMEBUFFER_COMPLETE) ERR("FBO status %#x\n", status);
773 checkGLcall("glCheckFramebufferStatus");
774
775 memset(data, 0x11, sizeof(data));
776 gl_info->gl_ops.gl.p_glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
777 checkGLcall("glTexSubImage2D");
778
779 gl_info->gl_ops.gl.p_glClearColor(0.996f, 0.729f, 0.745f, 0.792f);
780 gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT);
781 checkGLcall("glClear");
782
783 gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
784 checkGLcall("glGetTexImage");
785
786 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
787 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
788 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
789 checkGLcall("glBindTexture");
790
791 gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
792 gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
793 checkGLcall("glDeleteTextures");
794
795 return *(DWORD *)data == 0x11111111;
796}
797
798/* Context activation is done by the caller. */
799static BOOL match_broken_rgba16(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
800 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
802{
803 /* GL_RGBA16 uses GL_RGBA8 internally on Geforce 7 and older cards.
804 * This leads to graphical bugs in Half Life 2 and Unreal engine games. */
805 GLuint tex;
806 GLint size;
807
808 gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
809 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
810 gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, 4, 4, 0, GL_RGBA, GL_UNSIGNED_SHORT, NULL);
811 checkGLcall("glTexImage2D");
812
813 gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &size);
814 checkGLcall("glGetTexLevelParameteriv");
815 TRACE("Real color depth is %d\n", size);
816
817 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
818 checkGLcall("glBindTexture");
819 gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
820 checkGLcall("glDeleteTextures");
821
822 return size < 16;
823}
824
825static BOOL match_fglrx(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
826 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
828{
829 return gl_vendor == GL_VENDOR_FGLRX;
830}
831
832static BOOL match_r200(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
833 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
835{
836 if (card_vendor != HW_VENDOR_AMD) return FALSE;
837 if (device == CARD_AMD_RADEON_8500) return TRUE;
838 return FALSE;
839}
840
842 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
844{
845 DWORD data[4];
846 GLuint tex, fbo;
848 float color[4] = {0.0f, 1.0f, 0.0f, 0.0f};
849 GLuint prog;
850 GLint err_pos;
851 static const char program_code[] =
852 "!!ARBfp1.0\n"
853 "OPTION ARB_fog_linear;\n"
854 "MOV result.color, {1.0, 0.0, 0.0, 0.0};\n"
855 "END\n";
856
858 return FALSE;
859 if (!gl_info->supported[ARB_FRAGMENT_PROGRAM])
860 return FALSE;
861
862 gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
863 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
864 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
865 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
866 gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 4, 1, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
867 checkGLcall("glTexImage2D");
868
869 gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
870 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
871 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
872 checkGLcall("glFramebufferTexture2D");
873
874 status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
875 if (status != GL_FRAMEBUFFER_COMPLETE) ERR("FBO status %#x\n", status);
876 checkGLcall("glCheckFramebufferStatus");
877
878 gl_info->gl_ops.gl.p_glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
879 gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT);
880 checkGLcall("glClear");
881 gl_info->gl_ops.gl.p_glViewport(0, 0, 4, 1);
882 checkGLcall("glViewport");
883
884 gl_info->gl_ops.gl.p_glEnable(GL_FOG);
885 gl_info->gl_ops.gl.p_glFogf(GL_FOG_START, 0.5f);
886 gl_info->gl_ops.gl.p_glFogf(GL_FOG_END, 0.5f);
887 gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
888 gl_info->gl_ops.gl.p_glHint(GL_FOG_HINT, GL_NICEST);
889 gl_info->gl_ops.gl.p_glFogfv(GL_FOG_COLOR, color);
890 checkGLcall("fog setup");
891
892 GL_EXTCALL(glGenProgramsARB(1, &prog));
893 GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prog));
895 strlen(program_code), program_code));
896 gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB);
897 checkGLcall("Test fragment program setup");
898
899 gl_info->gl_ops.gl.p_glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &err_pos);
900 if (err_pos != -1)
901 {
902 const char *error_str;
903 error_str = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB);
904 FIXME("Fog test program error at position %d: %s\n\n", err_pos, debugstr_a(error_str));
905 }
906
907 gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP);
908 gl_info->gl_ops.gl.p_glVertex3f(-1.0f, -1.0f, 0.0f);
909 gl_info->gl_ops.gl.p_glVertex3f( 1.0f, -1.0f, 1.0f);
910 gl_info->gl_ops.gl.p_glVertex3f(-1.0f, 1.0f, 0.0f);
911 gl_info->gl_ops.gl.p_glVertex3f( 1.0f, 1.0f, 1.0f);
912 gl_info->gl_ops.gl.p_glEnd();
913 checkGLcall("ARBfp fog test draw");
914
915 gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
916 checkGLcall("glGetTexImage");
917 data[0] &= 0x00ffffff;
918 data[1] &= 0x00ffffff;
919 data[2] &= 0x00ffffff;
920 data[3] &= 0x00ffffff;
921
922 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
923 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
924
925 gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
926 gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
927 gl_info->gl_ops.gl.p_glDisable(GL_FOG);
928 GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0));
929 gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_PROGRAM_ARB);
930 GL_EXTCALL(glDeleteProgramsARB(1, &prog));
931 checkGLcall("ARBfp fog test teardown");
932
933 TRACE("Fog test data: %08x %08x %08x %08x\n", data[0], data[1], data[2], data[3]);
934 return data[0] != 0x00ff0000 || data[3] != 0x0000ff00;
935}
936
938 struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
940{
941 if (!gl_info->supported[ARB_VIEWPORT_ARRAY])
942 return FALSE;
944 return FALSE;
946}
947
948static void quirk_apple_glsl_constants(struct wined3d_gl_info *gl_info)
949{
950 /* MacOS needs uniforms for relative addressing offsets. This can accumulate to quite a few uniforms.
951 * Beyond that the general uniform isn't optimal, so reserve a number of uniforms. 12 vec4's should
952 * allow 48 different offsets or other helper immediate values. */
953 TRACE("Reserving 12 GLSL constants for compiler private use.\n");
954 gl_info->reserved_glsl_constants = max(gl_info->reserved_glsl_constants, 12);
955}
956
957static void quirk_amd_dx9(struct wined3d_gl_info *gl_info)
958{
959 /* MacOS advertises GL_ARB_texture_non_power_of_two on ATI r500 and earlier cards, although
960 * these cards only support GL_ARB_texture_rectangle(D3DPTEXTURECAPS_NONPOW2CONDITIONAL).
961 * If real NP2 textures are used, the driver falls back to software. We could just remove the
962 * extension and use GL_ARB_texture_rectangle instead, but texture_rectangle is inconvenient
963 * due to the non-normalized texture coordinates. Thus set an internal extension flag,
964 * GL_WINE_normalized_texrect, which signals the code that it can use non power of two textures
965 * as per GL_ARB_texture_non_power_of_two, but has to stick to the texture_rectangle limits.
966 *
967 * fglrx doesn't advertise GL_ARB_texture_non_power_of_two, but it advertises opengl 2.0 which
968 * has this extension promoted to core. The extension loading code sets this extension supported
969 * due to that, so this code works on fglrx as well. */
971 {
972 TRACE("GL_ARB_texture_non_power_of_two advertised on R500 or earlier card, removing.\n");
975 }
976}
977
978static void quirk_no_np2(struct wined3d_gl_info *gl_info)
979{
980 /* The nVidia GeForceFX series reports OpenGL 2.0 capabilities with the latest drivers versions, but
981 * doesn't explicitly advertise the ARB_tex_npot extension in the GL extension string.
982 * This usually means that ARB_tex_npot is supported in hardware as long as the application is staying
983 * within the limits enforced by the ARB_texture_rectangle extension. This however is not true for the
984 * FX series, which instantly falls back to a slower software path as soon as ARB_tex_npot is used.
985 * We therefore completely remove ARB_tex_npot from the list of supported extensions.
986 *
987 * Note that wine_normalized_texrect can't be used in this case because internally it uses ARB_tex_npot,
988 * triggering the software fallback. There is not much we can do here apart from disabling the
989 * software-emulated extension and re-enable ARB_tex_rect (which was previously disabled
990 * in wined3d_adapter_init_gl_caps).
991 * This fixup removes performance problems on both the FX 5900 and FX 5700 (e.g. for framebuffer
992 * post-processing effects in the game "Max Payne 2").
993 * The behaviour can be verified through a simple test app attached in bugreport #14724. */
994 TRACE("GL_ARB_texture_non_power_of_two advertised through OpenGL 2.0 on NV FX card, removing.\n");
997}
998
999static void quirk_texcoord_w(struct wined3d_gl_info *gl_info)
1000{
1001 /* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems
1002 * with fixed function fragment processing. Ideally this flag should be detected with a test shader
1003 * and OpenGL feedback mode, but some GL implementations (MacOS ATI at least, probably all MacOS ones)
1004 * do not like vertex shaders in feedback mode and return an error, even though it should be valid
1005 * according to the spec.
1006 *
1007 * We don't want to enable this on all cards, as it adds an extra instruction per texcoord used. This
1008 * makes the shader slower and eats instruction slots which should be available to the d3d app.
1009 *
1010 * ATI Radeon HD 2xxx cards on MacOS have the issue. Instead of checking for the buggy cards, blacklist
1011 * all radeon cards on Macs and whitelist the good ones. That way we're prepared for the future. If
1012 * this workaround is activated on cards that do not need it, it won't break things, just affect
1013 * performance negatively. */
1014 TRACE("Enabling vertex texture coord fixes in vertex shaders.\n");
1016}
1017
1018static void quirk_clip_varying(struct wined3d_gl_info *gl_info)
1019{
1021}
1022
1024{
1026}
1027
1028static void quirk_disable_nvvp_clip(struct wined3d_gl_info *gl_info)
1029{
1031}
1032
1033static void quirk_fbo_tex_update(struct wined3d_gl_info *gl_info)
1034{
1036}
1037
1038static void quirk_broken_rgba16(struct wined3d_gl_info *gl_info)
1039{
1041}
1042
1043static void quirk_infolog_spam(struct wined3d_gl_info *gl_info)
1044{
1046}
1047
1049{
1050 /* Nvidia GeForce 6xxx and 7xxx support accelerated VTF only on a few
1051 selected texture formats. They are apparently the only DX9 class GPUs
1052 supporting VTF.
1053 Also, DX9-era GPUs are somewhat limited with float textures
1054 filtering and blending. */
1056}
1057
1058static void quirk_r200_constants(struct wined3d_gl_info *gl_info)
1059{
1060 /* The Mesa r200 driver (and there is no other driver for this GPU Wine would run on)
1061 * loads some fog parameters (start, end, exponent, but not the color) into the
1062 * program.
1063 *
1064 * Apparently the fog hardware is only able to handle linear fog with a range of 0.0;1.0,
1065 * and it is the responsibility of the vertex pipeline to handle non-linear fog and
1066 * linear fog with start and end other than 0.0 and 1.0. */
1067 TRACE("Reserving 1 ARB constant for compiler private use.\n");
1068 gl_info->reserved_arb_constants = max(gl_info->reserved_arb_constants, 1);
1069}
1070
1071static void quirk_broken_arb_fog(struct wined3d_gl_info *gl_info)
1072{
1074}
1075
1077{
1078 if (gl_info->supported[ARB_CLIP_CONTROL])
1079 {
1080 TRACE("Disabling ARB_clip_control.\n");
1081 gl_info->supported[ARB_CLIP_CONTROL] = FALSE;
1082 }
1083}
1084
1086{
1087 BOOL (*match)(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
1088 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
1090 void (*apply)(struct wined3d_gl_info *gl_info);
1091 const char *description;
1092};
1093
1094static const struct driver_quirk quirk_table[] =
1095{
1096 {
1099 "AMD normalized texrect quirk"
1100 },
1101 {
1104 "Apple GLSL uniform override"
1105 },
1106 {
1109 "Geforce 5 NP2 disable"
1110 },
1111 {
1114 "Init texcoord .w for Apple Intel GPU driver"
1115 },
1116 {
1119 "Init texcoord .w for Apple ATI >= r600 GPU driver"
1120 },
1121 {
1124 "Reserved varying for gl_ClipPos"
1125 },
1126 {
1127 /* GL_EXT_secondary_color does not allow 4 component secondary colors, but most
1128 * GL implementations accept it. The Mac GL is the only implementation known to
1129 * reject it.
1130 *
1131 * If we can pass 4 component specular colors, do it, because (a) we don't have
1132 * to screw around with the data, and (b) the D3D fixed function vertex pipeline
1133 * passes specular alpha to the pixel shader if any is used. Otherwise the
1134 * specular alpha is used to pass the fog coordinate, which we pass to opengl
1135 * via GL_EXT_fog_coord.
1136 */
1139 "Allow specular alpha quirk"
1140 },
1141 {
1144 "Apple NV_vertex_program clip bug quirk"
1145 },
1146 {
1149 "FBO rebind for attachment updates"
1150 },
1151 {
1154 "True RGBA16 is not available"
1155 },
1156 {
1159 "Not printing GLSL infolog"
1160 },
1161 {
1164 "Texture filtering, blending and VTF support is limited"
1165 },
1166 {
1167 match_r200,
1169 "r200 vertex shader constants"
1170 },
1171 {
1174 "ARBfp fogstart == fogend workaround"
1175 },
1176 {
1179 "Nvidia viewport subpixel bits bug"
1180 },
1181};
1182
1183/* Certain applications (Steam) complain if we report an outdated driver version. In general,
1184 * reporting a driver version is moot because we are not the Windows driver, and we have different
1185 * bugs, features, etc.
1186 *
1187 * The driver version has the form "x.y.z.w".
1188 *
1189 * "x" is the Windows version the driver is meant for:
1190 * 4 -> 95/98/NT4
1191 * 5 -> 2000
1192 * 6 -> 2000/XP
1193 * 7 -> Vista
1194 * 8 -> Win 7
1195 *
1196 * "y" is the maximum Direct3D version the driver supports.
1197 * y -> d3d version mapping:
1198 * 11 -> d3d6
1199 * 12 -> d3d7
1200 * 13 -> d3d8
1201 * 14 -> d3d9
1202 * 15 -> d3d10
1203 * 16 -> d3d10.1
1204 * 17 -> d3d11
1205 *
1206 * "z" is the subversion number.
1207 *
1208 * "w" is the vendor specific driver build number.
1209 */
1210
1212{
1215 const char *driver_name; /* name of Windows driver */
1216 WORD version; /* version word ('y'), contained in low word of DriverVersion.HighPart */
1217 WORD subversion; /* subversion word ('z'), contained in high word of DriverVersion.LowPart */
1218 WORD build; /* build number ('w'), contained in low word of DriverVersion.LowPart */
1219};
1220
1221/* The driver version table contains driver information for different devices on several OS versions. */
1223{
1224 /* AMD
1225 * - Radeon HD2x00 (R600) and up supported by current drivers.
1226 * - Radeon 9500 (R300) - X1*00 (R5xx) supported up to Catalyst 9.3 (Linux) and 10.2 (XP/Vista/Win7)
1227 * - Radeon 7xxx (R100) - 9250 (RV250) supported up to Catalyst 6.11 (XP)
1228 * - Rage 128 supported up to XP, latest official build 6.13.3279 dated October 2001 */
1229 {DRIVER_AMD_RAGE_128PRO, DRIVER_MODEL_NT5X, "ati2dvaa.dll", 13, 3279, 0},
1230 {DRIVER_AMD_R100, DRIVER_MODEL_NT5X, "ati2dvag.dll", 14, 10, 6614},
1231 {DRIVER_AMD_R300, DRIVER_MODEL_NT5X, "ati2dvag.dll", 14, 10, 6764},
1232 {DRIVER_AMD_R600, DRIVER_MODEL_NT5X, "ati2dvag.dll", 17, 10, 1280},
1233 {DRIVER_AMD_R300, DRIVER_MODEL_NT6X, "atiumdag.dll", 14, 10, 741 },
1234 {DRIVER_AMD_R600, DRIVER_MODEL_NT6X, "atiumdag.dll", 17, 10, 1280},
1235 {DRIVER_AMD_RX, DRIVER_MODEL_NT6X, "aticfx32.dll", 17, 10, 1474},
1236
1237 /* Intel
1238 * The drivers are unified but not all versions support all GPUs. At some point the 2k/xp
1239 * drivers used ialmrnt5.dll for GMA800/GMA900 but at some point the file was renamed to
1240 * igxprd32.dll but the GMA800 driver was never updated. */
1241 {DRIVER_INTEL_GMA800, DRIVER_MODEL_NT5X, "ialmrnt5.dll", 14, 10, 3889},
1242 {DRIVER_INTEL_GMA900, DRIVER_MODEL_NT5X, "igxprd32.dll", 14, 10, 4764},
1243 {DRIVER_INTEL_GMA950, DRIVER_MODEL_NT5X, "igxprd32.dll", 14, 10, 4926},
1244 {DRIVER_INTEL_GMA3000, DRIVER_MODEL_NT5X, "igxprd32.dll", 14, 10, 5218},
1245 {DRIVER_INTEL_GMA950, DRIVER_MODEL_NT6X, "igdumd32.dll", 14, 10, 1504},
1246 {DRIVER_INTEL_GMA3000, DRIVER_MODEL_NT6X, "igdumd32.dll", 15, 10, 1666},
1247 {DRIVER_INTEL_HD4000, DRIVER_MODEL_NT6X, "igdumdim32.dll", 19, 15, 4352},
1248
1249 /* Nvidia
1250 * - Geforce8 and newer is supported by the current 340.52 driver on XP-Win8
1251 * - Geforce6 and 7 support is up to 307.83 on XP-Win8
1252 * - GeforceFX support is up to 173.x on <= XP
1253 * - Geforce2MX/3/4 up to 96.x on <= XP
1254 * - TNT/Geforce1/2 up to 71.x on <= XP
1255 * All version numbers used below are from the Linux nvidia drivers. */
1256 {DRIVER_NVIDIA_TNT, DRIVER_MODEL_NT5X, "nv4_disp.dll", 14, 10, 7186},
1257 {DRIVER_NVIDIA_GEFORCE2MX, DRIVER_MODEL_NT5X, "nv4_disp.dll", 14, 10, 9371},
1258 {DRIVER_NVIDIA_GEFORCEFX, DRIVER_MODEL_NT5X, "nv4_disp.dll", 14, 11, 7516},
1259 {DRIVER_NVIDIA_GEFORCE6, DRIVER_MODEL_NT5X, "nv4_disp.dll", 18, 13, 783},
1260 {DRIVER_NVIDIA_GEFORCE8, DRIVER_MODEL_NT5X, "nv4_disp.dll", 18, 13, 4052},
1261 {DRIVER_NVIDIA_GEFORCE6, DRIVER_MODEL_NT6X, "nvd3dum.dll", 18, 13, 783},
1262 {DRIVER_NVIDIA_GEFORCE8, DRIVER_MODEL_NT6X, "nvd3dum.dll", 18, 13, 4052},
1263
1264 /* VMware */
1265 {DRIVER_VMWARE, DRIVER_MODEL_NT5X, "vm3dum.dll", 14, 1, 1134},
1266};
1267
1269{
1270 WORD vendor; /* reported PCI card vendor ID */
1271 WORD card; /* reported PCI card device ID */
1272 const char *description; /* Description of the card e.g. NVIDIA RIVA TNT */
1274 unsigned int vidmem;
1275};
1276
1277/* The amount of video memory stored in the gpu description table is the minimum amount of video memory
1278 * found on a board containing a specific GPU. */
1280{
1281 /* Nvidia cards */
1282 {HW_VENDOR_NVIDIA, CARD_NVIDIA_RIVA_128, "NVIDIA RIVA 128", DRIVER_NVIDIA_TNT, 4 },
1283 {HW_VENDOR_NVIDIA, CARD_NVIDIA_RIVA_TNT, "NVIDIA RIVA TNT", DRIVER_NVIDIA_TNT, 16 },
1284 {HW_VENDOR_NVIDIA, CARD_NVIDIA_RIVA_TNT2, "NVIDIA RIVA TNT2/TNT2 Pro", DRIVER_NVIDIA_TNT, 32 },
1285 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE, "NVIDIA GeForce 256", DRIVER_NVIDIA_TNT, 32 },
1286 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE2, "NVIDIA GeForce2 GTS/GeForce2 Pro", DRIVER_NVIDIA_TNT, 32 },
1287 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE2_MX, "NVIDIA GeForce2 MX/MX 400", DRIVER_NVIDIA_GEFORCE2MX,32 },
1289 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE4_MX, "NVIDIA GeForce4 MX 460", DRIVER_NVIDIA_GEFORCE2MX,64 },
1290 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE4_TI4200, "NVIDIA GeForce4 Ti 4200", DRIVER_NVIDIA_GEFORCE2MX,64, },
1291 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCEFX_5200, "NVIDIA GeForce FX 5200", DRIVER_NVIDIA_GEFORCEFX, 64 },
1292 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCEFX_5600, "NVIDIA GeForce FX 5600", DRIVER_NVIDIA_GEFORCEFX, 128 },
1293 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCEFX_5800, "NVIDIA GeForce FX 5800", DRIVER_NVIDIA_GEFORCEFX, 256 },
1295 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_6600GT, "NVIDIA GeForce 6600 GT", DRIVER_NVIDIA_GEFORCE6, 128 },
1296 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_6800, "NVIDIA GeForce 6800", DRIVER_NVIDIA_GEFORCE6, 128 },
1297 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7300, "NVIDIA GeForce Go 7300", DRIVER_NVIDIA_GEFORCE6, 256 },
1298 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7400, "NVIDIA GeForce Go 7400", DRIVER_NVIDIA_GEFORCE6, 256 },
1299 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7600, "NVIDIA GeForce 7600 GT", DRIVER_NVIDIA_GEFORCE6, 256 },
1300 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_7800GT, "NVIDIA GeForce 7800 GT", DRIVER_NVIDIA_GEFORCE6, 256 },
1301 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8200, "NVIDIA GeForce 8200", DRIVER_NVIDIA_GEFORCE8, 512 },
1302 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8300GS, "NVIDIA GeForce 8300 GS", DRIVER_NVIDIA_GEFORCE8, 128 },
1303 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8400GS, "NVIDIA GeForce 8400 GS", DRIVER_NVIDIA_GEFORCE8, 128 },
1304 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8500GT, "NVIDIA GeForce 8500 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
1305 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8600GT, "NVIDIA GeForce 8600 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
1306 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8600MGT, "NVIDIA GeForce 8600M GT", DRIVER_NVIDIA_GEFORCE8, 512 },
1307 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8800GTS, "NVIDIA GeForce 8800 GTS", DRIVER_NVIDIA_GEFORCE8, 320 },
1308 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_8800GTX, "NVIDIA GeForce 8800 GTX", DRIVER_NVIDIA_GEFORCE8, 768 },
1309 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9200, "NVIDIA GeForce 9200", DRIVER_NVIDIA_GEFORCE8, 256 },
1310 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9300, "NVIDIA GeForce 9300", DRIVER_NVIDIA_GEFORCE8, 256 },
1311 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9400M, "NVIDIA GeForce 9400M", DRIVER_NVIDIA_GEFORCE8, 256 },
1312 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9400GT, "NVIDIA GeForce 9400 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
1313 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9500GT, "NVIDIA GeForce 9500 GT", DRIVER_NVIDIA_GEFORCE8, 256 },
1314 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9600GT, "NVIDIA GeForce 9600 GT", DRIVER_NVIDIA_GEFORCE8, 512 },
1315 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9700MGT, "NVIDIA GeForce 9700M GT", DRIVER_NVIDIA_GEFORCE8, 512 },
1316 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_9800GT, "NVIDIA GeForce 9800 GT", DRIVER_NVIDIA_GEFORCE8, 512 },
1317 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_210, "NVIDIA GeForce 210", DRIVER_NVIDIA_GEFORCE8, 512 },
1318 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT220, "NVIDIA GeForce GT 220", DRIVER_NVIDIA_GEFORCE8, 512 },
1319 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT240, "NVIDIA GeForce GT 240", DRIVER_NVIDIA_GEFORCE8, 512 },
1320 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS250, "NVIDIA GeForce GTS 250", DRIVER_NVIDIA_GEFORCE8, 1024},
1321 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX260, "NVIDIA GeForce GTX 260", DRIVER_NVIDIA_GEFORCE8, 1024},
1322 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX275, "NVIDIA GeForce GTX 275", DRIVER_NVIDIA_GEFORCE8, 896 },
1323 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX280, "NVIDIA GeForce GTX 280", DRIVER_NVIDIA_GEFORCE8, 1024},
1324 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_315M, "NVIDIA GeForce 315M", DRIVER_NVIDIA_GEFORCE8, 512 },
1326 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT320M, "NVIDIA GeForce GT 320M", DRIVER_NVIDIA_GEFORCE8, 1024},
1327 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT325M, "NVIDIA GeForce GT 325M", DRIVER_NVIDIA_GEFORCE8, 1024},
1328 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT330, "NVIDIA GeForce GT 330", DRIVER_NVIDIA_GEFORCE8, 1024},
1329 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS350M, "NVIDIA GeForce GTS 350M", DRIVER_NVIDIA_GEFORCE8, 1024},
1331 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT420, "NVIDIA GeForce GT 420", DRIVER_NVIDIA_GEFORCE8, 2048},
1332 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT425M, "NVIDIA GeForce GT 425M", DRIVER_NVIDIA_GEFORCE8, 1024},
1333 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT430, "NVIDIA GeForce GT 430", DRIVER_NVIDIA_GEFORCE8, 1024},
1334 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT440, "NVIDIA GeForce GT 440", DRIVER_NVIDIA_GEFORCE8, 1024},
1335 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTS450, "NVIDIA GeForce GTS 450", DRIVER_NVIDIA_GEFORCE8, 1024},
1336 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX460, "NVIDIA GeForce GTX 460", DRIVER_NVIDIA_GEFORCE8, 768 },
1337 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX460M, "NVIDIA GeForce GTX 460M", DRIVER_NVIDIA_GEFORCE8, 1536},
1338 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX465, "NVIDIA GeForce GTX 465", DRIVER_NVIDIA_GEFORCE8, 1024},
1339 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX470, "NVIDIA GeForce GTX 470", DRIVER_NVIDIA_GEFORCE8, 1280},
1340 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX480, "NVIDIA GeForce GTX 480", DRIVER_NVIDIA_GEFORCE8, 1536},
1341 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT520, "NVIDIA GeForce GT 520", DRIVER_NVIDIA_GEFORCE8, 1024},
1342 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT525M, "NVIDIA GeForce GT 525M", DRIVER_NVIDIA_GEFORCE8, 1024},
1343 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT540M, "NVIDIA GeForce GT 540M", DRIVER_NVIDIA_GEFORCE8, 1024},
1344 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX550, "NVIDIA GeForce GTX 550 Ti", DRIVER_NVIDIA_GEFORCE8, 1024},
1345 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT555M, "NVIDIA GeForce GT 555M", DRIVER_NVIDIA_GEFORCE8, 1024},
1346 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560TI, "NVIDIA GeForce GTX 560 Ti", DRIVER_NVIDIA_GEFORCE8, 1024},
1347 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560M, "NVIDIA GeForce GTX 560M", DRIVER_NVIDIA_GEFORCE8, 3072},
1348 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX560, "NVIDIA GeForce GTX 560", DRIVER_NVIDIA_GEFORCE8, 1024},
1349 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX570, "NVIDIA GeForce GTX 570", DRIVER_NVIDIA_GEFORCE8, 1280},
1350 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX580, "NVIDIA GeForce GTX 580", DRIVER_NVIDIA_GEFORCE8, 1536},
1351 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT610, "NVIDIA GeForce GT 610", DRIVER_NVIDIA_GEFORCE8, 1024},
1352 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT630, "NVIDIA GeForce GT 630", DRIVER_NVIDIA_GEFORCE8, 1024},
1353 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT630M, "NVIDIA GeForce GT 630M", DRIVER_NVIDIA_GEFORCE8, 1024},
1354 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT640M, "NVIDIA GeForce GT 640M", DRIVER_NVIDIA_GEFORCE8, 1024},
1355 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT650M, "NVIDIA GeForce GT 650M", DRIVER_NVIDIA_GEFORCE8, 2048},
1356 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX650, "NVIDIA GeForce GTX 650", DRIVER_NVIDIA_GEFORCE8, 1024},
1357 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX650TI, "NVIDIA GeForce GTX 650 Ti", DRIVER_NVIDIA_GEFORCE8, 1024},
1358 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX660, "NVIDIA GeForce GTX 660", DRIVER_NVIDIA_GEFORCE8, 2048},
1359 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX660M, "NVIDIA GeForce GTX 660M", DRIVER_NVIDIA_GEFORCE8, 2048},
1360 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX660TI, "NVIDIA GeForce GTX 660 Ti", DRIVER_NVIDIA_GEFORCE8, 2048},
1361 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670, "NVIDIA GeForce GTX 670", DRIVER_NVIDIA_GEFORCE8, 2048},
1362 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX670MX, "NVIDIA GeForce GTX 670MX", DRIVER_NVIDIA_GEFORCE8, 3072},
1363 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX675MX, "NVIDIA GeForce GTX 675MX", DRIVER_NVIDIA_GEFORCE8, 4096},
1364 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX680, "NVIDIA GeForce GTX 680", DRIVER_NVIDIA_GEFORCE8, 2048},
1365 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX690, "NVIDIA GeForce GTX 690", DRIVER_NVIDIA_GEFORCE8, 2048},
1366 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT730, "NVIDIA GeForce GT 730", DRIVER_NVIDIA_GEFORCE8, 2048},
1367 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT730M, "NVIDIA GeForce GT 730M", DRIVER_NVIDIA_GEFORCE8, 1024},
1368 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT740M, "NVIDIA GeForce GT 740M", DRIVER_NVIDIA_GEFORCE8, 2048},
1369 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GT750M, "NVIDIA GeForce GT 750M", DRIVER_NVIDIA_GEFORCE8, 1024},
1370 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750, "NVIDIA GeForce GTX 750", DRIVER_NVIDIA_GEFORCE8, 1024},
1371 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX750TI, "NVIDIA GeForce GTX 750 Ti", DRIVER_NVIDIA_GEFORCE8, 2048},
1372 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX760, "NVIDIA GeForce GTX 760", DRIVER_NVIDIA_GEFORCE8, 2048},
1373 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX760TI, "NVIDIA GeForce GTX 760 Ti", DRIVER_NVIDIA_GEFORCE8, 2048},
1374 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX765M, "NVIDIA GeForce GTX 765M", DRIVER_NVIDIA_GEFORCE8, 2048},
1375 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770M, "NVIDIA GeForce GTX 770M", DRIVER_NVIDIA_GEFORCE8, 3072},
1376 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX770, "NVIDIA GeForce GTX 770", DRIVER_NVIDIA_GEFORCE8, 2048},
1377 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780, "NVIDIA GeForce GTX 780", DRIVER_NVIDIA_GEFORCE8, 3072},
1378 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX780TI, "NVIDIA GeForce GTX 780 Ti", DRIVER_NVIDIA_GEFORCE8, 3072},
1379 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITAN, "NVIDIA GeForce GTX TITAN", DRIVER_NVIDIA_GEFORCE8, 6144},
1380 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITANB, "NVIDIA GeForce GTX TITAN Black", DRIVER_NVIDIA_GEFORCE8, 6144},
1381 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITANX, "NVIDIA GeForce GTX TITAN X", DRIVER_NVIDIA_GEFORCE8, 12288},
1382 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTXTITANZ, "NVIDIA GeForce GTX TITAN Z", DRIVER_NVIDIA_GEFORCE8, 12288},
1383 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_820M, "NVIDIA GeForce 820M", DRIVER_NVIDIA_GEFORCE8, 2048},
1384 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_830M, "NVIDIA GeForce 830M", DRIVER_NVIDIA_GEFORCE8, 2048},
1385 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_840M, "NVIDIA GeForce 840M", DRIVER_NVIDIA_GEFORCE8, 2048},
1386 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_845M, "NVIDIA GeForce 845M", DRIVER_NVIDIA_GEFORCE8, 2048},
1387 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX850M, "NVIDIA GeForce GTX 850M", DRIVER_NVIDIA_GEFORCE8, 2048},
1388 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX860M, "NVIDIA GeForce GTX 860M", DRIVER_NVIDIA_GEFORCE8, 2048},
1389 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX870M, "NVIDIA GeForce GTX 870M", DRIVER_NVIDIA_GEFORCE8, 3072},
1390 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX880M, "NVIDIA GeForce GTX 880M", DRIVER_NVIDIA_GEFORCE8, 4096},
1391 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_940M, "NVIDIA GeForce 940M", DRIVER_NVIDIA_GEFORCE8, 4096},
1392 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX950, "NVIDIA GeForce GTX 950", DRIVER_NVIDIA_GEFORCE8, 2048},
1393 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX950M, "NVIDIA GeForce GTX 950M", DRIVER_NVIDIA_GEFORCE8, 4096},
1394 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX960, "NVIDIA GeForce GTX 960", DRIVER_NVIDIA_GEFORCE8, 4096},
1395 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX960M, "NVIDIA GeForce GTX 960M", DRIVER_NVIDIA_GEFORCE8, 2048},
1396 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX970, "NVIDIA GeForce GTX 970", DRIVER_NVIDIA_GEFORCE8, 4096},
1397 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX970M, "NVIDIA GeForce GTX 970M", DRIVER_NVIDIA_GEFORCE8, 3072},
1398 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX980, "NVIDIA GeForce GTX 980", DRIVER_NVIDIA_GEFORCE8, 4096},
1399 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX980TI, "NVIDIA GeForce GTX 980 Ti", DRIVER_NVIDIA_GEFORCE8, 6144},
1400 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1050, "NVIDIA GeForce GTX 1050", DRIVER_NVIDIA_GEFORCE8, 2048},
1401 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1060, "NVIDIA GeForce GTX 1060", DRIVER_NVIDIA_GEFORCE8, 6144},
1402 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1070, "NVIDIA GeForce GTX 1070", DRIVER_NVIDIA_GEFORCE8, 8192},
1403 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1080, "NVIDIA GeForce GTX 1080", DRIVER_NVIDIA_GEFORCE8, 8192},
1404 {HW_VENDOR_NVIDIA, CARD_NVIDIA_GEFORCE_GTX1080TI, "NVIDIA GeForce GTX 1080 Ti", DRIVER_NVIDIA_GEFORCE8, 11264},
1405 {HW_VENDOR_NVIDIA, CARD_NVIDIA_TITANX_PASCAL, "NVIDIA TITAN X (Pascal)", DRIVER_NVIDIA_GEFORCE8, 12288},
1406
1407 /* AMD cards */
1409 {HW_VENDOR_AMD, CARD_AMD_RADEON_7200, "ATI RADEON 7200 SERIES", DRIVER_AMD_R100, 32 },
1410 {HW_VENDOR_AMD, CARD_AMD_RADEON_8500, "ATI RADEON 8500 SERIES", DRIVER_AMD_R100, 64 },
1411 {HW_VENDOR_AMD, CARD_AMD_RADEON_9500, "ATI Radeon 9500", DRIVER_AMD_R300, 64 },
1412 {HW_VENDOR_AMD, CARD_AMD_RADEON_XPRESS_200M, "ATI RADEON XPRESS 200M Series", DRIVER_AMD_R300, 64 },
1413 {HW_VENDOR_AMD, CARD_AMD_RADEON_X700, "ATI Radeon X700 SE", DRIVER_AMD_R300, 128 },
1414 {HW_VENDOR_AMD, CARD_AMD_RADEON_X1600, "ATI Radeon X1600 Series", DRIVER_AMD_R300, 128 },
1415 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD2350, "ATI Mobility Radeon HD 2350", DRIVER_AMD_R600, 256 },
1416 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD2600, "ATI Mobility Radeon HD 2600", DRIVER_AMD_R600, 256 },
1417 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD2900, "ATI Radeon HD 2900 XT", DRIVER_AMD_R600, 512 },
1418 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD3200, "ATI Radeon HD 3200 Graphics", DRIVER_AMD_R600, 128 },
1419 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD3850, "ATI Radeon HD 3850 AGP", DRIVER_AMD_R600, 512 },
1420 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4200M, "ATI Mobility Radeon HD 4200", DRIVER_AMD_R600, 256 },
1421 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4350, "ATI Radeon HD 4350", DRIVER_AMD_R600, 256 },
1422 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4600, "ATI Radeon HD 4600 Series", DRIVER_AMD_R600, 512 },
1423 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4700, "ATI Radeon HD 4700 Series", DRIVER_AMD_R600, 512 },
1424 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD4800, "ATI Radeon HD 4800 Series", DRIVER_AMD_R600, 512 },
1425 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD5400, "ATI Radeon HD 5400 Series", DRIVER_AMD_R600, 512 },
1426 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD5600, "ATI Radeon HD 5600 Series", DRIVER_AMD_R600, 512 },
1427 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD5700, "ATI Radeon HD 5700 Series", DRIVER_AMD_R600, 512 },
1428 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD5800, "ATI Radeon HD 5800 Series", DRIVER_AMD_R600, 1024},
1429 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD5900, "ATI Radeon HD 5900 Series", DRIVER_AMD_R600, 1024},
1430 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6300, "AMD Radeon HD 6300 series Graphics", DRIVER_AMD_R600, 1024},
1431 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6400, "AMD Radeon HD 6400 Series", DRIVER_AMD_R600, 1024},
1432 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6410D, "AMD Radeon HD 6410D", DRIVER_AMD_R600, 1024},
1433 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6480G, "AMD Radeon HD 6480G", DRIVER_AMD_R600, 512 },
1434 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6550D, "AMD Radeon HD 6550D", DRIVER_AMD_R600, 1024},
1435 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6600, "AMD Radeon HD 6600 Series", DRIVER_AMD_R600, 1024},
1436 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6600M, "AMD Radeon HD 6600M Series", DRIVER_AMD_R600, 512 },
1437 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6700, "AMD Radeon HD 6700 Series", DRIVER_AMD_R600, 1024},
1438 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6800, "AMD Radeon HD 6800 Series", DRIVER_AMD_R600, 1024},
1439 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD6900, "AMD Radeon HD 6900 Series", DRIVER_AMD_R600, 2048},
1440 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7660D, "AMD Radeon HD 7660D", DRIVER_AMD_R600, 2048},
1441 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7700, "AMD Radeon HD 7700 Series", DRIVER_AMD_R600, 1024},
1442 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7800, "AMD Radeon HD 7800 Series", DRIVER_AMD_R600, 2048},
1443 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD7900, "AMD Radeon HD 7900 Series", DRIVER_AMD_R600, 2048},
1444 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD8600M, "AMD Radeon HD 8600M Series", DRIVER_AMD_R600, 1024},
1445 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD8670, "AMD Radeon HD 8670", DRIVER_AMD_R600, 2048},
1446 {HW_VENDOR_AMD, CARD_AMD_RADEON_HD8770, "AMD Radeon HD 8770", DRIVER_AMD_R600, 2048},
1447 {HW_VENDOR_AMD, CARD_AMD_RADEON_R3, "AMD Radeon HD 8400 / R3 Series", DRIVER_AMD_R600, 2048},
1448 {HW_VENDOR_AMD, CARD_AMD_RADEON_R7, "AMD Radeon(TM) R7 Graphics", DRIVER_AMD_R600, 2048},
1449 {HW_VENDOR_AMD, CARD_AMD_RADEON_R9_285, "AMD Radeon R9 285", DRIVER_AMD_RX, 2048},
1450 {HW_VENDOR_AMD, CARD_AMD_RADEON_R9_290, "AMD Radeon R9 290", DRIVER_AMD_RX, 4096},
1451 {HW_VENDOR_AMD, CARD_AMD_RADEON_R9_FURY, "AMD Radeon (TM) R9 Fury Series", DRIVER_AMD_RX, 4096},
1452 {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_460, "Radeon(TM) RX 460 Graphics", DRIVER_AMD_RX, 4096},
1453 {HW_VENDOR_AMD, CARD_AMD_RADEON_RX_480, "Radeon (TM) RX 480 Graphics", DRIVER_AMD_RX, 4096},
1454
1455 /* VMware */
1456 {HW_VENDOR_VMWARE, CARD_VMWARE_SVGA3D, "VMware SVGA 3D (Microsoft Corporation - WDDM)", DRIVER_VMWARE, 1024},
1457
1458 /* Intel cards */
1459 {HW_VENDOR_INTEL, CARD_INTEL_830M, "Intel(R) 82830M Graphics Controller", DRIVER_INTEL_GMA800, 32 },
1460 {HW_VENDOR_INTEL, CARD_INTEL_855GM, "Intel(R) 82852/82855 GM/GME Graphics Controller", DRIVER_INTEL_GMA800, 32 },
1461 {HW_VENDOR_INTEL, CARD_INTEL_845G, "Intel(R) 845G", DRIVER_INTEL_GMA800, 32 },
1462 {HW_VENDOR_INTEL, CARD_INTEL_865G, "Intel(R) 82865G Graphics Controller", DRIVER_INTEL_GMA800, 32 },
1463 {HW_VENDOR_INTEL, CARD_INTEL_915G, "Intel(R) 82915G/GV/910GL Express Chipset Family", DRIVER_INTEL_GMA900, 64 },
1464 {HW_VENDOR_INTEL, CARD_INTEL_E7221G, "Intel(R) E7221G", DRIVER_INTEL_GMA900, 64 },
1465 {HW_VENDOR_INTEL, CARD_INTEL_915GM, "Mobile Intel(R) 915GM/GMS,910GML Express Chipset Family", DRIVER_INTEL_GMA900, 64 },
1466 {HW_VENDOR_INTEL, CARD_INTEL_945G, "Intel(R) 945G", DRIVER_INTEL_GMA950, 64 },
1467 {HW_VENDOR_INTEL, CARD_INTEL_945GM, "Mobile Intel(R) 945GM Express Chipset Family", DRIVER_INTEL_GMA950, 64 },
1468 {HW_VENDOR_INTEL, CARD_INTEL_945GME, "Intel(R) 945GME", DRIVER_INTEL_GMA950, 64 },
1469 {HW_VENDOR_INTEL, CARD_INTEL_Q35, "Intel(R) Q35", DRIVER_INTEL_GMA950, 64 },
1470 {HW_VENDOR_INTEL, CARD_INTEL_G33, "Intel(R) G33", DRIVER_INTEL_GMA950, 64 },
1471 {HW_VENDOR_INTEL, CARD_INTEL_Q33, "Intel(R) Q33", DRIVER_INTEL_GMA950, 64 },
1472 {HW_VENDOR_INTEL, CARD_INTEL_PNVG, "Intel(R) IGD", DRIVER_INTEL_GMA950, 64 },
1473 {HW_VENDOR_INTEL, CARD_INTEL_PNVM, "Intel(R) IGD", DRIVER_INTEL_GMA950, 64 },
1474 {HW_VENDOR_INTEL, CARD_INTEL_965Q, "Intel(R) 965Q", DRIVER_INTEL_GMA3000, 128},
1475 {HW_VENDOR_INTEL, CARD_INTEL_965G, "Intel(R) 965G", DRIVER_INTEL_GMA3000, 128},
1476 {HW_VENDOR_INTEL, CARD_INTEL_946GZ, "Intel(R) 946GZ", DRIVER_INTEL_GMA3000, 128},
1477 {HW_VENDOR_INTEL, CARD_INTEL_965GM, "Mobile Intel(R) 965 Express Chipset Family", DRIVER_INTEL_GMA3000, 128},
1478 {HW_VENDOR_INTEL, CARD_INTEL_965GME, "Intel(R) 965GME", DRIVER_INTEL_GMA3000, 128},
1479 {HW_VENDOR_INTEL, CARD_INTEL_GM45, "Mobile Intel(R) GM45 Express Chipset Family", DRIVER_INTEL_GMA3000, 512},
1480 {HW_VENDOR_INTEL, CARD_INTEL_IGD, "Intel(R) Integrated Graphics Device", DRIVER_INTEL_GMA3000, 512},
1481 {HW_VENDOR_INTEL, CARD_INTEL_G45, "Intel(R) G45/G43", DRIVER_INTEL_GMA3000, 512},
1482 {HW_VENDOR_INTEL, CARD_INTEL_Q45, "Intel(R) Q45/Q43", DRIVER_INTEL_GMA3000, 512},
1483 {HW_VENDOR_INTEL, CARD_INTEL_G41, "Intel(R) G41", DRIVER_INTEL_GMA3000, 512},
1484 {HW_VENDOR_INTEL, CARD_INTEL_B43, "Intel(R) B43", DRIVER_INTEL_GMA3000, 512},
1485 {HW_VENDOR_INTEL, CARD_INTEL_ILKD, "Intel(R) HD Graphics", DRIVER_INTEL_GMA3000, 1536},
1486 {HW_VENDOR_INTEL, CARD_INTEL_ILKM, "Intel(R) HD Graphics", DRIVER_INTEL_GMA3000, 1536},
1487 {HW_VENDOR_INTEL, CARD_INTEL_SNBD, "Intel(R) HD Graphics 3000", DRIVER_INTEL_GMA3000, 1536},
1488 {HW_VENDOR_INTEL, CARD_INTEL_SNBM, "Intel(R) HD Graphics 3000", DRIVER_INTEL_GMA3000, 1536},
1489 {HW_VENDOR_INTEL, CARD_INTEL_SNBS, "Intel(R) HD Graphics Family", DRIVER_INTEL_GMA3000, 1536},
1490 {HW_VENDOR_INTEL, CARD_INTEL_IVBD, "Intel(R) HD Graphics 4000", DRIVER_INTEL_HD4000, 1536},
1491 {HW_VENDOR_INTEL, CARD_INTEL_IVBM, "Intel(R) HD Graphics 4000", DRIVER_INTEL_HD4000, 1536},
1492 {HW_VENDOR_INTEL, CARD_INTEL_IVBS, "Intel(R) HD Graphics Family", DRIVER_INTEL_HD4000, 1536},
1493 {HW_VENDOR_INTEL, CARD_INTEL_HWD, "Intel(R) HD Graphics 4600", DRIVER_INTEL_HD4000, 1536},
1494 {HW_VENDOR_INTEL, CARD_INTEL_HWM, "Intel(R) HD Graphics 4600", DRIVER_INTEL_HD4000, 1536},
1495 {HW_VENDOR_INTEL, CARD_INTEL_HD5000, "Intel(R) HD Graphics 5000", DRIVER_INTEL_HD4000, 1536},
1496 {HW_VENDOR_INTEL, CARD_INTEL_I5100_1, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
1497 {HW_VENDOR_INTEL, CARD_INTEL_I5100_2, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
1498 {HW_VENDOR_INTEL, CARD_INTEL_I5100_3, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
1499 {HW_VENDOR_INTEL, CARD_INTEL_I5100_4, "Intel(R) Iris(TM) Graphics 5100", DRIVER_INTEL_HD4000, 1536},
1500 {HW_VENDOR_INTEL, CARD_INTEL_IP5200_1, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
1501 {HW_VENDOR_INTEL, CARD_INTEL_IP5200_2, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
1502 {HW_VENDOR_INTEL, CARD_INTEL_IP5200_3, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
1503 {HW_VENDOR_INTEL, CARD_INTEL_IP5200_4, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
1504 {HW_VENDOR_INTEL, CARD_INTEL_IP5200_5, "Intel(R) Iris(TM) Pro Graphics 5200", DRIVER_INTEL_HD4000, 1536},
1505 {HW_VENDOR_INTEL, CARD_INTEL_HD5300, "Intel(R) HD Graphics 5300", DRIVER_INTEL_HD4000, 2048},
1506 {HW_VENDOR_INTEL, CARD_INTEL_HD5500, "Intel(R) HD Graphics 5500", DRIVER_INTEL_HD4000, 2048},
1507 {HW_VENDOR_INTEL, CARD_INTEL_HD5600, "Intel(R) HD Graphics 5600", DRIVER_INTEL_HD4000, 2048},
1508 {HW_VENDOR_INTEL, CARD_INTEL_HD6000, "Intel(R) HD Graphics 6000", DRIVER_INTEL_HD4000, 2048},
1509 {HW_VENDOR_INTEL, CARD_INTEL_I6100, "Intel(R) Iris(TM) Graphics 6100", DRIVER_INTEL_HD4000, 2048},
1510 {HW_VENDOR_INTEL, CARD_INTEL_IP6200, "Intel(R) Iris(TM) Pro Graphics 6200", DRIVER_INTEL_HD4000, 2048},
1511 {HW_VENDOR_INTEL, CARD_INTEL_IPP6300, "Intel(R) Iris(TM) Pro Graphics P6300", DRIVER_INTEL_HD4000, 2048},
1512 {HW_VENDOR_INTEL, CARD_INTEL_HD510_1, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000, 2048},
1513 {HW_VENDOR_INTEL, CARD_INTEL_HD510_2, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000, 2048},
1514 {HW_VENDOR_INTEL, CARD_INTEL_HD510_3, "Intel(R) HD Graphics 510", DRIVER_INTEL_HD4000, 2048},
1515 {HW_VENDOR_INTEL, CARD_INTEL_HD515, "Intel(R) HD Graphics 515", DRIVER_INTEL_HD4000, 2048},
1516 {HW_VENDOR_INTEL, CARD_INTEL_HD520_1, "Intel(R) HD Graphics 520", DRIVER_INTEL_HD4000, 2048},
1517 {HW_VENDOR_INTEL, CARD_INTEL_HD520_2, "Intel(R) HD Graphics 520", DRIVER_INTEL_HD4000, 2048},
1518 {HW_VENDOR_INTEL, CARD_INTEL_HD530_1, "Intel(R) HD Graphics 530", DRIVER_INTEL_HD4000, 2048},
1519 {HW_VENDOR_INTEL, CARD_INTEL_HD530_2, "Intel(R) HD Graphics 530", DRIVER_INTEL_HD4000, 2048},
1520 {HW_VENDOR_INTEL, CARD_INTEL_HDP530, "Intel(R) HD Graphics P530", DRIVER_INTEL_HD4000, 2048},
1521 {HW_VENDOR_INTEL, CARD_INTEL_I540, "Intel(R) Iris(TM) Graphics 540", DRIVER_INTEL_HD4000, 2048},
1522 {HW_VENDOR_INTEL, CARD_INTEL_I550, "Intel(R) Iris(TM) Graphics 550", DRIVER_INTEL_HD4000, 2048},
1523 {HW_VENDOR_INTEL, CARD_INTEL_I555, "Intel(R) Iris(TM) Graphics 555", DRIVER_INTEL_HD4000, 2048},
1524 {HW_VENDOR_INTEL, CARD_INTEL_IP555, "Intel(R) Iris(TM) Graphics P555", DRIVER_INTEL_HD4000, 2048},
1525 {HW_VENDOR_INTEL, CARD_INTEL_IP580_1, "Intel(R) Iris(TM) Pro Graphics 580", DRIVER_INTEL_HD4000, 2048},
1526 {HW_VENDOR_INTEL, CARD_INTEL_IP580_2, "Intel(R) Iris(TM) Pro Graphics 580", DRIVER_INTEL_HD4000, 2048},
1527 {HW_VENDOR_INTEL, CARD_INTEL_IPP580_1, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000, 2048},
1528 {HW_VENDOR_INTEL, CARD_INTEL_IPP580_2, "Intel(R) Iris(TM) Pro Graphics P580", DRIVER_INTEL_HD4000, 2048},
1529};
1530
1533{
1534 unsigned int i;
1535
1536 TRACE("Looking up version info for driver=%d driver_model=%d\n", driver, driver_model);
1537 for (i = 0; i < ARRAY_SIZE(driver_version_table); ++i)
1538 {
1540
1541 if (entry->driver == driver && (driver_model == DRIVER_MODEL_GENERIC
1542 || entry->driver_model == driver_model))
1543 {
1544 TRACE("Found driver \"%s\", version %u, subversion %u, build %u.\n",
1545 entry->driver_name, entry->version, entry->subversion, entry->build);
1546 return entry;
1547 }
1548 }
1549 return NULL;
1550}
1551
1554{
1555 unsigned int i;
1556
1557 for (i = 0; i < ARRAY_SIZE(gpu_description_table); ++i)
1558 {
1560 return &gpu_description_table[i];
1561 }
1562
1563 return NULL;
1564}
1565
1566static const struct gpu_description *query_gpu_description(const struct wined3d_gl_info *gl_info, UINT64 *vram_bytes)
1567{
1570 const struct gpu_description *gpu_description;
1571 static unsigned int once;
1572
1573 if (gl_info->supported[WGL_WINE_QUERY_RENDERER])
1574 {
1575 GLuint value;
1576
1577 if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_VENDOR_ID_WINE, &value)))
1578 vendor = value;
1579 if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_DEVICE_ID_WINE, &value)))
1580 device = value;
1581 if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_VIDEO_MEMORY_WINE, &value)))
1582 *vram_bytes = (UINT64)value * 1024 * 1024;
1583 TRACE("Card reports vendor PCI ID 0x%04x, device PCI ID 0x%04x, 0x%s bytes of video memory.\n",
1584 vendor, device, wine_dbgstr_longlong(*vram_bytes));
1585 }
1586 else if (gl_info->supported[NVX_GPU_MEMORY_INFO])
1587 {
1588 GLint vram_kb;
1589 gl_info->gl_ops.gl.p_glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &vram_kb);
1590
1591 *vram_bytes = (UINT64)vram_kb * 1024;
1592 TRACE("Got 0x%s as video memory from NVX_GPU_MEMORY_INFO extension.\n",
1593 wine_dbgstr_longlong(*vram_bytes));
1594 }
1595
1597 {
1599 TRACE("Overriding vendor PCI ID with 0x%04x.\n", vendor);
1600 }
1601
1603 {
1605 TRACE("Overriding device PCI ID with 0x%04x.\n", device);
1606 }
1607
1609 {
1611 TRACE("Overriding amount of video memory with 0x%s bytes.\n",
1612 wine_dbgstr_longlong(*vram_bytes));
1613 }
1614
1618 ERR_(winediag)("Invalid GPU override %04x:%04x specified, ignoring.\n", vendor, device);
1619
1620 return gpu_description;
1621}
1622
1623static void init_driver_info(struct wined3d_driver_info *driver_info,
1624 const struct gpu_description *gpu_desc, UINT64 vram_bytes)
1625{
1626 OSVERSIONINFOW os_version;
1627 WORD driver_os_version;
1629 enum wined3d_driver_model driver_model;
1630 const struct driver_version_information *version_info;
1631
1632 memset(&os_version, 0, sizeof(os_version));
1633 os_version.dwOSVersionInfoSize = sizeof(os_version);
1634 if (!GetVersionExW(&os_version))
1635 {
1636 ERR("Failed to get OS version, reporting 2000/XP.\n");
1637 driver_os_version = 6;
1639 }
1640 else
1641 {
1642 TRACE("OS version %u.%u.\n", os_version.dwMajorVersion, os_version.dwMinorVersion);
1643 switch (os_version.dwMajorVersion)
1644 {
1645 case 4:
1646 /* If needed we could distinguish between 9x and NT4, but this code won't make
1647 * sense for NT4 since it had no way to obtain this info through DirectDraw 3.0.
1648 */
1649 driver_os_version = 4;
1651 break;
1652
1653 case 5:
1654 driver_os_version = 6;
1656 break;
1657
1658 case 6:
1659 if (os_version.dwMinorVersion == 0)
1660 {
1661 driver_os_version = 7;
1663 }
1664 else if (os_version.dwMinorVersion == 1)
1665 {
1666 driver_os_version = 8;
1668 }
1669 else
1670 {
1671 if (os_version.dwMinorVersion > 2)
1672 {
1673 FIXME("Unhandled OS version %u.%u, reporting Win 8.\n",
1674 os_version.dwMajorVersion, os_version.dwMinorVersion);
1675 }
1676 driver_os_version = 9;
1678 }
1679 break;
1680
1681 case 10:
1682 driver_os_version = 10;
1684 break;
1685
1686 default:
1687 FIXME("Unhandled OS version %u.%u, reporting 2000/XP.\n",
1688 os_version.dwMajorVersion, os_version.dwMinorVersion);
1689 driver_os_version = 6;
1691 break;
1692 }
1693 }
1694
1695 driver_info->vendor = gpu_desc->vendor;
1696 driver_info->device = gpu_desc->card;
1697 driver_info->description = gpu_desc->description;
1698 driver_info->vram_bytes = vram_bytes ? vram_bytes : (UINT64)gpu_desc->vidmem * 1024 * 1024;
1699 driver = gpu_desc->driver;
1700
1706#ifdef __i386__
1707 if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX)
1708 {
1709 TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX);
1710 driver_info->vram_bytes = LONG_MAX;
1711 }
1712#endif
1713
1714 /* Try to obtain driver version information for the current Windows version. This fails in
1715 * some cases:
1716 * - the gpu is not available on the currently selected OS version:
1717 * - Geforce GTX480 on Win98. When running applications in compatibility mode on Windows,
1718 * version information for the current Windows version is returned instead of faked info.
1719 * We do the same and assume the default Windows version to emulate is WinXP.
1720 *
1721 * - Videocard is a Riva TNT but winver is set to win7 (there are no drivers for this beast)
1722 * For now return the XP driver info. Perhaps later on we should return VESA.
1723 *
1724 * - the gpu is not in our database (can happen when the user overrides the vendor_id / device_id)
1725 * This could be an indication that our database is not up to date, so this should be fixed.
1726 */
1727 if ((version_info = get_driver_version_info(driver, driver_model))
1729 {
1730 driver_info->name = version_info->driver_name;
1731 driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, version_info->version);
1732 driver_info->version_low = MAKEDWORD_VERSION(version_info->subversion, version_info->build);
1733 }
1734 else
1735 {
1736 ERR("No driver version info found for device %04x:%04x, driver model %#x.\n",
1737 driver_info->vendor, driver_info->device, driver_model);
1738 driver_info->name = "Display";
1739 driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, 15);
1740 driver_info->version_low = MAKEDWORD_VERSION(8, 6); /* Nvidia RIVA TNT, arbitrary */
1741 }
1742
1743 TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n",
1744 driver_info->version_high, driver_info->version_low);
1745}
1746
1747/* Context activation is done by the caller. */
1748static void fixup_extensions(struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx,
1749 const char *gl_renderer, enum wined3d_gl_vendor gl_vendor,
1751{
1752 unsigned int i;
1753
1754 for (i = 0; i < ARRAY_SIZE(quirk_table); ++i)
1755 {
1756 if (!quirk_table[i].match(gl_info, ctx, gl_renderer, gl_vendor, card_vendor, device)) continue;
1757 TRACE("Applying driver quirk \"%s\".\n", quirk_table[i].description);
1758 quirk_table[i].apply(gl_info);
1759 }
1760
1761 /* Find out if PBOs work as they are supposed to. */
1762 test_pbo_functionality(gl_info);
1763}
1764
1765static DWORD wined3d_parse_gl_version(const char *gl_version)
1766{
1767 const char *ptr = gl_version;
1768 int major, minor;
1769
1770 major = atoi(ptr);
1771 if (major <= 0)
1772 ERR("Invalid OpenGL major version %d.\n", major);
1773
1774 while (isdigit(*ptr)) ++ptr;
1775 if (*ptr++ != '.')
1776 ERR("Invalid OpenGL version string %s.\n", debugstr_a(gl_version));
1777
1778 minor = atoi(ptr);
1779
1780 TRACE("Found OpenGL version %d.%d.\n", major, minor);
1781
1782 return MAKEDWORD_VERSION(major, minor);
1783}
1784
1786 const char *gl_vendor_string, const char *gl_renderer, const char *gl_version)
1787{
1788 /* MacOS has various specialities in the extensions it advertises. Some have to be loaded from
1789 * the opengl 1.2+ core, while other extensions are advertised, but software emulated. So try to
1790 * detect the Apple OpenGL implementation to apply some extension fixups afterwards.
1791 *
1792 * Detecting this isn't really easy. The vendor string doesn't mention Apple. Compile-time checks
1793 * aren't sufficient either because a Linux binary may display on a macos X server via remote X11.
1794 * So try to detect the GL implementation by looking at certain Apple extensions. Some extensions
1795 * like client storage might be supported on other implementations too, but GL_APPLE_flush_render
1796 * is specific to the Mac OS X window management, and GL_APPLE_ycbcr_422 is QuickTime specific. So
1797 * the chance that other implementations support them is rather small since Win32 QuickTime uses
1798 * DirectDraw, not OpenGL. */
1799 if (gl_info->supported[APPLE_FENCE] && gl_info->supported[APPLE_YCBCR_422])
1800 return GL_VENDOR_APPLE;
1801
1802 if (strstr(gl_vendor_string, "NVIDIA"))
1803 return GL_VENDOR_NVIDIA;
1804
1805 if (strstr(gl_vendor_string, "ATI"))
1806 return GL_VENDOR_FGLRX;
1807
1808 if (strstr(gl_vendor_string, "Mesa")
1809 || strstr(gl_vendor_string, "Brian Paul")
1810 || strstr(gl_vendor_string, "X.Org")
1811 || strstr(gl_vendor_string, "Advanced Micro Devices, Inc.")
1812 || strstr(gl_vendor_string, "DRI R300 Project")
1813 || strstr(gl_vendor_string, "Tungsten Graphics, Inc")
1814 || strstr(gl_vendor_string, "VMware, Inc.")
1815 || strstr(gl_vendor_string, "Intel")
1816 || strstr(gl_renderer, "Mesa")
1817 || strstr(gl_renderer, "Gallium")
1818 || strstr(gl_renderer, "Intel")
1819 || strstr(gl_version, "Mesa"))
1820 return GL_VENDOR_MESA;
1821
1822 FIXME("Received unrecognized GL_VENDOR %s. Returning GL_VENDOR_UNKNOWN.\n",
1823 debugstr_a(gl_vendor_string));
1824
1825 return GL_VENDOR_UNKNOWN;
1826}
1827
1828static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_string, const char *gl_renderer)
1829{
1830 if (strstr(gl_vendor_string, "NVIDIA")
1831 || strstr(gl_vendor_string, "Nouveau")
1832 || strstr(gl_vendor_string, "nouveau"))
1833 return HW_VENDOR_NVIDIA;
1834
1835 if (strstr(gl_vendor_string, "ATI")
1836 || strstr(gl_vendor_string, "Advanced Micro Devices, Inc.")
1837 || strstr(gl_vendor_string, "X.Org R300 Project")
1838 || strstr(gl_renderer, "AMD")
1839 || strstr(gl_renderer, "FirePro")
1840 || strstr(gl_renderer, "Radeon")
1841 || strstr(gl_renderer, "R100")
1842 || strstr(gl_renderer, "R200")
1843 || strstr(gl_renderer, "R300")
1844 || strstr(gl_renderer, "R600")
1845 || strstr(gl_renderer, "R700"))
1846 return HW_VENDOR_AMD;
1847
1848 if (strstr(gl_vendor_string, "Intel(R)")
1849 /* Intel switched from Intel(R) to Intel® recently, so just match Intel. */
1850 || strstr(gl_renderer, "Intel")
1851 || strstr(gl_renderer, "i915")
1852 || strstr(gl_vendor_string, "Intel Inc."))
1853 return HW_VENDOR_INTEL;
1854
1855 if (strstr(gl_renderer, "SVGA3D"))
1856 return HW_VENDOR_VMWARE;
1857
1858 if (strstr(gl_vendor_string, "Mesa")
1859 || strstr(gl_vendor_string, "Brian Paul")
1860 || strstr(gl_vendor_string, "Tungsten Graphics, Inc")
1861 || strstr(gl_vendor_string, "VMware, Inc."))
1862 return HW_VENDOR_SOFTWARE;
1863
1864 FIXME("Received unrecognized GL_VENDOR %s. Returning HW_VENDOR_NVIDIA.\n", debugstr_a(gl_vendor_string));
1865
1866 return HW_VENDOR_NVIDIA;
1867}
1868
1870{
1871 if (shader_caps->vs_version >= 5)
1872 return WINED3D_D3D_LEVEL_11;
1873 if (shader_caps->vs_version == 4)
1874 return WINED3D_D3D_LEVEL_10;
1875 if (shader_caps->vs_version == 3)
1876 {
1877 /* wined3d with default settings at the moment doesn't expose SM4+ on
1878 * Mesa drivers. */
1879 if (glsl_version >= MAKEDWORD_VERSION(4, 30))
1880 return WINED3D_D3D_LEVEL_11;
1881 if (glsl_version >= MAKEDWORD_VERSION(1, 30))
1882 return WINED3D_D3D_LEVEL_10;
1884 }
1885 if (shader_caps->vs_version == 2)
1887 if (shader_caps->vs_version == 1)
1888 return WINED3D_D3D_LEVEL_8;
1889
1891 return WINED3D_D3D_LEVEL_7;
1893 return WINED3D_D3D_LEVEL_6;
1894
1895 return WINED3D_D3D_LEVEL_5;
1896}
1897
1898static const struct wined3d_renderer_table
1899{
1900 const char *renderer;
1902}
1904{
1905 /* Direct 3D 11 */
1906 {"TITAN X (Pascal)", CARD_NVIDIA_TITANX_PASCAL}, /* GeForce 1000 - highend */
1907 {"GTX 1080 Ti", CARD_NVIDIA_GEFORCE_GTX1080TI}, /* GeForce 1000 - highend */
1908 {"GTX 1080", CARD_NVIDIA_GEFORCE_GTX1080}, /* GeForce 1000 - highend */
1909 {"GTX 1070", CARD_NVIDIA_GEFORCE_GTX1070}, /* GeForce 1000 - highend */
1910 {"GTX 1060", CARD_NVIDIA_GEFORCE_GTX1060}, /* GeForce 1000 - midend high */
1911 {"GTX 1050", CARD_NVIDIA_GEFORCE_GTX1050}, /* GeForce 1000 - midend */
1912 {"GTX 980 Ti", CARD_NVIDIA_GEFORCE_GTX980TI}, /* GeForce 900 - highend */
1913 {"GTX 980", CARD_NVIDIA_GEFORCE_GTX980}, /* GeForce 900 - highend */
1914 {"GTX 970M", CARD_NVIDIA_GEFORCE_GTX970M}, /* GeForce 900 - highend mobile*/
1915 {"GTX 970", CARD_NVIDIA_GEFORCE_GTX970}, /* GeForce 900 - highend */
1916 {"GTX TITAN X", CARD_NVIDIA_GEFORCE_GTXTITANX}, /* Geforce 900 - highend */
1917 {"GTX 960M", CARD_NVIDIA_GEFORCE_GTX960M}, /* GeForce 900 - midend high mobile */
1918 {"GTX 960", CARD_NVIDIA_GEFORCE_GTX960}, /* GeForce 900 - midend high */
1919 {"GTX 950M", CARD_NVIDIA_GEFORCE_GTX950M}, /* GeForce 900 - midend mobile */
1920 {"GTX 950", CARD_NVIDIA_GEFORCE_GTX950}, /* GeForce 900 - midend */
1921 {"GeForce 940M", CARD_NVIDIA_GEFORCE_940M}, /* GeForce 900 - midend mobile */
1922 {"GTX 880M", CARD_NVIDIA_GEFORCE_GTX880M}, /* GeForce 800 - mobile */
1923 {"GTX 870M", CARD_NVIDIA_GEFORCE_GTX870M}, /* GeForce 800 - mobile */
1924 {"GTX 860M", CARD_NVIDIA_GEFORCE_GTX860M}, /* GeForce 800 - mobile */
1925 {"GTX 850M", CARD_NVIDIA_GEFORCE_GTX850M}, /* GeForce 800 - mobile */
1926 {"GeForce 845M", CARD_NVIDIA_GEFORCE_845M}, /* GeForce 800 - mobile */
1927 {"GeForce 840M", CARD_NVIDIA_GEFORCE_840M}, /* GeForce 800 - mobile */
1928 {"GeForce 830M", CARD_NVIDIA_GEFORCE_830M}, /* GeForce 800 - mobile */
1929 {"GeForce 820M", CARD_NVIDIA_GEFORCE_820M}, /* GeForce 800 - mobile */
1930 {"GTX 780 Ti", CARD_NVIDIA_GEFORCE_GTX780TI}, /* Geforce 700 - highend */
1931 {"GTX TITAN Black", CARD_NVIDIA_GEFORCE_GTXTITANB}, /* Geforce 700 - highend */
1932 {"GTX TITAN Z", CARD_NVIDIA_GEFORCE_GTXTITANZ}, /* Geforce 700 - highend */
1933 {"GTX TITAN", CARD_NVIDIA_GEFORCE_GTXTITAN}, /* Geforce 700 - highend */
1934 {"GTX 780", CARD_NVIDIA_GEFORCE_GTX780}, /* Geforce 700 - highend */
1935 {"GTX 770M", CARD_NVIDIA_GEFORCE_GTX770M}, /* Geforce 700 - midend high mobile */
1936 {"GTX 770", CARD_NVIDIA_GEFORCE_GTX770}, /* Geforce 700 - highend */
1937 {"GTX 765M", CARD_NVIDIA_GEFORCE_GTX765M}, /* Geforce 700 - midend high mobile */
1938 {"GTX 760 Ti", CARD_NVIDIA_GEFORCE_GTX760TI}, /* Geforce 700 - midend high */
1939 {"GTX 760", CARD_NVIDIA_GEFORCE_GTX760}, /* Geforce 700 - midend high */
1940 {"GTX 750 Ti", CARD_NVIDIA_GEFORCE_GTX750TI}, /* Geforce 700 - midend */
1941 {"GTX 750", CARD_NVIDIA_GEFORCE_GTX750}, /* Geforce 700 - midend */
1942 {"GT 750M", CARD_NVIDIA_GEFORCE_GT750M}, /* Geforce 700 - midend mobile */
1943 {"GT 740M", CARD_NVIDIA_GEFORCE_GT740M}, /* Geforce 700 - midend mobile */
1944 {"GT 730M", CARD_NVIDIA_GEFORCE_GT730M}, /* Geforce 700 - midend mobile */
1945 {"GT 730", CARD_NVIDIA_GEFORCE_GT730}, /* Geforce 700 - lowend */
1946 {"GTX 690", CARD_NVIDIA_GEFORCE_GTX690}, /* Geforce 600 - highend */
1947 {"GTX 680", CARD_NVIDIA_GEFORCE_GTX680}, /* Geforce 600 - highend */
1948 {"GTX 675MX", CARD_NVIDIA_GEFORCE_GTX675MX}, /* Geforce 600 - highend */
1949 {"GTX 670MX", CARD_NVIDIA_GEFORCE_GTX670MX}, /* Geforce 600 - highend */
1950 {"GTX 670", CARD_NVIDIA_GEFORCE_GTX670}, /* Geforce 600 - midend high */
1951 {"GTX 660 Ti", CARD_NVIDIA_GEFORCE_GTX660TI}, /* Geforce 600 - midend high */
1952 {"GTX 660M", CARD_NVIDIA_GEFORCE_GTX660M}, /* Geforce 600 - midend high mobile */
1953 {"GTX 660", CARD_NVIDIA_GEFORCE_GTX660}, /* Geforce 600 - midend high */
1954 {"GTX 650 Ti", CARD_NVIDIA_GEFORCE_GTX650TI}, /* Geforce 600 - lowend */
1955 {"GTX 650", CARD_NVIDIA_GEFORCE_GTX650}, /* Geforce 600 - lowend */
1956 {"GT 650M", CARD_NVIDIA_GEFORCE_GT650M}, /* Geforce 600 - midend mobile */
1957 {"GT 640M", CARD_NVIDIA_GEFORCE_GT640M}, /* Geforce 600 - midend mobile */
1958 {"GT 630M", CARD_NVIDIA_GEFORCE_GT630M}, /* Geforce 600 - midend mobile */
1959 {"GT 630", CARD_NVIDIA_GEFORCE_GT630}, /* Geforce 600 - lowend */
1960 {"GT 610", CARD_NVIDIA_GEFORCE_GT610}, /* Geforce 600 - lowend */
1961 {"GTX 580", CARD_NVIDIA_GEFORCE_GTX580}, /* Geforce 500 - highend */
1962 {"GTX 570", CARD_NVIDIA_GEFORCE_GTX570}, /* Geforce 500 - midend high */
1963 {"GTX 560 Ti", CARD_NVIDIA_GEFORCE_GTX560TI}, /* Geforce 500 - midend */
1964 {"GTX 560M", CARD_NVIDIA_GEFORCE_GTX560M}, /* Geforce 500 - midend mobile */
1965 {"GTX 560", CARD_NVIDIA_GEFORCE_GTX560}, /* Geforce 500 - midend */
1966 {"GT 555M", CARD_NVIDIA_GEFORCE_GT555M}, /* Geforce 500 - midend mobile */
1967 {"GTX 550 Ti", CARD_NVIDIA_GEFORCE_GTX550}, /* Geforce 500 - midend */
1968 {"GT 540M", CARD_NVIDIA_GEFORCE_GT540M}, /* Geforce 500 - midend mobile */
1969 {"GT 525M", CARD_NVIDIA_GEFORCE_GT525M}, /* Geforce 500 - lowend mobile */
1970 {"GT 520", CARD_NVIDIA_GEFORCE_GT520}, /* Geforce 500 - lowend */
1971 {"GTX 480", CARD_NVIDIA_GEFORCE_GTX480}, /* Geforce 400 - highend */
1972 {"GTX 470", CARD_NVIDIA_GEFORCE_GTX470}, /* Geforce 400 - midend high */
1973 /* Direct 3D 10 */
1974 {"GTX 465", CARD_NVIDIA_GEFORCE_GTX465}, /* Geforce 400 - midend */
1975 {"GTX 460M", CARD_NVIDIA_GEFORCE_GTX460M}, /* Geforce 400 - highend mobile */
1976 {"GTX 460", CARD_NVIDIA_GEFORCE_GTX460}, /* Geforce 400 - midend */
1977 {"GTS 450", CARD_NVIDIA_GEFORCE_GTS450}, /* Geforce 400 - midend low */
1978 {"GT 440", CARD_NVIDIA_GEFORCE_GT440}, /* Geforce 400 - lowend */
1979 {"GT 430", CARD_NVIDIA_GEFORCE_GT430}, /* Geforce 400 - lowend */
1980 {"GT 425M", CARD_NVIDIA_GEFORCE_GT425M}, /* Geforce 400 - lowend mobile */
1981 {"GT 420", CARD_NVIDIA_GEFORCE_GT420}, /* Geforce 400 - lowend */
1982 {"410M", CARD_NVIDIA_GEFORCE_410M}, /* Geforce 400 - lowend mobile */
1983 {"GT 330", CARD_NVIDIA_GEFORCE_GT330}, /* Geforce 300 - highend */
1984 {"GTS 360M", CARD_NVIDIA_GEFORCE_GTS350M}, /* Geforce 300 - highend mobile */
1985 {"GTS 350M", CARD_NVIDIA_GEFORCE_GTS350M}, /* Geforce 300 - highend mobile */
1986 {"GT 330M", CARD_NVIDIA_GEFORCE_GT325M}, /* Geforce 300 - midend mobile */
1987 {"GT 325M", CARD_NVIDIA_GEFORCE_GT325M}, /* Geforce 300 - midend mobile */
1988 {"GT 320M", CARD_NVIDIA_GEFORCE_GT320M}, /* Geforce 300 - midend mobile */
1989 {"320M", CARD_NVIDIA_GEFORCE_320M}, /* Geforce 300 - midend mobile */
1990 {"315M", CARD_NVIDIA_GEFORCE_315M}, /* Geforce 300 - midend mobile */
1991 {"GTX 295", CARD_NVIDIA_GEFORCE_GTX280}, /* Geforce 200 - highend */
1992 {"GTX 285", CARD_NVIDIA_GEFORCE_GTX280}, /* Geforce 200 - highend */
1993 {"GTX 280", CARD_NVIDIA_GEFORCE_GTX280}, /* Geforce 200 - highend */
1994 {"GTX 275", CARD_NVIDIA_GEFORCE_GTX275}, /* Geforce 200 - midend high */
1995 {"GTX 260", CARD_NVIDIA_GEFORCE_GTX260}, /* Geforce 200 - midend */
1996 {"GTS 250", CARD_NVIDIA_GEFORCE_GTS250}, /* Geforce 200 - midend */
1997 {"GT 240", CARD_NVIDIA_GEFORCE_GT240}, /* Geforce 200 - midend */
1998 {"GT 220", CARD_NVIDIA_GEFORCE_GT220}, /* Geforce 200 - lowend */
1999 {"GeForce 310", CARD_NVIDIA_GEFORCE_210}, /* Geforce 200 - lowend */
2000 {"GeForce 305", CARD_NVIDIA_GEFORCE_210}, /* Geforce 200 - lowend */
2001 {"GeForce 210", CARD_NVIDIA_GEFORCE_210}, /* Geforce 200 - lowend */
2002 {"G 210", CARD_NVIDIA_GEFORCE_210}, /* Geforce 200 - lowend */
2003 {"GTS 150", CARD_NVIDIA_GEFORCE_9800GT}, /* Geforce 9 - highend / Geforce 200 - midend */
2004 {"9800", CARD_NVIDIA_GEFORCE_9800GT}, /* Geforce 9 - highend / Geforce 200 - midend */
2005 {"9700M GT", CARD_NVIDIA_GEFORCE_9700MGT}, /* Geforce 9 - midend */
2006 {"GT 140", CARD_NVIDIA_GEFORCE_9600GT}, /* Geforce 9 - midend */
2007 {"9600", CARD_NVIDIA_GEFORCE_9600GT}, /* Geforce 9 - midend */
2008 {"GT 130", CARD_NVIDIA_GEFORCE_9500GT}, /* Geforce 9 - midend low / Geforce 200 - low */
2009 {"GT 120", CARD_NVIDIA_GEFORCE_9500GT}, /* Geforce 9 - midend low / Geforce 200 - low */
2010 {"9500", CARD_NVIDIA_GEFORCE_9500GT}, /* Geforce 9 - midend low / Geforce 200 - low */
2011 {"9400M", CARD_NVIDIA_GEFORCE_9400M}, /* Geforce 9 - lowend */
2012 {"9400", CARD_NVIDIA_GEFORCE_9400GT}, /* Geforce 9 - lowend */
2013 {"9300", CARD_NVIDIA_GEFORCE_9300}, /* Geforce 9 - lowend low */
2014 {"9200", CARD_NVIDIA_GEFORCE_9200}, /* Geforce 9 - lowend low */
2015 {"9100", CARD_NVIDIA_GEFORCE_9200}, /* Geforce 9 - lowend low */
2016 {"G 100", CARD_NVIDIA_GEFORCE_9200}, /* Geforce 9 - lowend low */
2017 {"8800 GTX", CARD_NVIDIA_GEFORCE_8800GTX}, /* Geforce 8 - highend high */
2018 {"8800", CARD_NVIDIA_GEFORCE_8800GTS}, /* Geforce 8 - highend */
2019 {"8600M", CARD_NVIDIA_GEFORCE_8600MGT}, /* Geforce 8 - midend mobile */
2020 {"8600 M", CARD_NVIDIA_GEFORCE_8600MGT}, /* Geforce 8 - midend mobile */
2021 {"8700", CARD_NVIDIA_GEFORCE_8600GT}, /* Geforce 8 - midend */
2022 {"8600", CARD_NVIDIA_GEFORCE_8600GT}, /* Geforce 8 - midend */
2023 {"8500", CARD_NVIDIA_GEFORCE_8500GT}, /* Geforce 8 - mid-lowend */
2024 {"8400", CARD_NVIDIA_GEFORCE_8400GS}, /* Geforce 8 - mid-lowend */
2025 {"8300", CARD_NVIDIA_GEFORCE_8300GS}, /* Geforce 8 - lowend */
2026 {"8200", CARD_NVIDIA_GEFORCE_8200}, /* Geforce 8 - lowend */
2027 {"8100", CARD_NVIDIA_GEFORCE_8200}, /* Geforce 8 - lowend */
2028 /* Direct 3D 9 SM3 */
2029 {"Quadro FX 5", CARD_NVIDIA_GEFORCE_7800GT}, /* Geforce 7 - highend */
2030 {"Quadro FX 4", CARD_NVIDIA_GEFORCE_7800GT}, /* Geforce 7 - highend */
2031 {"7950", CARD_NVIDIA_GEFORCE_7800GT}, /* Geforce 7 - highend */
2032 {"7900", CARD_NVIDIA_GEFORCE_7800GT}, /* Geforce 7 - highend */
2033 {"7800", CARD_NVIDIA_GEFORCE_7800GT}, /* Geforce 7 - highend */
2034 {"7700", CARD_NVIDIA_GEFORCE_7600}, /* Geforce 7 - midend */
2035 {"7600", CARD_NVIDIA_GEFORCE_7600}, /* Geforce 7 - midend */
2036 {"7400", CARD_NVIDIA_GEFORCE_7400}, /* Geforce 7 - lower medium */
2037 {"7300", CARD_NVIDIA_GEFORCE_7300}, /* Geforce 7 - lowend */
2038 {"6800", CARD_NVIDIA_GEFORCE_6800}, /* Geforce 6 - highend */
2039 {"6700", CARD_NVIDIA_GEFORCE_6600GT}, /* Geforce 6 - midend */
2040 {"6610", CARD_NVIDIA_GEFORCE_6600GT}, /* Geforce 6 - midend */
2041 {"6600", CARD_NVIDIA_GEFORCE_6600GT}, /* Geforce 6 - midend */
2042 /* Direct 3D 9 SM2 */
2043 {"Quadro FX", CARD_NVIDIA_GEFORCEFX_5800}, /* GeforceFX - highend */
2044 {"5950", CARD_NVIDIA_GEFORCEFX_5800}, /* GeforceFX - highend */
2045 {"5900", CARD_NVIDIA_GEFORCEFX_5800}, /* GeforceFX - highend */
2046 {"5800", CARD_NVIDIA_GEFORCEFX_5800}, /* GeforceFX - highend */
2047 {"5750", CARD_NVIDIA_GEFORCEFX_5600}, /* GeforceFX - midend */
2048 {"5700", CARD_NVIDIA_GEFORCEFX_5600}, /* GeforceFX - midend */
2049 {"5650", CARD_NVIDIA_GEFORCEFX_5600}, /* GeforceFX - midend */
2050 {"5600", CARD_NVIDIA_GEFORCEFX_5600}, /* GeforceFX - midend */
2051 {"5500", CARD_NVIDIA_GEFORCEFX_5200}, /* GeforceFX - lowend */
2052 {"5300", CARD_NVIDIA_GEFORCEFX_5200}, /* GeforceFX - lowend */
2053 {"5250", CARD_NVIDIA_GEFORCEFX_5200}, /* GeforceFX - lowend */
2054 {"5200", CARD_NVIDIA_GEFORCEFX_5200}, /* GeforceFX - lowend */
2055 {"5100", CARD_NVIDIA_GEFORCEFX_5200}, /* GeforceFX - lowend */
2056 /* Direct 3D 8 */
2057 {"Quadro4", CARD_NVIDIA_GEFORCE4_TI4200},
2058 {"GeForce4 Ti", CARD_NVIDIA_GEFORCE4_TI4200}, /* Geforce4 Ti4200/Ti4400/Ti4600/Ti4800 */
2059 /* Direct 3D 7 */
2060 {"GeForce4 MX", CARD_NVIDIA_GEFORCE4_MX}, /* MX420/MX440/MX460/MX4000 */
2061 {"Quadro2 MXR", CARD_NVIDIA_GEFORCE2_MX},
2062 {"GeForce2 MX", CARD_NVIDIA_GEFORCE2_MX}, /* Geforce2 standard/MX100/MX200/MX400 */
2063 {"Quadro2", CARD_NVIDIA_GEFORCE2},
2064 {"GeForce2", CARD_NVIDIA_GEFORCE2}, /* Geforce2 GTS/Pro/Ti/Ultra */
2065 /* Direct 3D 6 */
2066 {"TNT2", CARD_NVIDIA_RIVA_TNT2}, /* Riva TNT2 standard/M64/Pro/Ultra */
2068/* See http://developer.amd.com/resources/hardware-drivers/ati-catalyst-pc-vendor-id-1002-li/
2069 *
2070 * Beware: renderer string do not match exact card model,
2071 * eg HD 4800 is returned for multiple cards, even for RV790 based ones. */
2073{
2074 {"RX 480", CARD_AMD_RADEON_RX_480},
2075 {"RX 460", CARD_AMD_RADEON_RX_460},
2076 {"R9 Fury Series", CARD_AMD_RADEON_R9_FURY},
2077 /* Southern Islands */
2078 {"HD 7900", CARD_AMD_RADEON_HD7900},
2079 {"HD 7800", CARD_AMD_RADEON_HD7800},
2080 {"HD 7700", CARD_AMD_RADEON_HD7700},
2081 /* Northern Islands */
2082 {"HD 6970", CARD_AMD_RADEON_HD6900},
2083 {"HD 6900", CARD_AMD_RADEON_HD6900},
2084 {"HD 6800", CARD_AMD_RADEON_HD6800},
2085 {"HD 6770M", CARD_AMD_RADEON_HD6600M},
2086 {"HD 6750M", CARD_AMD_RADEON_HD6600M},
2087 {"HD 6700", CARD_AMD_RADEON_HD6700},
2088 {"HD 6670", CARD_AMD_RADEON_HD6600},
2089 {"HD 6630M", CARD_AMD_RADEON_HD6600M},
2090 {"HD 6600M", CARD_AMD_RADEON_HD6600M},
2091 {"HD 6600", CARD_AMD_RADEON_HD6600},
2092 {"HD 6570", CARD_AMD_RADEON_HD6600},
2093 {"HD 6500M", CARD_AMD_RADEON_HD6600M},
2094 {"HD 6500", CARD_AMD_RADEON_HD6600},
2095 {"HD 6480G", CARD_AMD_RADEON_HD6480G},
2096 {"HD 6400", CARD_AMD_RADEON_HD6400},
2097 {"HD 6300", CARD_AMD_RADEON_HD6300},
2098 {"HD 6200", CARD_AMD_RADEON_HD6300},
2099 /* Evergreen */
2100 {"HD 5870", CARD_AMD_RADEON_HD5800}, /* Radeon EG CYPRESS PRO */
2101 {"HD 5850", CARD_AMD_RADEON_HD5800}, /* Radeon EG CYPRESS XT */
2102 {"HD 5800", CARD_AMD_RADEON_HD5800}, /* Radeon EG CYPRESS HD58xx generic renderer string */
2103 {"HD 5770", CARD_AMD_RADEON_HD5700}, /* Radeon EG JUNIPER XT */
2104 {"HD 5750", CARD_AMD_RADEON_HD5700}, /* Radeon EG JUNIPER LE */
2105 {"HD 5700", CARD_AMD_RADEON_HD5700}, /* Radeon EG JUNIPER HD57xx generic renderer string */
2106 {"HD 5670", CARD_AMD_RADEON_HD5600}, /* Radeon EG REDWOOD XT */
2107 {"HD 5570", CARD_AMD_RADEON_HD5600}, /* Radeon EG REDWOOD PRO mapped to HD5600 series */
2108 {"HD 5550", CARD_AMD_RADEON_HD5600}, /* Radeon EG REDWOOD LE mapped to HD5600 series */
2109 {"HD 5450", CARD_AMD_RADEON_HD5400}, /* Radeon EG CEDAR PRO */
2110 {"HD 5000", CARD_AMD_RADEON_HD5600}, /* Defaulting to HD 5600 */
2111 /* R700 */
2112 {"HD 4890", CARD_AMD_RADEON_HD4800}, /* Radeon RV790 */
2113 {"HD 4870", CARD_AMD_RADEON_HD4800}, /* Radeon RV770 */
2114 {"HD 4850", CARD_AMD_RADEON_HD4800}, /* Radeon RV770 */
2115 {"HD 4830", CARD_AMD_RADEON_HD4800}, /* Radeon RV770 */
2116 {"HD 4800", CARD_AMD_RADEON_HD4800}, /* Radeon RV7xx HD48xx generic renderer string */
2117 {"HD 4770", CARD_AMD_RADEON_HD4700}, /* Radeon RV740 */
2118 {"HD 4700", CARD_AMD_RADEON_HD4700}, /* Radeon RV7xx HD47xx generic renderer string */
2119 {"HD 4670", CARD_AMD_RADEON_HD4600}, /* Radeon RV730 */
2120 {"HD 4650", CARD_AMD_RADEON_HD4600}, /* Radeon RV730 */
2121 {"HD 4600", CARD_AMD_RADEON_HD4600}, /* Radeon RV730 */
2122 {"HD 4550", CARD_AMD_RADEON_HD4350}, /* Radeon RV710 */
2123 {"HD 4350", CARD_AMD_RADEON_HD4350}, /* Radeon RV710 */
2124 /* R600/R700 integrated */
2125 {"HD 4200M", CARD_AMD_RADEON_HD4200M},
2126 {"HD 3300", CARD_AMD_RADEON_HD3200},
2127 {"HD 3200", CARD_AMD_RADEON_HD3200},
2128 {"HD 3100", CARD_AMD_RADEON_HD3200},
2129 /* R600 */
2130 {"HD 3870", CARD_AMD_RADEON_HD2900}, /* HD2900/HD3800 - highend */
2131 {"HD 3850", CARD_AMD_RADEON_HD2900}, /* HD2900/HD3800 - highend */
2132 {"HD 2900", CARD_AMD_RADEON_HD2900}, /* HD2900/HD3800 - highend */
2133 {"HD 3830", CARD_AMD_RADEON_HD2600}, /* China-only midend */
2134 {"HD 3690", CARD_AMD_RADEON_HD2600}, /* HD2600/HD3600 - midend */
2135 {"HD 3650", CARD_AMD_RADEON_HD2600}, /* HD2600/HD3600 - midend */
2136 {"HD 2600", CARD_AMD_RADEON_HD2600}, /* HD2600/HD3600 - midend */
2137 {"HD 3470", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */
2138 {"HD 3450", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */
2139 {"HD 3430", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */
2140 {"HD 3400", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */
2141 {"HD 2400", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */
2142 {"HD 2350", CARD_AMD_RADEON_HD2350}, /* HD2350/HD2400/HD3400 - lowend */
2143 /* Radeon R5xx */
2144 {"X1950", CARD_AMD_RADEON_X1600},
2145 {"X1900", CARD_AMD_RADEON_X1600},
2146 {"X1800", CARD_AMD_RADEON_X1600},
2147 {"X1650", CARD_AMD_RADEON_X1600},
2148 {"X1600", CARD_AMD_RADEON_X1600},
2149 /* Radeon R4xx + X1300/X1400/X1450/X1550/X2300/X2500/HD2300 (lowend R5xx)
2150 * Note X2300/X2500/HD2300 are R5xx GPUs with a 2xxx naming but they are still DX9-only */
2151 {"HD 2300", CARD_AMD_RADEON_X700},
2152 {"X2500", CARD_AMD_RADEON_X700},
2153 {"X2300", CARD_AMD_RADEON_X700},
2154 {"X1550", CARD_AMD_RADEON_X700},
2155 {"X1450", CARD_AMD_RADEON_X700},
2156 {"X1400", CARD_AMD_RADEON_X700},
2157 {"X1300", CARD_AMD_RADEON_X700},
2158 {"X850", CARD_AMD_RADEON_X700},
2159 {"X800", CARD_AMD_RADEON_X700},
2160 {"X700", CARD_AMD_RADEON_X700},
2161 /* Radeon Xpress Series - onboard, DX9b, Shader 2.0, 300-400 MHz */
2162 {"Radeon Xpress", CARD_AMD_RADEON_XPRESS_200M},
2164cards_intel[] =
2165{
2166 /* Skylake */
2167 {"Iris Pro Graphics P580", CARD_INTEL_IPP580_1},
2168 {"Skylake", CARD_INTEL_HD520_1},
2169 /* Broadwell */
2170 {"Iris Pro P6300", CARD_INTEL_IPP6300},
2171 {"Iris Pro 6200", CARD_INTEL_IP6200},
2172 {"Iris 6100", CARD_INTEL_I6100},
2173 {"Iris(TM) Graphics 6100", CARD_INTEL_I6100}, /* MacOS */
2174 /* Haswell */
2175 {"Iris Pro 5200", CARD_INTEL_IP5200_1},
2176 {"Iris 5100", CARD_INTEL_I5100_1},
2177 {"HD Graphics 5000", CARD_INTEL_HD5000}, /* MacOS */
2178 {"Haswell Mobile", CARD_INTEL_HWM},
2179 {"Iris OpenGL Engine", CARD_INTEL_HWM}, /* MacOS */
2180 /* Ivybridge */
2181 {"Ivybridge Server", CARD_INTEL_IVBS},
2182 {"Ivybridge Mobile", CARD_INTEL_IVBM},
2183 {"Ivybridge Desktop", CARD_INTEL_IVBD},
2184 {"HD Graphics 4000", CARD_INTEL_IVBD}, /* MacOS */
2185 /* Sandybridge */
2186 {"Sandybridge Server", CARD_INTEL_SNBS},
2187 {"Sandybridge Mobile", CARD_INTEL_SNBM},
2188 {"Sandybridge Desktop", CARD_INTEL_SNBD},
2189 /* Ironlake */
2190 {"Ironlake Mobile", CARD_INTEL_ILKM},
2191 {"Ironlake Desktop", CARD_INTEL_ILKD},
2192 /* G4x */
2193 {"B43", CARD_INTEL_B43},
2194 {"G41", CARD_INTEL_G41},
2195 {"G45", CARD_INTEL_G45},
2196 {"Q45", CARD_INTEL_Q45},
2197 {"Integrated Graphics Device", CARD_INTEL_IGD},
2198 {"GM45", CARD_INTEL_GM45},
2199 /* i965 */
2200 {"965GME", CARD_INTEL_965GME},
2201 {"965GM", CARD_INTEL_965GM},
2202 {"X3100", CARD_INTEL_965GM}, /* MacOS */
2203 {"946GZ", CARD_INTEL_946GZ},
2204 {"965G", CARD_INTEL_965G},
2205 {"965Q", CARD_INTEL_965Q},
2206 /* i945 */
2207 {"Pineview M", CARD_INTEL_PNVM},
2208 {"Pineview G", CARD_INTEL_PNVG},
2209 {"IGD", CARD_INTEL_PNVG},
2210 {"Q33", CARD_INTEL_Q33},
2211 {"G33", CARD_INTEL_G33},
2212 {"Q35", CARD_INTEL_Q35},
2213 {"945GME", CARD_INTEL_945GME},
2214 {"945GM", CARD_INTEL_945GM},
2215 {"GMA 950", CARD_INTEL_945GM}, /* MacOS */
2216 {"945G", CARD_INTEL_945G},
2217 /* i915 */
2218 {"915GM", CARD_INTEL_915GM},
2219 {"E7221G", CARD_INTEL_E7221G},
2220 {"915G", CARD_INTEL_915G},
2221 /* i8xx */
2222 {"865G", CARD_INTEL_865G},
2223 {"845G", CARD_INTEL_845G},
2224 {"855GM", CARD_INTEL_855GM},
2225 {"830M", CARD_INTEL_830M},
2227/* 20101109 - These are never returned by current Gallium radeon
2228 * drivers: R700, RV790, R680, RV535, RV516, R410, RS485, RV360, RV351.
2229 *
2230 * These are returned but not handled: RC410, RV380. */
2232{
2233 /* Polaris 10/11 */
2234 {"POLARIS10", CARD_AMD_RADEON_RX_480},
2235 {"POLARIS11", CARD_AMD_RADEON_RX_460},
2236 /* Volcanic Islands */
2237 {"FIJI", CARD_AMD_RADEON_R9_FURY},
2238 {"TONGA", CARD_AMD_RADEON_R9_285},
2239 /* Sea Islands */
2240 {"HAWAII", CARD_AMD_RADEON_R9_290},
2241 {"KAVERI", CARD_AMD_RADEON_R7 },
2242 {"KABINI", CARD_AMD_RADEON_R3 },
2243 {"BONAIRE", CARD_AMD_RADEON_HD8770},
2244 /* Southern Islands */
2245 {"OLAND", CARD_AMD_RADEON_HD8670},
2246 {"HAINAN", CARD_AMD_RADEON_HD8600M},
2247 {"TAHITI", CARD_AMD_RADEON_HD7900},
2248 {"PITCAIRN", CARD_AMD_RADEON_HD7800},
2249 {"CAPE VERDE", CARD_AMD_RADEON_HD7700},
2250 /* Northern Islands */
2251 {"ARUBA", CARD_AMD_RADEON_HD7660D},
2252 {"CAYMAN", CARD_AMD_RADEON_HD6900},
2253 {"BARTS", CARD_AMD_RADEON_HD6800},
2254 {"TURKS", CARD_AMD_RADEON_HD6600},
2255 {"SUMO2", CARD_AMD_RADEON_HD6410D}, /* SUMO2 first, because we do a strstr(). */
2256 {"SUMO", CARD_AMD_RADEON_HD6550D},
2257 {"CAICOS", CARD_AMD_RADEON_HD6400},
2258 {"PALM", CARD_AMD_RADEON_HD6300},
2259 /* Evergreen */
2260 {"HEMLOCK", CARD_AMD_RADEON_HD5900},
2261 {"CYPRESS", CARD_AMD_RADEON_HD5800},
2262 {"JUNIPER", CARD_AMD_RADEON_HD5700},
2263 {"REDWOOD", CARD_AMD_RADEON_HD5600},
2264 {"CEDAR", CARD_AMD_RADEON_HD5400},
2265 /* R700 */
2266 {"R700", CARD_AMD_RADEON_HD4800},
2267 {"RV790", CARD_AMD_RADEON_HD4800},
2268 {"RV770", CARD_AMD_RADEON_HD4800},
2269 {"RV740", CARD_AMD_RADEON_HD4700},
2270 {"RV730", CARD_AMD_RADEON_HD4600},
2271 {"RV710", CARD_AMD_RADEON_HD4350},
2272 /* R600/R700 integrated */
2273 {"RS880", CARD_AMD_RADEON_HD4200M},
2274 {"RS780", CARD_AMD_RADEON_HD3200},
2275 /* R600 */
2276 {"R680", CARD_AMD_RADEON_HD2900},
2277 {"R600", CARD_AMD_RADEON_HD2900},
2278 {"RV670", CARD_AMD_RADEON_HD3850},
2279 {"RV635", CARD_AMD_RADEON_HD2600},
2280 {"RV630", CARD_AMD_RADEON_HD2600},
2281 {"RV620", CARD_AMD_RADEON_HD2350},
2282 {"RV610", CARD_AMD_RADEON_HD2350},
2283 /* R500 */
2284 {"R580", CARD_AMD_RADEON_X1600},
2285 {"R520", CARD_AMD_RADEON_X1600},
2286 {"RV570", CARD_AMD_RADEON_X1600},
2287 {"RV560", CARD_AMD_RADEON_X1600},
2288 {"RV535", CARD_AMD_RADEON_X1600},
2289 {"RV530", CARD_AMD_RADEON_X1600},
2290 {"RV516", CARD_AMD_RADEON_X700},
2291 {"RV515", CARD_AMD_RADEON_X700},
2292 /* R400 */
2293 {"R481", CARD_AMD_RADEON_X700},
2294 {"R480", CARD_AMD_RADEON_X700},
2295 {"R430", CARD_AMD_RADEON_X700},
2296 {"R423", CARD_AMD_RADEON_X700},
2297 {"R420", CARD_AMD_RADEON_X700},
2298 {"R410", CARD_AMD_RADEON_X700},
2299 {"RV410", CARD_AMD_RADEON_X700},
2300 /* Radeon Xpress - onboard, DX9b, Shader 2.0, 300-400 MHz */
2301 {"RS740", CARD_AMD_RADEON_XPRESS_200M},
2302 {"RS690", CARD_AMD_RADEON_XPRESS_200M},
2303 {"RS600", CARD_AMD_RADEON_XPRESS_200M},
2304 {"RS485", CARD_AMD_RADEON_XPRESS_200M},
2305 {"RS482", CARD_AMD_RADEON_XPRESS_200M},
2306 {"RS480", CARD_AMD_RADEON_XPRESS_200M},
2307 {"RS400", CARD_AMD_RADEON_XPRESS_200M},
2308 /* R300 */
2309 {"R360", CARD_AMD_RADEON_9500},
2310 {"R350", CARD_AMD_RADEON_9500},
2311 {"R300", CARD_AMD_RADEON_9500},
2312 {"RV370", CARD_AMD_RADEON_9500},
2313 {"RV360", CARD_AMD_RADEON_9500},
2314 {"RV351", CARD_AMD_RADEON_9500},
2315 {"RV350", CARD_AMD_RADEON_9500},
2318{
2319 /* Maxwell */
2320 {"NV124", CARD_NVIDIA_GEFORCE_GTX970},
2322 {"NV118", CARD_NVIDIA_GEFORCE_840M},
2323 {"NV117", CARD_NVIDIA_GEFORCE_GTX750},
2324 /* Kepler */
2325 {"NV108", CARD_NVIDIA_GEFORCE_GT740M},
2329 {"NVE4", CARD_NVIDIA_GEFORCE_GTX680}, /* 690 / 675MX / 760TI */
2330 /* Fermi */
2331 {"NVD9", CARD_NVIDIA_GEFORCE_GT520},
2332 {"NVD7", CARD_NVIDIA_GEFORCE_820M},
2337 {"NVC3", CARD_NVIDIA_GEFORCE_GT440},
2338 {"NVC1", CARD_NVIDIA_GEFORCE_GT420},
2340 /* Tesla */
2342 {"NVAC", CARD_NVIDIA_GEFORCE_8200},
2343 {"NVAA", CARD_NVIDIA_GEFORCE_8200}, /* 8100 */
2344 {"NVA8", CARD_NVIDIA_GEFORCE_210},
2345 {"NVA5", CARD_NVIDIA_GEFORCE_GT220},
2346 {"NVA3", CARD_NVIDIA_GEFORCE_GT240},
2348 {"NV98", CARD_NVIDIA_GEFORCE_9200},
2355 /* Curie */
2356 {"NV68", CARD_NVIDIA_GEFORCE_6200}, /* 7050 */
2357 {"NV67", CARD_NVIDIA_GEFORCE_6200}, /* 7000M */
2358 {"NV63", CARD_NVIDIA_GEFORCE_6200}, /* 7100 */
2359 {"NV4E", CARD_NVIDIA_GEFORCE_6200}, /* 6100 Go / 6150 Go */
2360 {"NV4C", CARD_NVIDIA_GEFORCE_6200}, /* 6150SE */
2361 {"NV4B", CARD_NVIDIA_GEFORCE_7600},
2362 {"NV4A", CARD_NVIDIA_GEFORCE_6200},
2363 {"NV49", CARD_NVIDIA_GEFORCE_7800GT}, /* 7900 */
2365 {"NV46", CARD_NVIDIA_GEFORCE_7400},
2366 {"NV45", CARD_NVIDIA_GEFORCE_6800},
2367 {"NV44", CARD_NVIDIA_GEFORCE_6200},
2369 {"NV42", CARD_NVIDIA_GEFORCE_6800},
2370 {"NV41", CARD_NVIDIA_GEFORCE_6800},
2371 {"NV40", CARD_NVIDIA_GEFORCE_6800},
2372 /* Rankine */
2373 {"NV38", CARD_NVIDIA_GEFORCEFX_5800}, /* FX 5950 Ultra */
2374 {"NV36", CARD_NVIDIA_GEFORCEFX_5800}, /* FX 5700/5750 */
2375 {"NV35", CARD_NVIDIA_GEFORCEFX_5800}, /* FX 5900 */
2379 /* Kelvin */
2382 {"nv20", CARD_NVIDIA_GEFORCE3},
2383 /* Celsius */
2384 {"nv1F", CARD_NVIDIA_GEFORCE4_MX}, /* GF4 MX IGP */
2385 {"nv1A", CARD_NVIDIA_GEFORCE2}, /* GF2 IGP */
2386 {"nv18", CARD_NVIDIA_GEFORCE4_MX},
2387 {"nv17", CARD_NVIDIA_GEFORCE4_MX},
2388 {"nv16", CARD_NVIDIA_GEFORCE2},
2389 {"nv15", CARD_NVIDIA_GEFORCE2},
2390 {"nv11", CARD_NVIDIA_GEFORCE2_MX},
2391 {"nv10", CARD_NVIDIA_GEFORCE},
2392 /* Fahrenheit */
2393 {"nv05", CARD_NVIDIA_RIVA_TNT2},
2394 {"nv04", CARD_NVIDIA_RIVA_TNT},
2395 {"nv03", CARD_NVIDIA_RIVA_128},
2397cards_vmware[] =
2398{
2399 {"SVGA3D", CARD_VMWARE_SVGA3D},
2401
2402static const struct gl_vendor_selection
2403{
2405 const char *description; /* Description of the card selector i.e. Apple OS/X Intel */
2406 const struct wined3d_renderer_table *cards; /* To be used as cards[], pointer to the first member in an array */
2407 size_t cards_size; /* Number of entries in the array above */
2408}
2410{
2411 {GL_VENDOR_APPLE, "Apple OSX AMD/ATI binary driver", cards_amd_binary, ARRAY_SIZE(cards_amd_binary)},
2412 {GL_VENDOR_FGLRX, "AMD/ATI binary driver", cards_amd_binary, ARRAY_SIZE(cards_amd_binary)},
2413 {GL_VENDOR_MESA, "Mesa AMD/ATI driver", cards_amd_mesa, ARRAY_SIZE(cards_amd_mesa)},
2416{
2417 {GL_VENDOR_APPLE, "Apple OSX NVidia binary driver", cards_nvidia_binary, ARRAY_SIZE(cards_nvidia_binary)},
2422{
2423 {GL_VENDOR_MESA, "VMware driver", cards_vmware, ARRAY_SIZE(cards_vmware)},
2426{
2427 {GL_VENDOR_APPLE, "Apple OSX Intel binary driver", cards_intel, ARRAY_SIZE(cards_intel)},
2428 {GL_VENDOR_MESA, "Mesa Intel driver", cards_intel, ARRAY_SIZE(cards_intel)},
2430
2431static const enum wined3d_pci_device
2433{
2434 CARD_NVIDIA_RIVA_128, /* D3D5 */
2435 CARD_NVIDIA_RIVA_TNT, /* D3D6 */
2436 CARD_NVIDIA_GEFORCE, /* D3D7 */
2437 CARD_NVIDIA_GEFORCE3, /* D3D8 */
2438 CARD_NVIDIA_GEFORCEFX_5800, /* D3D9_SM2 */
2439 CARD_NVIDIA_GEFORCE_6800, /* D3D9_SM3 */
2440 CARD_NVIDIA_GEFORCE_8800GTX, /* D3D10 */
2441 CARD_NVIDIA_GEFORCE_GTX470, /* D3D11 */
2442},
2444{
2445 CARD_AMD_RAGE_128PRO, /* D3D5 */
2446 CARD_AMD_RAGE_128PRO, /* D3D6 */
2447 CARD_AMD_RADEON_7200, /* D3D7 */
2448 CARD_AMD_RADEON_8500, /* D3D8 */
2449 CARD_AMD_RADEON_9500, /* D3D9_SM2 */
2450 CARD_AMD_RADEON_X1600, /* D3D9_SM3 */
2451 CARD_AMD_RADEON_HD2900, /* D3D10 */
2452 CARD_AMD_RADEON_HD5600, /* D3D11 */
2453},
2455{
2456 CARD_INTEL_845G, /* D3D5 */
2457 CARD_INTEL_845G, /* D3D6 */
2458 CARD_INTEL_845G, /* D3D7 */
2459 CARD_INTEL_915G, /* D3D8 */
2460 CARD_INTEL_915G, /* D3D9_SM2 */
2461 CARD_INTEL_945G, /* D3D9_SM3 */
2462 CARD_INTEL_G45, /* D3D10 */
2463 CARD_INTEL_IVBD, /* D3D11 */
2464};
2468
2470 unsigned int table_size, enum wined3d_gl_vendor gl_vendor, const char *gl_renderer)
2471{
2472 unsigned int i, j;
2473
2474 for (i = 0; i < table_size; ++i)
2475 {
2476 if (table[i].gl_vendor != gl_vendor)
2477 continue;
2478
2479 TRACE("Applying card selector \"%s\".\n", table[i].description);
2480
2481 for (j = 0; j < table[i].cards_size; ++j)
2482 {
2483 if (strstr(gl_renderer, table[i].cards[j].renderer))
2484 return table[i].cards[j].id;
2485 }
2486 return PCI_DEVICE_NONE;
2487 }
2488 FIXME("Couldn't find a suitable card selector for GL vendor %04x (using GL_RENDERER %s)\n",
2489 gl_vendor, debugstr_a(gl_renderer));
2490
2491 return PCI_DEVICE_NONE;
2492}
2493
2494static const struct
2495{
2497 const char *description; /* Description of the card selector i.e. Apple OS/X Intel */
2499 unsigned int gl_vendor_count;
2500 const enum wined3d_pci_device *card_fallback; /* An array with D3D_LEVEL_COUNT elements */
2501}
2503{
2517
2518
2520 DWORD glsl_version, const char *gl_renderer, enum wined3d_gl_vendor *gl_vendor, enum wined3d_pci_vendor *card_vendor)
2521{
2522 /* A Direct3D device object contains the PCI id (vendor + device) of the
2523 * videocard which is used for rendering. Various applications use this
2524 * information to get a rough estimation of the features of the card and
2525 * some might use it for enabling 3d effects only on certain types of
2526 * videocards. In some cases games might even use it to work around bugs
2527 * which happen on certain videocards/driver combinations. The problem is
2528 * that OpenGL only exposes a rendering string containing the name of the
2529 * videocard and not the PCI id.
2530 *
2531 * Various games depend on the PCI id, so somehow we need to provide one.
2532 * A simple option is to parse the renderer string and translate this to
2533 * the right PCI id. This is a lot of work because there are more than 200
2534 * GPUs just for Nvidia. Various cards share the same renderer string, so
2535 * the amount of code might be 'small' but there are quite a number of
2536 * exceptions which would make this a pain to maintain. Another way would
2537 * be to query the PCI id from the operating system (assuming this is the
2538 * videocard which is used for rendering which is not always the case).
2539 * This would work but it is not very portable. Second it would not work
2540 * well in, let's say, a remote X situation in which the amount of 3d
2541 * features which can be used is limited.
2542 *
2543 * As said most games only use the PCI id to get an indication of the
2544 * capabilities of the card. It doesn't really matter if the given id is
2545 * the correct one if we return the id of a card with similar 3d features.
2546 *
2547 * The code below checks the OpenGL capabilities of a videocard and matches
2548 * that to a certain level of Direct3D functionality. Once a card passes
2549 * the Direct3D9 check, we know that the card (in case of Nvidia) is at
2550 * least a GeforceFX. To give a better estimate we do a basic check on the
2551 * renderer string but if that won't pass we return a default card. This
2552 * way is better than maintaining a full card database as even without a
2553 * full database we can return a card with similar features. Second the
2554 * size of the database can be made quite small because when you know what
2555 * type of 3d functionality a card has, you know to which GPU family the
2556 * GPU must belong. Because of this you only have to check a small part of
2557 * the renderer string to distinguish between different models from that
2558 * family.
2559 *
2560 * The code also selects a default amount of video memory which we will
2561 * use for an estimation of the amount of free texture memory. In case of
2562 * real D3D the amount of texture memory includes video memory and system
2563 * memory (to be specific AGP memory or in case of PCIE TurboCache /
2564 * HyperMemory). We don't know how much system memory can be addressed by
2565 * the system but we can make a reasonable estimation about the amount of
2566 * video memory. If the value is slightly wrong it doesn't matter as we
2567 * didn't include AGP-like memory which makes the amount of addressable
2568 * memory higher and second OpenGL isn't that critical it moves to system
2569 * memory behind our backs if really needed. Note that the amount of video
2570 * memory can be overruled using a registry setting. */
2571
2572 unsigned int i;
2573 enum wined3d_d3d_level d3d_level = d3d_level_from_caps(shader_caps, fragment_caps, glsl_version);
2575
2576 for (i = 0; i < ARRAY_SIZE(card_vendor_table); ++i)
2577 {
2579 continue;
2580
2581 TRACE("Applying card selector \"%s\".\n", card_vendor_table[i].description);
2584 if (device != PCI_DEVICE_NONE)
2585 return device;
2586
2587 TRACE("Unrecognized renderer %s, falling back to default.\n", debugstr_a(gl_renderer));
2588 return card_vendor_table[i].card_fallback[d3d_level];
2589 }
2590
2591 FIXME("No card selector available for card vendor %04x (using GL_RENDERER %s).\n",
2592 *card_vendor, debugstr_a(gl_renderer));
2593
2594 /* Default to generic Nvidia hardware based on the supported OpenGL extensions. */
2596 return card_fallback_nvidia[d3d_level];
2597}
2598
2600 const struct wined3d_shader_backend_ops *shader_backend_ops)
2601{
2602 if (shader_backend_ops == &glsl_shader_backend && gl_info->supported[ARB_VERTEX_SHADER])
2603 return &glsl_vertex_pipe;
2604 return &ffp_vertex_pipe;
2605}
2606
2607static const struct fragment_pipeline *select_fragment_implementation(const struct wined3d_gl_info *gl_info,
2608 const struct wined3d_shader_backend_ops *shader_backend_ops)
2609{
2610 if (shader_backend_ops == &glsl_shader_backend && gl_info->supported[ARB_FRAGMENT_SHADER])
2611 return &glsl_fragment_pipe;
2612 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
2614 if (gl_info->supported[ATI_FRAGMENT_SHADER])
2617 return &nvts_fragment_pipeline;
2618 if (gl_info->supported[NV_REGISTER_COMBINERS])
2619 return &nvrc_fragment_pipeline;
2620 return &ffp_fragment_pipeline;
2621}
2622
2623static const struct wined3d_shader_backend_ops *select_shader_backend(const struct wined3d_gl_info *gl_info)
2624{
2626
2627 if (glsl && gl_info->supported[ARB_VERTEX_SHADER] && gl_info->supported[ARB_FRAGMENT_SHADER])
2628 return &glsl_shader_backend;
2631 if (glsl && (gl_info->supported[ARB_VERTEX_SHADER] || gl_info->supported[ARB_FRAGMENT_SHADER]))
2632 return &glsl_shader_backend;
2635 return &none_shader_backend;
2636}
2637
2638static void parse_extension_string(struct wined3d_gl_info *gl_info, const char *extensions,
2639 const struct wined3d_extension_map *map, UINT entry_count)
2640{
2641 while (*extensions)
2642 {
2643 const char *start;
2644 size_t len;
2645 UINT i;
2646
2647 while (isspace(*extensions))
2648 ++extensions;
2649 start = extensions;
2650 while (!isspace(*extensions) && *extensions)
2651 ++extensions;
2652
2653 len = extensions - start;
2654 if (!len)
2655 continue;
2656
2657 TRACE("- %s.\n", debugstr_an(start, len));
2658
2659 for (i = 0; i < entry_count; ++i)
2660 {
2661 if (len == strlen(map[i].extension_string)
2662 && !memcmp(start, map[i].extension_string, len))
2663 {
2664 TRACE(" FOUND: %s support.\n", map[i].extension_string);
2665 gl_info->supported[map[i].extension] = TRUE;
2666 break;
2667 }
2668 }
2669 }
2670}
2671
2672static void enumerate_gl_extensions(struct wined3d_gl_info *gl_info,
2673 const struct wined3d_extension_map *map, unsigned int map_entries_count)
2674{
2675 const char *gl_extension_name;
2676 unsigned int i, j;
2677 GLint extensions_count;
2678
2679 gl_info->gl_ops.gl.p_glGetIntegerv(GL_NUM_EXTENSIONS, &extensions_count);
2680 for (i = 0; i < extensions_count; ++i)
2681 {
2682 gl_extension_name = (const char *)GL_EXTCALL(glGetStringi(GL_EXTENSIONS, i));
2683 TRACE("- %s.\n", debugstr_a(gl_extension_name));
2684 for (j = 0; j < map_entries_count; ++j)
2685 {
2686 if (!strcmp(gl_extension_name, map[j].extension_string))
2687 {
2688 TRACE("FOUND: %s support.\n", map[j].extension_string);
2689 gl_info->supported[map[j].extension] = TRUE;
2690 break;
2691 }
2692 }
2693 }
2694}
2695
2696static void load_gl_funcs(struct wined3d_gl_info *gl_info)
2697{
2698#define USE_GL_FUNC(pfn) gl_info->gl_ops.ext.p_##pfn = (void *)wglGetProcAddress(#pfn);
2699 /* GL_APPLE_fence */
2700 USE_GL_FUNC(glDeleteFencesAPPLE)
2701 USE_GL_FUNC(glFinishFenceAPPLE)
2702 USE_GL_FUNC(glFinishObjectAPPLE)
2703 USE_GL_FUNC(glGenFencesAPPLE)
2704 USE_GL_FUNC(glIsFenceAPPLE)
2705 USE_GL_FUNC(glSetFenceAPPLE)
2706 USE_GL_FUNC(glTestFenceAPPLE)
2707 USE_GL_FUNC(glTestObjectAPPLE)
2708 /* GL_APPLE_flush_buffer_range */
2709 USE_GL_FUNC(glBufferParameteriAPPLE)
2710 USE_GL_FUNC(glFlushMappedBufferRangeAPPLE)
2711 /* GL_ARB_base_instance */
2712 USE_GL_FUNC(glDrawArraysInstancedBaseInstance)
2713 USE_GL_FUNC(glDrawElementsInstancedBaseVertexBaseInstance)
2714 /* GL_ARB_blend_func_extended */
2715 USE_GL_FUNC(glBindFragDataLocationIndexed)
2716 USE_GL_FUNC(glGetFragDataIndex)
2717 /* GL_ARB_clear_buffer_object */
2718 USE_GL_FUNC(glClearBufferData)
2719 USE_GL_FUNC(glClearBufferSubData)
2720 /* GL_ARB_clear_texture */
2721 USE_GL_FUNC(glClearTexImage)
2722 USE_GL_FUNC(glClearTexSubImage)
2723 /* GL_ARB_clip_control */
2724 USE_GL_FUNC(glClipControl)
2725 /* GL_ARB_color_buffer_float */
2726 USE_GL_FUNC(glClampColorARB)
2727 /* GL_ARB_compute_shader */
2728 USE_GL_FUNC(glDispatchCompute)
2729 USE_GL_FUNC(glDispatchComputeIndirect)
2730 /* GL_ARB_copy_buffer */
2731 USE_GL_FUNC(glCopyBufferSubData)
2732 /* GL_ARB_copy_image */
2733 USE_GL_FUNC(glCopyImageSubData)
2734 /* GL_ARB_debug_output */
2735 USE_GL_FUNC(glDebugMessageCallbackARB)
2736 USE_GL_FUNC(glDebugMessageControlARB)
2737 USE_GL_FUNC(glDebugMessageInsertARB)
2738 USE_GL_FUNC(glGetDebugMessageLogARB)
2739 /* GL_ARB_draw_buffers */
2740 USE_GL_FUNC(glDrawBuffersARB)
2741 /* GL_ARB_draw_elements_base_vertex */
2742 USE_GL_FUNC(glDrawElementsBaseVertex)
2743 USE_GL_FUNC(glDrawElementsInstancedBaseVertex)
2744 USE_GL_FUNC(glDrawRangeElementsBaseVertex)
2745 USE_GL_FUNC(glMultiDrawElementsBaseVertex)
2746 /* GL_ARB_draw_indirect */
2747 USE_GL_FUNC(glDrawArraysIndirect)
2748 USE_GL_FUNC(glDrawElementsIndirect)
2749 /* GL_ARB_draw_instanced */
2750 USE_GL_FUNC(glDrawArraysInstancedARB)
2751 USE_GL_FUNC(glDrawElementsInstancedARB)
2752 /* GL_ARB_ES2_compatibility */
2753 USE_GL_FUNC(glReleaseShaderCompiler)
2754 USE_GL_FUNC(glShaderBinary)
2755 USE_GL_FUNC(glGetShaderPrecisionFormat)
2756 USE_GL_FUNC(glDepthRangef)
2757 USE_GL_FUNC(glClearDepthf)
2758 /* GL_ARB_framebuffer_no_attachments */
2759 USE_GL_FUNC(glFramebufferParameteri)
2760 /* GL_ARB_framebuffer_object */
2761 USE_GL_FUNC(glBindFramebuffer)
2762 USE_GL_FUNC(glBindRenderbuffer)
2763 USE_GL_FUNC(glBlitFramebuffer)
2764 USE_GL_FUNC(glCheckFramebufferStatus)
2765 USE_GL_FUNC(glDeleteFramebuffers)
2766 USE_GL_FUNC(glDeleteRenderbuffers)
2767 USE_GL_FUNC(glFramebufferRenderbuffer)
2768 USE_GL_FUNC(glFramebufferTexture)
2769 USE_GL_FUNC(glFramebufferTexture1D)
2770 USE_GL_FUNC(glFramebufferTexture2D)
2771 USE_GL_FUNC(glFramebufferTexture3D)
2772 USE_GL_FUNC(glFramebufferTextureLayer)
2773 USE_GL_FUNC(glGenFramebuffers)
2774 USE_GL_FUNC(glGenRenderbuffers)
2775 USE_GL_FUNC(glGenerateMipmap)
2776 USE_GL_FUNC(glGetFramebufferAttachmentParameteriv)
2777 USE_GL_FUNC(glGetRenderbufferParameteriv)
2778 USE_GL_FUNC(glIsFramebuffer)
2779 USE_GL_FUNC(glIsRenderbuffer)
2780 USE_GL_FUNC(glRenderbufferStorage)
2781 USE_GL_FUNC(glRenderbufferStorageMultisample)
2782 /* GL_ARB_geometry_shader4 */
2783 USE_GL_FUNC(glFramebufferTextureARB)
2784 USE_GL_FUNC(glFramebufferTextureFaceARB)
2785 USE_GL_FUNC(glFramebufferTextureLayerARB)
2786 USE_GL_FUNC(glProgramParameteriARB)
2787 /* GL_ARB_instanced_arrays */
2788 USE_GL_FUNC(glVertexAttribDivisorARB)
2789 /* GL_ARB_internalformat_query */
2790 USE_GL_FUNC(glGetInternalformativ)
2791 /* GL_ARB_internalformat_query2 */
2792 USE_GL_FUNC(glGetInternalformati64v)
2793 /* GL_ARB_map_buffer_range */
2794 USE_GL_FUNC(glFlushMappedBufferRange)
2795 USE_GL_FUNC(glMapBufferRange)
2796 /* GL_ARB_multisample */
2797 USE_GL_FUNC(glSampleCoverageARB)
2798 /* GL_ARB_multitexture */
2811 /* GL_ARB_occlusion_query */
2812 USE_GL_FUNC(glBeginQueryARB)
2813 USE_GL_FUNC(glDeleteQueriesARB)
2814 USE_GL_FUNC(glEndQueryARB)
2815 USE_GL_FUNC(glGenQueriesARB)
2816 USE_GL_FUNC(glGetQueryivARB)
2817 USE_GL_FUNC(glGetQueryObjectivARB)
2818 USE_GL_FUNC(glGetQueryObjectuivARB)
2819 USE_GL_FUNC(glIsQueryARB)
2820 /* GL_ARB_point_parameters */
2821 USE_GL_FUNC(glPointParameterfARB)
2822 USE_GL_FUNC(glPointParameterfvARB)
2823 /* GL_ARB_provoking_vertex */
2824 USE_GL_FUNC(glProvokingVertex)
2825 /* GL_ARB_sampler_objects */
2826 USE_GL_FUNC(glGenSamplers)
2827 USE_GL_FUNC(glDeleteSamplers)
2828 USE_GL_FUNC(glIsSampler)
2829 USE_GL_FUNC(glBindSampler)
2830 USE_GL_FUNC(glSamplerParameteri)
2831 USE_GL_FUNC(glSamplerParameterf)
2832 USE_GL_FUNC(glSamplerParameteriv)
2833 USE_GL_FUNC(glSamplerParameterfv)
2834 USE_GL_FUNC(glSamplerParameterIiv)
2835 USE_GL_FUNC(glSamplerParameterIuiv)
2836 USE_GL_FUNC(glGetSamplerParameteriv)
2837 USE_GL_FUNC(glGetSamplerParameterfv)
2838 USE_GL_FUNC(glGetSamplerParameterIiv)
2839 USE_GL_FUNC(glGetSamplerParameterIuiv)
2840 /* GL_ARB_shader_atomic_counters */
2841 USE_GL_FUNC(glGetActiveAtomicCounterBufferiv)
2842 /* GL_ARB_shader_image_load_store */
2843 USE_GL_FUNC(glBindImageTexture)
2844 USE_GL_FUNC(glMemoryBarrier)
2845 /* GL_ARB_shader_objects */
2846 USE_GL_FUNC(glAttachObjectARB)
2847 USE_GL_FUNC(glBindAttribLocationARB)
2848 USE_GL_FUNC(glCompileShaderARB)
2849 USE_GL_FUNC(glCreateProgramObjectARB)
2850 USE_GL_FUNC(glCreateShaderObjectARB)
2851 USE_GL_FUNC(glDeleteObjectARB)
2852 USE_GL_FUNC(glDetachObjectARB)
2853 USE_GL_FUNC(glGetActiveUniformARB)
2854 USE_GL_FUNC(glGetAttachedObjectsARB)
2855 USE_GL_FUNC(glGetAttribLocationARB)
2856 USE_GL_FUNC(glGetHandleARB)
2857 USE_GL_FUNC(glGetInfoLogARB)
2858 USE_GL_FUNC(glGetObjectParameterfvARB)
2859 USE_GL_FUNC(glGetObjectParameterivARB)
2860 USE_GL_FUNC(glGetShaderSourceARB)
2861 USE_GL_FUNC(glGetUniformLocationARB)
2862 USE_GL_FUNC(glGetUniformfvARB)
2863 USE_GL_FUNC(glGetUniformivARB)
2864 USE_GL_FUNC(glLinkProgramARB)
2865 USE_GL_FUNC(glShaderSourceARB)
2866 USE_GL_FUNC(glUniform1fARB)
2867 USE_GL_FUNC(glUniform1fvARB)
2868 USE_GL_FUNC(glUniform1iARB)
2869 USE_GL_FUNC(glUniform1ivARB)
2870 USE_GL_FUNC(glUniform2fARB)
2871 USE_GL_FUNC(glUniform2fvARB)
2872 USE_GL_FUNC(glUniform2iARB)
2873 USE_GL_FUNC(glUniform2ivARB)
2874 USE_GL_FUNC(glUniform3fARB)
2875 USE_GL_FUNC(glUniform3fvARB)
2876 USE_GL_FUNC(glUniform3iARB)
2877 USE_GL_FUNC(glUniform3ivARB)
2878 USE_GL_FUNC(glUniform4fARB)
2879 USE_GL_FUNC(glUniform4fvARB)
2880 USE_GL_FUNC(glUniform4iARB)
2881 USE_GL_FUNC(glUniform4ivARB)
2882 USE_GL_FUNC(glUniformMatrix2fvARB)
2883 USE_GL_FUNC(glUniformMatrix3fvARB)
2884 USE_GL_FUNC(glUniformMatrix4fvARB)
2885 USE_GL_FUNC(glUseProgramObjectARB)
2886 USE_GL_FUNC(glValidateProgramARB)
2887 /* GL_ARB_shader_storage_buffer_object */
2888 USE_GL_FUNC(glShaderStorageBlockBinding)
2889 /* GL_ARB_sync */
2890 USE_GL_FUNC(glClientWaitSync)
2891 USE_GL_FUNC(glDeleteSync)
2892 USE_GL_FUNC(glFenceSync)
2893 USE_GL_FUNC(glGetInteger64v)
2894 USE_GL_FUNC(glGetSynciv)
2895 USE_GL_FUNC(glIsSync)
2896 USE_GL_FUNC(glWaitSync)
2897 /* GL_ARB_tessellation_shader */
2898 USE_GL_FUNC(glPatchParameteri)
2899 USE_GL_FUNC(glPatchParameterfv)
2900 /* GL_ARB_texture_buffer_object */
2901 USE_GL_FUNC(glTexBufferARB)
2902 /* GL_ARB_texture_buffer_range */
2903 USE_GL_FUNC(glTexBufferRange)
2904 /* GL_ARB_texture_compression */
2905 USE_GL_FUNC(glCompressedTexImage2DARB)
2906 USE_GL_FUNC(glCompressedTexImage3DARB)
2907 USE_GL_FUNC(glCompressedTexSubImage2DARB)
2908 USE_GL_FUNC(glCompressedTexSubImage3DARB)
2909 USE_GL_FUNC(glGetCompressedTexImageARB)
2910 /* GL_ARB_texture_multisample */
2911 USE_GL_FUNC(glGetMultisamplefv);
2912 USE_GL_FUNC(glSampleMaski);
2913 USE_GL_FUNC(glTexImage2DMultisample);
2914 USE_GL_FUNC(glTexImage3DMultisample);
2915 /* GL_ARB_texture_storage */
2916 USE_GL_FUNC(glTexStorage1D)
2917 USE_GL_FUNC(glTexStorage2D)
2918 USE_GL_FUNC(glTexStorage3D)
2919 /* GL_ARB_texture_storage_multisample */
2920 USE_GL_FUNC(glTexStorage2DMultisample);
2921 USE_GL_FUNC(glTexStorage3DMultisample);
2922 /* GL_ARB_texture_view */
2923 USE_GL_FUNC(glTextureView)
2924 /* GL_ARB_timer_query */
2925 USE_GL_FUNC(glQueryCounter)
2926 USE_GL_FUNC(glGetQueryObjectui64v)
2927 /* GL_ARB_transform_feedback2 */
2928 USE_GL_FUNC(glBindTransformFeedback);
2929 USE_GL_FUNC(glDeleteTransformFeedbacks);
2930 USE_GL_FUNC(glDrawTransformFeedback);
2931 USE_GL_FUNC(glGenTransformFeedbacks);
2932 USE_GL_FUNC(glIsTransformFeedback);
2933 USE_GL_FUNC(glPauseTransformFeedback);
2934 USE_GL_FUNC(glResumeTransformFeedback);
2935 /* GL_ARB_transform_feedback3 */
2936 USE_GL_FUNC(glBeginQueryIndexed);
2937 USE_GL_FUNC(glDrawTransformFeedbackStream);
2938 USE_GL_FUNC(glEndQueryIndexed);
2939 USE_GL_FUNC(glGetQueryIndexediv);
2940 /* GL_ARB_uniform_buffer_object */
2941 USE_GL_FUNC(glBindBufferBase)
2942 USE_GL_FUNC(glBindBufferRange)
2943 USE_GL_FUNC(glGetActiveUniformBlockName)
2944 USE_GL_FUNC(glGetActiveUniformBlockiv)
2945 USE_GL_FUNC(glGetActiveUniformName)
2946 USE_GL_FUNC(glGetActiveUniformsiv)
2947 USE_GL_FUNC(glGetIntegeri_v)
2948 USE_GL_FUNC(glGetUniformBlockIndex)
2949 USE_GL_FUNC(glGetUniformIndices)
2950 USE_GL_FUNC(glUniformBlockBinding)
2951 /* GL_ARB_vertex_blend */
2952 USE_GL_FUNC(glVertexBlendARB)
2953 USE_GL_FUNC(glWeightPointerARB)
2954 USE_GL_FUNC(glWeightbvARB)
2955 USE_GL_FUNC(glWeightdvARB)
2956 USE_GL_FUNC(glWeightfvARB)
2957 USE_GL_FUNC(glWeightivARB)
2958 USE_GL_FUNC(glWeightsvARB)
2959 USE_GL_FUNC(glWeightubvARB)
2960 USE_GL_FUNC(glWeightuivARB)
2961 USE_GL_FUNC(glWeightusvARB)
2962 /* GL_ARB_vertex_buffer_object */
2963 USE_GL_FUNC(glBindBufferARB)
2964 USE_GL_FUNC(glBufferDataARB)
2965 USE_GL_FUNC(glBufferSubDataARB)
2966 USE_GL_FUNC(glDeleteBuffersARB)
2967 USE_GL_FUNC(glGenBuffersARB)
2968 USE_GL_FUNC(glGetBufferParameterivARB)
2969 USE_GL_FUNC(glGetBufferPointervARB)
2970 USE_GL_FUNC(glGetBufferSubDataARB)
2971 USE_GL_FUNC(glIsBufferARB)
2972 USE_GL_FUNC(glMapBufferARB)
2973 USE_GL_FUNC(glUnmapBufferARB)
2974 /* GL_ARB_vertex_program */
2975 USE_GL_FUNC(glBindProgramARB)
2976 USE_GL_FUNC(glDeleteProgramsARB)
2977 USE_GL_FUNC(glDisableVertexAttribArrayARB)
2978 USE_GL_FUNC(glEnableVertexAttribArrayARB)
2979 USE_GL_FUNC(glGenProgramsARB)
2980 USE_GL_FUNC(glGetProgramivARB)
2981 USE_GL_FUNC(glProgramEnvParameter4fvARB)
2982 USE_GL_FUNC(glProgramLocalParameter4fvARB)
2983 USE_GL_FUNC(glProgramStringARB)
2984 USE_GL_FUNC(glVertexAttrib1dARB)
2985 USE_GL_FUNC(glVertexAttrib1dvARB)
2986 USE_GL_FUNC(glVertexAttrib1fARB)
2987 USE_GL_FUNC(glVertexAttrib1fvARB)
2988 USE_GL_FUNC(glVertexAttrib1sARB)
2989 USE_GL_FUNC(glVertexAttrib1svARB)
2990 USE_GL_FUNC(glVertexAttrib2dARB)
2991 USE_GL_FUNC(glVertexAttrib2dvARB)
2992 USE_GL_FUNC(glVertexAttrib2fARB)
2993 USE_GL_FUNC(glVertexAttrib2fvARB)
2994 USE_GL_FUNC(glVertexAttrib2sARB)
2995 USE_GL_FUNC(glVertexAttrib2svARB)
2996 USE_GL_FUNC(glVertexAttrib3dARB)
2997 USE_GL_FUNC(glVertexAttrib3dvARB)
2998 USE_GL_FUNC(glVertexAttrib3fARB)
2999 USE_GL_FUNC(glVertexAttrib3fvARB)
3000 USE_GL_FUNC(glVertexAttrib3sARB)
3001 USE_GL_FUNC(glVertexAttrib3svARB)
3002 USE_GL_FUNC(glVertexAttrib4NbvARB)
3003 USE_GL_FUNC(glVertexAttrib4NivARB)
3004 USE_GL_FUNC(glVertexAttrib4NsvARB)
3005 USE_GL_FUNC(glVertexAttrib4NubARB)
3006 USE_GL_FUNC(glVertexAttrib4NubvARB)
3007 USE_GL_FUNC(glVertexAttrib4NuivARB)
3008 USE_GL_FUNC(glVertexAttrib4NusvARB)
3009 USE_GL_FUNC(glVertexAttrib4bvARB)
3010 USE_GL_FUNC(glVertexAttrib4dARB)
3011 USE_GL_FUNC(glVertexAttrib4dvARB)
3012 USE_GL_FUNC(glVertexAttrib4fARB)
3013 USE_GL_FUNC(glVertexAttrib4fvARB)
3014 USE_GL_FUNC(glVertexAttrib4ivARB)
3015 USE_GL_FUNC(glVertexAttrib4sARB)
3016 USE_GL_FUNC(glVertexAttrib4svARB)
3017 USE_GL_FUNC(glVertexAttrib4ubvARB)
3018 USE_GL_FUNC(glVertexAttrib4uivARB)
3019 USE_GL_FUNC(glVertexAttrib4usvARB)
3020 USE_GL_FUNC(glVertexAttribPointerARB)
3021 /* GL_ARB_viewport_array */
3022 USE_GL_FUNC(glDepthRangeArrayv)
3023 USE_GL_FUNC(glDepthRangeIndexed)
3024 USE_GL_FUNC(glGetDoublei_v)
3025 USE_GL_FUNC(glGetFloati_v)
3026 USE_GL_FUNC(glScissorArrayv)
3027 USE_GL_FUNC(glScissorIndexed)
3028 USE_GL_FUNC(glScissorIndexedv)
3029 USE_GL_FUNC(glViewportArrayv)
3030 USE_GL_FUNC(glViewportIndexedf)
3031 USE_GL_FUNC(glViewportIndexedfv)
3032 /* GL_ATI_fragment_shader */
3033 USE_GL_FUNC(glAlphaFragmentOp1ATI)
3034 USE_GL_FUNC(glAlphaFragmentOp2ATI)
3035 USE_GL_FUNC(glAlphaFragmentOp3ATI)
3036 USE_GL_FUNC(glBeginFragmentShaderATI)
3037 USE_GL_FUNC(glBindFragmentShaderATI)
3038 USE_GL_FUNC(glColorFragmentOp1ATI)
3039 USE_GL_FUNC(glColorFragmentOp2ATI)
3040 USE_GL_FUNC(glColorFragmentOp3ATI)
3041 USE_GL_FUNC(glDeleteFragmentShaderATI)
3042 USE_GL_FUNC(glEndFragmentShaderATI)
3043 USE_GL_FUNC(glGenFragmentShadersATI)
3044 USE_GL_FUNC(glPassTexCoordATI)
3045 USE_GL_FUNC(glSampleMapATI)
3046 USE_GL_FUNC(glSetFragmentShaderConstantATI)
3047 /* GL_ATI_separate_stencil */
3048 USE_GL_FUNC(glStencilOpSeparateATI)
3049 USE_GL_FUNC(glStencilFuncSeparateATI)
3050 /* GL_EXT_blend_color */
3051 USE_GL_FUNC(glBlendColorEXT)
3052 /* GL_EXT_blend_equation_separate */
3053 USE_GL_FUNC(glBlendFuncSeparateEXT)
3054 /* GL_EXT_blend_func_separate */
3055 USE_GL_FUNC(glBlendEquationSeparateEXT)
3056 /* GL_EXT_blend_minmax */
3057 USE_GL_FUNC(glBlendEquationEXT)
3058 /* GL_EXT_depth_bounds_test */
3059 USE_GL_FUNC(glDepthBoundsEXT)
3060 /* GL_EXT_draw_buffers2 */
3061 USE_GL_FUNC(glColorMaskIndexedEXT)
3062 USE_GL_FUNC(glDisableIndexedEXT)
3063 USE_GL_FUNC(glEnableIndexedEXT)
3064 USE_GL_FUNC(glGetBooleanIndexedvEXT)
3065 USE_GL_FUNC(glGetIntegerIndexedvEXT)
3066 USE_GL_FUNC(glIsEnabledIndexedEXT)
3067 /* GL_EXT_fog_coord */
3068 USE_GL_FUNC(glFogCoordPointerEXT)
3069 USE_GL_FUNC(glFogCoorddEXT)
3070 USE_GL_FUNC(glFogCoorddvEXT)
3071 USE_GL_FUNC(glFogCoordfEXT)
3072 USE_GL_FUNC(glFogCoordfvEXT)
3073 /* GL_EXT_framebuffer_blit */
3074 USE_GL_FUNC(glBlitFramebufferEXT)
3075 /* GL_EXT_framebuffer_multisample */
3076 USE_GL_FUNC(glRenderbufferStorageMultisampleEXT)
3077 /* GL_EXT_framebuffer_object */
3078 USE_GL_FUNC(glBindFramebufferEXT)
3079 USE_GL_FUNC(glBindRenderbufferEXT)
3080 USE_GL_FUNC(glCheckFramebufferStatusEXT)
3081 USE_GL_FUNC(glDeleteFramebuffersEXT)
3082 USE_GL_FUNC(glDeleteRenderbuffersEXT)
3083 USE_GL_FUNC(glFramebufferRenderbufferEXT)
3084 USE_GL_FUNC(glFramebufferTexture1DEXT)
3085 USE_GL_FUNC(glFramebufferTexture2DEXT)
3086 USE_GL_FUNC(glFramebufferTexture3DEXT)
3087 USE_GL_FUNC(glGenFramebuffersEXT)
3088 USE_GL_FUNC(glGenRenderbuffersEXT)
3089 USE_GL_FUNC(glGenerateMipmapEXT)
3090 USE_GL_FUNC(glGetFramebufferAttachmentParameterivEXT)
3091 USE_GL_FUNC(glGetRenderbufferParameterivEXT)
3092 USE_GL_FUNC(glIsFramebufferEXT)
3093 USE_GL_FUNC(glIsRenderbufferEXT)
3094 USE_GL_FUNC(glRenderbufferStorageEXT)
3095 /* GL_EXT_gpu_program_parameters */
3096 USE_GL_FUNC(glProgramEnvParameters4fvEXT)
3097 USE_GL_FUNC(glProgramLocalParameters4fvEXT)
3098 /* GL_EXT_gpu_shader4 */
3099 USE_GL_FUNC(glBindFragDataLocationEXT)
3100 USE_GL_FUNC(glGetFragDataLocationEXT)
3101 USE_GL_FUNC(glGetUniformuivEXT)
3102 USE_GL_FUNC(glGetVertexAttribIivEXT)
3103 USE_GL_FUNC(glGetVertexAttribIuivEXT)
3104 USE_GL_FUNC(glUniform1uiEXT)
3105 USE_GL_FUNC(glUniform1uivEXT)
3106 USE_GL_FUNC(glUniform2uiEXT)
3107 USE_GL_FUNC(glUniform2uivEXT)
3108 USE_GL_FUNC(glUniform3uiEXT)
3109 USE_GL_FUNC(glUniform3uivEXT)
3110 USE_GL_FUNC(glUniform4uiEXT)
3111 USE_GL_FUNC(glUniform4uivEXT)
3112 USE_GL_FUNC(glVertexAttribI1iEXT)
3113 USE_GL_FUNC(glVertexAttribI1ivEXT)
3114 USE_GL_FUNC(glVertexAttribI1uiEXT)
3115 USE_GL_FUNC(glVertexAttribI1uivEXT)
3116 USE_GL_FUNC(glVertexAttribI2iEXT)
3117 USE_GL_FUNC(glVertexAttribI2ivEXT)
3118 USE_GL_FUNC(glVertexAttribI2uiEXT)
3119 USE_GL_FUNC(glVertexAttribI2uivEXT)
3120 USE_GL_FUNC(glVertexAttribI3iEXT)
3121 USE_GL_FUNC(glVertexAttribI3ivEXT)
3122 USE_GL_FUNC(glVertexAttribI3uiEXT)
3123 USE_GL_FUNC(glVertexAttribI3uivEXT)
3124 USE_GL_FUNC(glVertexAttribI4bvEXT)
3125 USE_GL_FUNC(glVertexAttribI4iEXT)
3126 USE_GL_FUNC(glVertexAttribI4ivEXT)
3127 USE_GL_FUNC(glVertexAttribI4svEXT)
3128 USE_GL_FUNC(glVertexAttribI4ubvEXT)
3129 USE_GL_FUNC(glVertexAttribI4uiEXT)
3130 USE_GL_FUNC(glVertexAttribI4uivEXT)
3131 USE_GL_FUNC(glVertexAttribI4usvEXT)
3132 USE_GL_FUNC(glVertexAttribIPointerEXT)
3133 /* GL_EXT_point_parameters */
3134 USE_GL_FUNC(glPointParameterfEXT)
3135 USE_GL_FUNC(glPointParameterfvEXT)
3136 /* GL_EXT_polygon_offset_clamp */
3137 USE_GL_FUNC(glPolygonOffsetClampEXT)
3138 /* GL_EXT_provoking_vertex */
3139 USE_GL_FUNC(glProvokingVertexEXT)
3140 /* GL_EXT_secondary_color */
3141 USE_GL_FUNC(glSecondaryColor3fEXT)
3142 USE_GL_FUNC(glSecondaryColor3fvEXT)
3143 USE_GL_FUNC(glSecondaryColor3ubEXT)
3144 USE_GL_FUNC(glSecondaryColor3ubvEXT)
3145 USE_GL_FUNC(glSecondaryColorPointerEXT)
3146 /* GL_EXT_stencil_two_side */
3147 USE_GL_FUNC(glActiveStencilFaceEXT)
3148 /* GL_EXT_texture3D */
3150 USE_GL_FUNC(glTexImage3DEXT)
3152 USE_GL_FUNC(glTexSubImage3DEXT)
3153 /* GL_NV_fence */
3154 USE_GL_FUNC(glDeleteFencesNV)
3155 USE_GL_FUNC(glFinishFenceNV)
3156 USE_GL_FUNC(glGenFencesNV)
3157 USE_GL_FUNC(glGetFenceivNV)
3158 USE_GL_FUNC(glIsFenceNV)
3159 USE_GL_FUNC(glSetFenceNV)
3160 USE_GL_FUNC(glTestFenceNV)
3161 /* GL_NV_half_float */
3162 USE_GL_FUNC(glColor3hNV)
3163 USE_GL_FUNC(glColor3hvNV)
3164 USE_GL_FUNC(glColor4hNV)
3165 USE_GL_FUNC(glColor4hvNV)
3166 USE_GL_FUNC(glFogCoordhNV)
3167 USE_GL_FUNC(glFogCoordhvNV)
3168 USE_GL_FUNC(glMultiTexCoord1hNV)
3169 USE_GL_FUNC(glMultiTexCoord1hvNV)
3170 USE_GL_FUNC(glMultiTexCoord2hNV)
3171 USE_GL_FUNC(glMultiTexCoord2hvNV)
3172 USE_GL_FUNC(glMultiTexCoord3hNV)
3173 USE_GL_FUNC(glMultiTexCoord3hvNV)
3174 USE_GL_FUNC(glMultiTexCoord4hNV)
3175 USE_GL_FUNC(glMultiTexCoord4hvNV)
3176 USE_GL_FUNC(glNormal3hNV)
3177 USE_GL_FUNC(glNormal3hvNV)
3178 USE_GL_FUNC(glSecondaryColor3hNV)
3179 USE_GL_FUNC(glSecondaryColor3hvNV)
3180 USE_GL_FUNC(glTexCoord1hNV)
3181 USE_GL_FUNC(glTexCoord1hvNV)
3182 USE_GL_FUNC(glTexCoord2hNV)
3183 USE_GL_FUNC(glTexCoord2hvNV)
3184 USE_GL_FUNC(glTexCoord3hNV)
3185 USE_GL_FUNC(glTexCoord3hvNV)
3186 USE_GL_FUNC(glTexCoord4hNV)
3187 USE_GL_FUNC(glTexCoord4hvNV)
3188 USE_GL_FUNC(glVertex2hNV)
3189 USE_GL_FUNC(glVertex2hvNV)
3190 USE_GL_FUNC(glVertex3hNV)
3191 USE_GL_FUNC(glVertex3hvNV)
3192 USE_GL_FUNC(glVertex4hNV)
3193 USE_GL_FUNC(glVertex4hvNV)
3194 USE_GL_FUNC(glVertexAttrib1hNV)
3195 USE_GL_FUNC(glVertexAttrib1hvNV)
3196 USE_GL_FUNC(glVertexAttrib2hNV)
3197 USE_GL_FUNC(glVertexAttrib2hvNV)
3198 USE_GL_FUNC(glVertexAttrib3hNV)
3199 USE_GL_FUNC(glVertexAttrib3hvNV)
3200 USE_GL_FUNC(glVertexAttrib4hNV)
3201 USE_GL_FUNC(glVertexAttrib4hvNV)
3202 USE_GL_FUNC(glVertexAttribs1hvNV)
3203 USE_GL_FUNC(glVertexAttribs2hvNV)
3204 USE_GL_FUNC(glVertexAttribs3hvNV)
3205 USE_GL_FUNC(glVertexAttribs4hvNV)
3206 USE_GL_FUNC(glVertexWeighthNV)
3207 USE_GL_FUNC(glVertexWeighthvNV)
3208 /* GL_NV_point_sprite */
3209 USE_GL_FUNC(glPointParameteriNV)
3210 USE_GL_FUNC(glPointParameterivNV)
3211 /* GL_NV_register_combiners */
3212 USE_GL_FUNC(glCombinerInputNV)
3213 USE_GL_FUNC(glCombinerOutputNV)
3214 USE_GL_FUNC(glCombinerParameterfNV)
3215 USE_GL_FUNC(glCombinerParameterfvNV)
3216 USE_GL_FUNC(glCombinerParameteriNV)
3217 USE_GL_FUNC(glCombinerParameterivNV)
3218 USE_GL_FUNC(glFinalCombinerInputNV)
3219 /* WGL extensions */
3220 USE_GL_FUNC(wglChoosePixelFormatARB)
3221 USE_GL_FUNC(wglGetExtensionsStringARB)
3222 USE_GL_FUNC(wglGetPixelFormatAttribfvARB)
3223 USE_GL_FUNC(wglGetPixelFormatAttribivARB)
3224 USE_GL_FUNC(wglQueryCurrentRendererIntegerWINE)
3225 USE_GL_FUNC(wglQueryCurrentRendererStringWINE)
3226 USE_GL_FUNC(wglQueryRendererIntegerWINE)
3227 USE_GL_FUNC(wglQueryRendererStringWINE)
3228 USE_GL_FUNC(wglSetPixelFormatWINE)
3229 USE_GL_FUNC(wglSwapIntervalEXT)
3230
3231 /* Newer core functions */
3232 USE_GL_FUNC(glActiveTexture) /* OpenGL 1.3 */
3233 USE_GL_FUNC(glAttachShader) /* OpenGL 2.0 */
3234 USE_GL_FUNC(glBeginQuery) /* OpenGL 1.5 */
3235 USE_GL_FUNC(glBeginTransformFeedback) /* OpenGL 3.0 */
3236 USE_GL_FUNC(glBindAttribLocation) /* OpenGL 2.0 */
3237 USE_GL_FUNC(glBindBuffer) /* OpenGL 1.5 */
3238 USE_GL_FUNC(glBindFragDataLocation) /* OpenGL 3.0 */
3239 USE_GL_FUNC(glBindVertexArray) /* OpenGL 3.0 */
3240 USE_GL_FUNC(glBlendColor) /* OpenGL 1.4 */
3241 USE_GL_FUNC(glBlendEquation) /* OpenGL 1.4 */
3242 USE_GL_FUNC(glBlendEquationSeparate) /* OpenGL 2.0 */
3243 USE_GL_FUNC(glBlendFuncSeparate) /* OpenGL 1.4 */
3244 USE_GL_FUNC(glBufferData) /* OpenGL 1.5 */
3245 USE_GL_FUNC(glBufferSubData) /* OpenGL 1.5 */
3246 USE_GL_FUNC(glColorMaski) /* OpenGL 3.0 */
3247 USE_GL_FUNC(glCompileShader) /* OpenGL 2.0 */
3248 USE_GL_FUNC(glCompressedTexImage2D) /* OpenGL 1.3 */
3249 USE_GL_FUNC(glCompressedTexImage3D) /* OpenGL 1.3 */
3250 USE_GL_FUNC(glCompressedTexSubImage2D) /* OpenGL 1.3 */
3251 USE_GL_FUNC(glCompressedTexSubImage3D) /* OpenGL 1.3 */
3252 USE_GL_FUNC(glCreateProgram) /* OpenGL 2.0 */
3253 USE_GL_FUNC(glCreateShader) /* OpenGL 2.0 */
3254 USE_GL_FUNC(glDebugMessageCallback) /* OpenGL 4.3 */
3255 USE_GL_FUNC(glDebugMessageControl) /* OpenGL 4.3 */
3256 USE_GL_FUNC(glDebugMessageInsert) /* OpenGL 4.3 */
3257 USE_GL_FUNC(glDeleteBuffers) /* OpenGL 1.5 */
3258 USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */
3259 USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */
3260 USE_GL_FUNC(glDeleteShader) /* OpenGL 2.0 */
3261 USE_GL_FUNC(glDeleteVertexArrays) /* OpenGL 3.0 */
3262 USE_GL_FUNC(glDetachShader) /* OpenGL 2.0 */
3263 USE_GL_FUNC(glDisablei) /* OpenGL 3.0 */
3264 USE_GL_FUNC(glDisableVertexAttribArray) /* OpenGL 2.0 */
3265 USE_GL_FUNC(glDrawArraysInstanced) /* OpenGL 3.1 */
3266 USE_GL_FUNC(glDrawBuffers) /* OpenGL 2.0 */
3267 USE_GL_FUNC(glDrawElementsInstanced) /* OpenGL 3.1 */
3268 USE_GL_FUNC(glEnablei) /* OpenGL 3.0 */
3269 USE_GL_FUNC(glEnableVertexAttribArray) /* OpenGL 2.0 */
3270 USE_GL_FUNC(glEndQuery) /* OpenGL 1.5 */
3271 USE_GL_FUNC(glEndTransformFeedback) /* OpenGL 3.0 */
3272 USE_GL_FUNC(glFramebufferTexture) /* OpenGL 3.2 */
3273 USE_GL_FUNC(glGenBuffers) /* OpenGL 1.5 */
3274 USE_GL_FUNC(glGenQueries) /* OpenGL 1.5 */
3275 USE_GL_FUNC(glGenVertexArrays) /* OpenGL 3.0 */
3276 USE_GL_FUNC(glGetActiveUniform) /* OpenGL 2.0 */
3277 USE_GL_FUNC(glGetAttachedShaders) /* OpenGL 2.0 */
3278 USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */
3279 USE_GL_FUNC(glGetBooleani_v) /* OpenGL 3.0 */
3280 USE_GL_FUNC(glGetBufferSubData) /* OpenGL 1.5 */
3281 USE_GL_FUNC(glGetCompressedTexImage) /* OpenGL 1.3 */
3282 USE_GL_FUNC(glGetDebugMessageLog) /* OpenGL 4.3 */
3283 USE_GL_FUNC(glGetIntegeri_v) /* OpenGL 3.0 */
3284 USE_GL_FUNC(glGetProgramInfoLog) /* OpenGL 2.0 */
3285 USE_GL_FUNC(glGetProgramiv) /* OpenGL 2.0 */
3286 USE_GL_FUNC(glGetQueryiv) /* OpenGL 1.5 */
3287 USE_GL_FUNC(glGetQueryObjectuiv) /* OpenGL 1.5 */
3288 USE_GL_FUNC(glGetShaderInfoLog) /* OpenGL 2.0 */
3289 USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */
3290 USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */
3291 USE_GL_FUNC(glGetStringi) /* OpenGL 3.0 */
3292 USE_GL_FUNC(glGetTextureLevelParameteriv) /* OpenGL 4.5 */
3293 USE_GL_FUNC(glGetTextureParameteriv) /* OpenGL 4.5 */
3294 USE_GL_FUNC(glGetUniformfv) /* OpenGL 2.0 */
3295 USE_GL_FUNC(glGetUniformiv) /* OpenGL 2.0 */
3296 USE_GL_FUNC(glGetUniformLocation) /* OpenGL 2.0 */
3297 USE_GL_FUNC(glIsEnabledi) /* OpenGL 3.0 */
3298 USE_GL_FUNC(glLinkProgram) /* OpenGL 2.0 */
3299 USE_GL_FUNC(glMapBuffer) /* OpenGL 1.5 */
3300 USE_GL_FUNC(glPointParameteri) /* OpenGL 1.4 */
3301 USE_GL_FUNC(glPointParameteriv) /* OpenGL 1.4 */
3302 USE_GL_FUNC(glShaderSource) /* OpenGL 2.0 */
3303 USE_GL_FUNC(glStencilFuncSeparate) /* OpenGL 2.0 */
3304 USE_GL_FUNC(glStencilOpSeparate) /* OpenGL 2.0 */
3305 USE_GL_FUNC(glTexBuffer) /* OpenGL 3.1 */
3306 USE_GL_FUNC(glTexImage3D) /* OpenGL 1.2 */
3307 USE_GL_FUNC(glTexSubImage3D) /* OpenGL 1.2 */
3308 USE_GL_FUNC(glTransformFeedbackVaryings) /* OpenGL 3.0 */
3309 USE_GL_FUNC(glUniform1f) /* OpenGL 2.0 */
3310 USE_GL_FUNC(glUniform1fv) /* OpenGL 2.0 */
3311 USE_GL_FUNC(glUniform1i) /* OpenGL 2.0 */
3312 USE_GL_FUNC(glUniform1iv) /* OpenGL 2.0 */
3313 USE_GL_FUNC(glUniform2f) /* OpenGL 2.0 */
3314 USE_GL_FUNC(glUniform2fv) /* OpenGL 2.0 */
3315 USE_GL_FUNC(glUniform2i) /* OpenGL 2.0 */
3316 USE_GL_FUNC(glUniform2iv) /* OpenGL 2.0 */
3317 USE_GL_FUNC(glUniform3f) /* OpenGL 2.0 */
3318 USE_GL_FUNC(glUniform3fv) /* OpenGL 2.0 */
3319 USE_GL_FUNC(glUniform3i) /* OpenGL 2.0 */
3320 USE_GL_FUNC(glUniform3iv) /* OpenGL 2.0 */
3321 USE_GL_FUNC(glUniform4f) /* OpenGL 2.0 */
3322 USE_GL_FUNC(glUniform4fv) /* OpenGL 2.0 */
3323 USE_GL_FUNC(glUniform4i) /* OpenGL 2.0 */
3324 USE_GL_FUNC(glUniform4iv) /* OpenGL 2.0 */
3325 USE_GL_FUNC(glUniformMatrix2fv) /* OpenGL 2.0 */
3326 USE_GL_FUNC(glUniformMatrix3fv) /* OpenGL 2.0 */
3327 USE_GL_FUNC(glUniformMatrix4fv) /* OpenGL 2.0 */
3328 USE_GL_FUNC(glUnmapBuffer) /* OpenGL 1.5 */
3329 USE_GL_FUNC(glUseProgram) /* OpenGL 2.0 */
3330 USE_GL_FUNC(glValidateProgram) /* OpenGL 2.0 */
3331 USE_GL_FUNC(glVertexAttrib1f) /* OpenGL 2.0 */
3332 USE_GL_FUNC(glVertexAttrib1fv) /* OpenGL 2.0 */
3333 USE_GL_FUNC(glVertexAttrib2f) /* OpenGL 2.0 */
3334 USE_GL_FUNC(glVertexAttrib2fv) /* OpenGL 2.0 */
3335 USE_GL_FUNC(glVertexAttrib3f) /* OpenGL 2.0 */
3336 USE_GL_FUNC(glVertexAttrib3fv) /* OpenGL 2.0 */
3337 USE_GL_FUNC(glVertexAttrib4f) /* OpenGL 2.0 */
3338 USE_GL_FUNC(glVertexAttrib4fv) /* OpenGL 2.0 */
3339 USE_GL_FUNC(glVertexAttrib4Nsv) /* OpenGL 2.0 */
3340 USE_GL_FUNC(glVertexAttrib4Nub) /* OpenGL 2.0 */
3341 USE_GL_FUNC(glVertexAttrib4Nubv) /* OpenGL 2.0 */
3342 USE_GL_FUNC(glVertexAttrib4Nusv) /* OpenGL 2.0 */
3343 USE_GL_FUNC(glVertexAttrib4sv) /* OpenGL 2.0 */
3344 USE_GL_FUNC(glVertexAttrib4ubv) /* OpenGL 2.0 */
3345 USE_GL_FUNC(glVertexAttribDivisor) /* OpenGL 3.3 */
3346 USE_GL_FUNC(glVertexAttribIPointer) /* OpenGL 3.0 */
3347 USE_GL_FUNC(glVertexAttribPointer) /* OpenGL 2.0 */
3348#undef USE_GL_FUNC
3349
3350#ifndef USE_WIN32_OPENGL
3351 /* hack: use the functions directly from the TEB table to bypass the thunks */
3352 /* note that we still need the above wglGetProcAddress calls to initialize the table */
3353 gl_info->gl_ops.ext = ((struct opengl_funcs *)NtCurrentTeb()->glTable)->ext;
3354#endif
3355
3356#define MAP_GL_FUNCTION(core_func, ext_func) \
3357 do \
3358 { \
3359 if (!gl_info->gl_ops.ext.p_##core_func) \
3360 gl_info->gl_ops.ext.p_##core_func = gl_info->gl_ops.ext.p_##ext_func; \
3361 } while (0)
3362#define MAP_GL_FUNCTION_CAST(core_func, ext_func) \
3363 do \
3364 { \
3365 if (!gl_info->gl_ops.ext.p_##core_func) \
3366 gl_info->gl_ops.ext.p_##core_func = (void *)gl_info->gl_ops.ext.p_##ext_func; \
3367 } while (0)
3368
3370 MAP_GL_FUNCTION(glAttachShader, glAttachObjectARB);
3371 MAP_GL_FUNCTION(glBeginQuery, glBeginQueryARB);
3372 MAP_GL_FUNCTION(glBindAttribLocation, glBindAttribLocationARB);
3373 MAP_GL_FUNCTION(glBindBuffer, glBindBufferARB);
3374 MAP_GL_FUNCTION(glBindFragDataLocation, glBindFragDataLocationEXT);
3375 MAP_GL_FUNCTION(glBlendColor, glBlendColorEXT);
3376 MAP_GL_FUNCTION(glBlendEquation, glBlendEquationEXT);
3377 MAP_GL_FUNCTION(glBlendEquationSeparate, glBlendEquationSeparateEXT);
3378 MAP_GL_FUNCTION(glBlendFuncSeparate, glBlendFuncSeparateEXT);
3379 MAP_GL_FUNCTION(glBufferData, glBufferDataARB);
3380 MAP_GL_FUNCTION(glBufferSubData, glBufferSubDataARB);
3381 MAP_GL_FUNCTION(glColorMaski, glColorMaskIndexedEXT);
3382 MAP_GL_FUNCTION(glCompileShader, glCompileShaderARB);
3383 MAP_GL_FUNCTION(glCompressedTexImage2D, glCompressedTexImage2DARB);
3384 MAP_GL_FUNCTION(glCompressedTexImage3D, glCompressedTexImage3DARB);
3385 MAP_GL_FUNCTION(glCompressedTexSubImage2D, glCompressedTexSubImage2DARB);
3386 MAP_GL_FUNCTION(glCompressedTexSubImage3D, glCompressedTexSubImage3DARB);
3387 MAP_GL_FUNCTION(glCreateProgram, glCreateProgramObjectARB);
3388 MAP_GL_FUNCTION(glCreateShader, glCreateShaderObjectARB);
3389 MAP_GL_FUNCTION(glDebugMessageCallback, glDebugMessageCallbackARB);
3390 MAP_GL_FUNCTION(glDebugMessageControl, glDebugMessageControlARB);
3391 MAP_GL_FUNCTION(glDebugMessageInsert, glDebugMessageInsertARB);
3392 MAP_GL_FUNCTION(glDeleteBuffers, glDeleteBuffersARB);
3393 MAP_GL_FUNCTION(glDeleteProgram, glDeleteObjectARB);
3394 MAP_GL_FUNCTION(glDeleteQueries, glDeleteQueriesARB);
3395 MAP_GL_FUNCTION(glDeleteShader, glDeleteObjectARB);
3396 MAP_GL_FUNCTION(glDetachShader, glDetachObjectARB);
3397 MAP_GL_FUNCTION(glDisablei, glDisableIndexedEXT);
3398 MAP_GL_FUNCTION(glDisableVertexAttribArray, glDisableVertexAttribArrayARB);
3399 MAP_GL_FUNCTION(glDrawArraysInstanced, glDrawArraysInstancedARB);
3400 MAP_GL_FUNCTION(glDrawBuffers, glDrawBuffersARB);
3401 MAP_GL_FUNCTION(glDrawElementsInstanced, glDrawElementsInstancedARB);
3402 MAP_GL_FUNCTION(glEnablei, glEnableIndexedEXT);
3403 MAP_GL_FUNCTION(glEnableVertexAttribArray, glEnableVertexAttribArrayARB);
3404 MAP_GL_FUNCTION(glEndQuery, glEndQueryARB);
3405 MAP_GL_FUNCTION(glFramebufferTexture, glFramebufferTextureARB);
3406 MAP_GL_FUNCTION(glGenBuffers, glGenBuffersARB);
3407 MAP_GL_FUNCTION(glGenQueries, glGenQueriesARB);
3408 MAP_GL_FUNCTION(glGetActiveUniform, glGetActiveUniformARB);
3409 MAP_GL_FUNCTION(glGetAttachedShaders, glGetAttachedObjectsARB);
3410 MAP_GL_FUNCTION(glGetAttribLocation, glGetAttribLocationARB);
3411 MAP_GL_FUNCTION(glGetBooleani_v, glGetBooleanIndexedvEXT);
3412 MAP_GL_FUNCTION(glGetBufferSubData, glGetBufferSubDataARB);
3413 MAP_GL_FUNCTION(glGetCompressedTexImage, glGetCompressedTexImageARB);
3414 MAP_GL_FUNCTION(glGetDebugMessageLog, glGetDebugMessageLogARB);
3415 MAP_GL_FUNCTION(glGetIntegeri_v, glGetIntegerIndexedvEXT);
3416 MAP_GL_FUNCTION(glGetProgramInfoLog, glGetInfoLogARB);
3417 MAP_G