ReactOS  0.4.13-dev-247-g0f29b3f
directx.c File Reference
#include "config.h"
#include "wine/port.h"
#include <stdio.h>
#include "wined3d_private.h"
#include "wine/winternl.h"
Include dependency graph for directx.c:

Go to the source code of this file.

Classes

struct  wined3d_extension_map
 
struct  driver_quirk
 
struct  driver_version_information
 
struct  gpu_description
 
struct  wined3d_renderer_table
 
struct  gl_vendor_selection
 

Macros

#define DEFAULT_REFRESH_RATE   0
 
#define USE_GL_FUNC(pfn)   gl_info->gl_ops.ext.p_##pfn = (void *)wglGetProcAddress(#pfn);
 
#define MAP_GL_FUNCTION(core_func, ext_func)
 
#define MAP_GL_FUNCTION_CAST(core_func, ext_func)
 

Enumerations

enum  wined3d_display_driver {
  DRIVER_AMD_RAGE_128PRO, DRIVER_AMD_R100, DRIVER_AMD_R300, DRIVER_AMD_R600,
  DRIVER_AMD_RX, DRIVER_INTEL_GMA800, DRIVER_INTEL_GMA900, DRIVER_INTEL_GMA950,
  DRIVER_INTEL_GMA3000, DRIVER_INTEL_HD4000, DRIVER_NVIDIA_TNT, DRIVER_NVIDIA_GEFORCE2MX,
  DRIVER_NVIDIA_GEFORCEFX, DRIVER_NVIDIA_GEFORCE6, DRIVER_NVIDIA_GEFORCE8, DRIVER_VMWARE,
  DRIVER_UNKNOWN
}
 
enum  wined3d_driver_model {
  DRIVER_MODEL_GENERIC, DRIVER_MODEL_WIN9X, DRIVER_MODEL_NT40, DRIVER_MODEL_NT5X,
  DRIVER_MODEL_NT6X
}
 
enum  wined3d_gl_vendor {
  GL_VENDOR_UNKNOWN, GL_VENDOR_APPLE, GL_VENDOR_FGLRX, GL_VENDOR_MESA,
  GL_VENDOR_NVIDIA
}
 
enum  wined3d_d3d_level {
  WINED3D_D3D_LEVEL_5, WINED3D_D3D_LEVEL_6, WINED3D_D3D_LEVEL_7, WINED3D_D3D_LEVEL_8,
  WINED3D_D3D_LEVEL_9_SM2, WINED3D_D3D_LEVEL_9_SM3, WINED3D_D3D_LEVEL_10, WINED3D_D3D_LEVEL_11,
  WINED3D_D3D_LEVEL_COUNT
}
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3d)
 
 WINE_DECLARE_DEBUG_CHANNEL (d3d_perf)
 
 WINE_DECLARE_DEBUG_CHANNEL (winediag)
 
static void wined3d_caps_gl_ctx_destroy (const struct wined3d_caps_gl_ctx *ctx)
 
static BOOL wined3d_caps_gl_ctx_create_attribs (struct wined3d_caps_gl_ctx *caps_gl_ctx, struct wined3d_gl_info *gl_info)
 
static BOOL wined3d_caps_gl_ctx_create (struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
 
UINT64 adapter_adjust_memory (struct wined3d_adapter *adapter, INT64 amount)
 
static void wined3d_adapter_cleanup (struct wined3d_adapter *adapter)
 
ULONG CDECL wined3d_incref (struct wined3d *wined3d)
 
ULONG CDECL wined3d_decref (struct wined3d *wined3d)
 
static BOOL test_arb_vs_offset_limit (const struct wined3d_gl_info *gl_info)
 
static BOOL match_amd_r300_to_500 (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_geforce5 (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_apple (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static void test_pbo_functionality (struct wined3d_gl_info *gl_info)
 
static BOOL match_apple_intel (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_apple_nonr500ati (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_dx10_capable (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_not_dx10_capable (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_allows_spec_alpha (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_broken_nv_clip (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_fbo_tex_update (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_broken_rgba16 (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_fglrx (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_r200 (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_broken_arb_fog (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static BOOL match_broken_viewport_subpixel_bits (const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static void quirk_apple_glsl_constants (struct wined3d_gl_info *gl_info)
 
static void quirk_amd_dx9 (struct wined3d_gl_info *gl_info)
 
static void quirk_no_np2 (struct wined3d_gl_info *gl_info)
 
static void quirk_texcoord_w (struct wined3d_gl_info *gl_info)
 
static void quirk_clip_varying (struct wined3d_gl_info *gl_info)
 
static void quirk_allows_specular_alpha (struct wined3d_gl_info *gl_info)
 
static void quirk_disable_nvvp_clip (struct wined3d_gl_info *gl_info)
 
static void quirk_fbo_tex_update (struct wined3d_gl_info *gl_info)
 
static void quirk_broken_rgba16 (struct wined3d_gl_info *gl_info)
 
static void quirk_infolog_spam (struct wined3d_gl_info *gl_info)
 
static void quirk_limited_tex_filtering (struct wined3d_gl_info *gl_info)
 
static void quirk_r200_constants (struct wined3d_gl_info *gl_info)
 
static void quirk_broken_arb_fog (struct wined3d_gl_info *gl_info)
 
static void quirk_broken_viewport_subpixel_bits (struct wined3d_gl_info *gl_info)
 
static const struct driver_version_informationget_driver_version_info (enum wined3d_display_driver driver, enum wined3d_driver_model driver_model)
 
static const struct gpu_descriptionget_gpu_description (enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
 
static const struct gpu_descriptionquery_gpu_description (const struct wined3d_gl_info *gl_info, UINT64 *vram_bytes)
 
static void init_driver_info (struct wined3d_driver_info *driver_info, const struct gpu_description *gpu_desc, UINT64 vram_bytes)
 
static void fixup_extensions (struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
 
static DWORD wined3d_parse_gl_version (const char *gl_version)
 
static enum wined3d_gl_vendor wined3d_guess_gl_vendor (const struct wined3d_gl_info *gl_info, const char *gl_vendor_string, const char *gl_renderer, const char *gl_version)
 
static enum wined3d_pci_vendor wined3d_guess_card_vendor (const char *gl_vendor_string, const char *gl_renderer)
 
static enum wined3d_d3d_level d3d_level_from_caps (const struct shader_caps *shader_caps, const struct fragment_caps *fragment_caps, DWORD glsl_version)
 
 C_ASSERT (ARRAY_SIZE(card_fallback_nvidia)==WINED3D_D3D_LEVEL_COUNT)
 
 C_ASSERT (ARRAY_SIZE(card_fallback_amd)==WINED3D_D3D_LEVEL_COUNT)
 
 C_ASSERT (ARRAY_SIZE(card_fallback_intel)==WINED3D_D3D_LEVEL_COUNT)
 
static enum wined3d_pci_device select_card_handler (const struct gl_vendor_selection *table, unsigned int table_size, enum wined3d_gl_vendor gl_vendor, const char *gl_renderer)
 
static enum wined3d_pci_device wined3d_guess_card (const struct shader_caps *shader_caps, const struct fragment_caps *fragment_caps, DWORD glsl_version, const char *gl_renderer, enum wined3d_gl_vendor *gl_vendor, enum wined3d_pci_vendor *card_vendor)
 
static const struct wined3d_vertex_pipe_opsselect_vertex_implementation (const struct wined3d_gl_info *gl_info, const struct wined3d_shader_backend_ops *shader_backend_ops)
 
static const struct fragment_pipelineselect_fragment_implementation (const struct wined3d_gl_info *gl_info, const struct wined3d_shader_backend_ops *shader_backend_ops)
 
static const struct wined3d_shader_backend_opsselect_shader_backend (const struct wined3d_gl_info *gl_info)
 
static void parse_extension_string (struct wined3d_gl_info *gl_info, const char *extensions, const struct wined3d_extension_map *map, UINT entry_count)
 
static void enumerate_gl_extensions (struct wined3d_gl_info *gl_info, const struct wined3d_extension_map *map, unsigned int map_entries_count)
 
static void load_gl_funcs (struct wined3d_gl_info *gl_info)
 
static void wined3d_adapter_init_limits (struct wined3d_gl_info *gl_info)
 
static BOOL wined3d_adapter_init_gl_caps (struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *caps_gl_ctx, DWORD wined3d_creation_flags)
 
UINT CDECL wined3d_get_adapter_count (const struct wined3d *wined3d)
 
HRESULT CDECL wined3d_register_software_device (struct wined3d *wined3d, void *init_function)
 
HRESULT CDECL wined3d_get_output_desc (const struct wined3d *wined3d, unsigned int adapter_idx, struct wined3d_output_desc *desc)
 
UINT CDECL wined3d_get_adapter_mode_count (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering)
 
HRESULT CDECL wined3d_enum_adapter_modes (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering, UINT mode_idx, struct wined3d_display_mode *mode)
 
HRESULT CDECL wined3d_find_closest_matching_adapter_mode (const struct wined3d *wined3d, unsigned int adapter_idx, struct wined3d_display_mode *mode)
 
HRESULT CDECL wined3d_get_adapter_display_mode (const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
 
HRESULT CDECL wined3d_set_adapter_display_mode (struct wined3d *wined3d, UINT adapter_idx, const struct wined3d_display_mode *mode)
 
HRESULT CDECL wined3d_get_adapter_identifier (const struct wined3d *wined3d, UINT adapter_idx, DWORD flags, struct wined3d_adapter_identifier *identifier)
 
HRESULT CDECL wined3d_get_adapter_raster_status (const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_raster_status *raster_status)
 
static BOOL wined3d_check_pixel_format_color (const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format)
 
static BOOL wined3d_check_pixel_format_depth (const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format)
 
HRESULT CDECL wined3d_check_depth_stencil_match (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, enum wined3d_format_id render_target_format_id, enum wined3d_format_id depth_stencil_format_id)
 
HRESULT CDECL wined3d_check_device_multisample_type (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id surface_format_id, BOOL windowed, enum wined3d_multisample_type multisample_type, DWORD *quality_levels)
 
static BOOL CheckDepthStencilCapability (const struct wined3d_adapter *adapter, const struct wined3d_format *display_format, const struct wined3d_format *ds_format, enum wined3d_gl_resource_type gl_type)
 
static BOOL CheckRenderTargetCapability (const struct wined3d_adapter *adapter, const struct wined3d_format *adapter_format, const struct wined3d_format *check_format, enum wined3d_gl_resource_type gl_type)
 
static BOOL wined3d_check_surface_capability (const struct wined3d_format *format, BOOL no3d)
 
HRESULT CDECL wined3d_check_device_format (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
 
UINT CDECL wined3d_calculate_format_pitch (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, UINT width)
 
HRESULT CDECL wined3d_check_device_format_conversion (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id src_format, enum wined3d_format_id dst_format)
 
HRESULT CDECL wined3d_check_device_type (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id display_format, enum wined3d_format_id backbuffer_format, BOOL windowed)
 
HRESULT CDECL wined3d_get_device_caps (const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, WINED3DCAPS *caps)
 
HRESULT CDECL wined3d_device_create (struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, HWND focus_window, DWORD flags, BYTE surface_alignment, struct wined3d_device_parent *device_parent, struct wined3d_device **device)
 
static void WINE_GLAPI invalid_func (const void *data)
 
static void WINE_GLAPI invalid_texcoord_func (GLenum unit, const void *data)
 
static void WINE_GLAPI invalid_generic_attrib_func (GLuint idx, const void *data)
 
static void WINE_GLAPI position_d3dcolor (const void *data)
 
static void WINE_GLAPI position_float4 (const void *data)
 
static void WINE_GLAPI diffuse_d3dcolor (const void *data)
 
static void WINE_GLAPI specular_d3dcolor (const void *data)
 
static void WINE_GLAPI warn_no_specular_func (const void *data)
 
static void WINE_GLAPI generic_d3dcolor (GLuint idx, const void *data)
 
static void WINE_GLAPI generic_short2n (GLuint idx, const void *data)
 
static void WINE_GLAPI generic_ushort2n (GLuint idx, const void *data)
 
static void WINE_GLAPI generic_float16_2 (GLuint idx, const void *data)
 
static void WINE_GLAPI generic_float16_4 (GLuint idx, const void *data)
 
static void wined3d_adapter_init_ffp_attrib_ops (struct wined3d_adapter *adapter)
 
static void wined3d_adapter_init_fb_cfgs (struct wined3d_adapter *adapter, HDC dc)
 
static DWORD get_max_gl_version (const struct wined3d_gl_info *gl_info, DWORD flags)
 
static BOOL wined3d_adapter_init (struct wined3d_adapter *adapter, UINT ordinal, DWORD wined3d_creation_flags)
 
static BOOL wined3d_adapter_init_nogl (struct wined3d_adapter *adapter, UINT ordinal)
 
static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed (void *parent)
 
HRESULT wined3d_init (struct wined3d *wined3d, DWORD flags)
 

Variables

static const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } }
 
static const struct wined3d_extension_map gl_extension_map []
 
static const struct wined3d_extension_map wgl_extension_map []
 
const struct min_lookup minMipLookup []
 
const GLenum magLookup []
 
static const struct driver_quirk quirk_table []
 
static const struct driver_version_information driver_version_table []
 
static const struct gpu_description gpu_description_table []
 
static const struct wined3d_renderer_table cards_nvidia_binary []
 
static const struct wined3d_renderer_table cards_amd_binary []
 
static const struct wined3d_renderer_table cards_intel []
 
static const struct wined3d_renderer_table cards_amd_mesa []
 
static const struct wined3d_renderer_table cards_nvidia_mesa []
 
static const struct wined3d_renderer_table cards_vmware []
 
static const struct gl_vendor_selection amd_gl_vendor_table []
 
static const struct gl_vendor_selection nvidia_gl_vendor_table []
 
static const struct gl_vendor_selection vmware_gl_vendor_table []
 
static const struct gl_vendor_selection intel_gl_vendor_table []
 
static enum wined3d_pci_device card_fallback_nvidia []
 
static enum wined3d_pci_device card_fallback_amd []
 
static enum wined3d_pci_device card_fallback_intel []
 
struct {
   enum wined3d_pci_vendor   card_vendor
 
   const char *   description
 
   const struct gl_vendor_selection *   gl_vendor_selection
 
   unsigned int   gl_vendor_count
 
   enum wined3d_pci_device *   card_fallback
 
card_vendor_table []
 
const struct wined3d_parent_ops wined3d_null_parent_ops
 

Macro Definition Documentation

◆ DEFAULT_REFRESH_RATE

#define DEFAULT_REFRESH_RATE   0

Definition at line 36 of file directx.c.

◆ MAP_GL_FUNCTION

#define MAP_GL_FUNCTION (   core_func,
  ext_func 
)
Value:
do \
{ \
if (!gl_info->gl_ops.ext.p_##core_func) \
gl_info->gl_ops.ext.p_##core_func = gl_info->gl_ops.ext.p_##ext_func; \
} while (0)

◆ MAP_GL_FUNCTION_CAST

#define MAP_GL_FUNCTION_CAST (   core_func,
  ext_func 
)
Value:
do \
{ \
if (!gl_info->gl_ops.ext.p_##core_func) \
gl_info->gl_ops.ext.p_##core_func = (void *)gl_info->gl_ops.ext.p_##ext_func; \
} while (0)

◆ USE_GL_FUNC

#define USE_GL_FUNC (   pfn)    gl_info->gl_ops.ext.p_##pfn = (void *)wglGetProcAddress(#pfn);

Enumeration Type Documentation

◆ wined3d_d3d_level

Enumerator
WINED3D_D3D_LEVEL_5 
WINED3D_D3D_LEVEL_6 
WINED3D_D3D_LEVEL_7 
WINED3D_D3D_LEVEL_8 
WINED3D_D3D_LEVEL_9_SM2 
WINED3D_D3D_LEVEL_9_SM3 
WINED3D_D3D_LEVEL_10 
WINED3D_D3D_LEVEL_11 
WINED3D_D3D_LEVEL_COUNT 

Definition at line 80 of file directx.c.

◆ wined3d_display_driver

Enumerator
DRIVER_AMD_RAGE_128PRO 
DRIVER_AMD_R100 
DRIVER_AMD_R300 
DRIVER_AMD_R600 
DRIVER_AMD_RX 
DRIVER_INTEL_GMA800 
DRIVER_INTEL_GMA900 
DRIVER_INTEL_GMA950 
DRIVER_INTEL_GMA3000 
DRIVER_INTEL_HD4000 
DRIVER_NVIDIA_TNT 
DRIVER_NVIDIA_GEFORCE2MX 
DRIVER_NVIDIA_GEFORCEFX 
DRIVER_NVIDIA_GEFORCE6 
DRIVER_NVIDIA_GEFORCE8 
DRIVER_VMWARE 
DRIVER_UNKNOWN 

Definition at line 41 of file directx.c.

◆ wined3d_driver_model

Enumerator
DRIVER_MODEL_GENERIC 
DRIVER_MODEL_WIN9X 
DRIVER_MODEL_NT40 
DRIVER_MODEL_NT5X 
DRIVER_MODEL_NT6X 

Definition at line 62 of file directx.c.

◆ wined3d_gl_vendor

Enumerator
GL_VENDOR_UNKNOWN 
GL_VENDOR_APPLE 
GL_VENDOR_FGLRX 
GL_VENDOR_MESA 
GL_VENDOR_NVIDIA 

Definition at line 71 of file directx.c.

Function Documentation

◆ adapter_adjust_memory()

UINT64 adapter_adjust_memory ( struct wined3d_adapter adapter,
INT64  amount 
)

Definition at line 442 of file directx.c.

443 {
444  adapter->vram_bytes_used += amount;
445  TRACE("Adjusted used adapter memory by 0x%s to 0x%s.\n",
446  wine_dbgstr_longlong(amount),
448  return adapter->vram_bytes_used;
449 }
#define TRACE(s)
Definition: solgame.cpp:4
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41

Referenced by resource_cleanup(), and resource_init().

◆ C_ASSERT() [1/3]

◆ C_ASSERT() [2/3]

◆ C_ASSERT() [3/3]

◆ CheckDepthStencilCapability()

static BOOL CheckDepthStencilCapability ( const struct wined3d_adapter adapter,
const struct wined3d_format display_format,
const struct wined3d_format ds_format,
enum wined3d_gl_resource_type  gl_type 
)
static

Definition at line 5187 of file directx.c.

5190 {
5191  /* Only allow depth/stencil formats */
5192  if (!(ds_format->depth_size || ds_format->stencil_size)) return FALSE;
5193 
5194  /* Blacklist formats not supported on Windows */
5195  switch (ds_format->id)
5196  {
5197  case WINED3DFMT_S1_UINT_D15_UNORM: /* Breaks the shadowvol2 dx7 sdk sample */
5199  TRACE("[FAILED] - not supported on windows.\n");
5200  return FALSE;
5201 
5202  default:
5203  break;
5204  }
5205 
5207  {
5208  /* With FBOs WGL limitations do not apply, but the format needs to be FBO attachable */
5209  if (ds_format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
5210  return TRUE;
5211  }
5212  else
5213  {
5214  unsigned int i;
5215 
5216  /* Walk through all WGL pixel formats to find a match */
5217  for (i = 0; i < adapter->cfg_count; ++i)
5218  {
5219  const struct wined3d_pixel_format *cfg = &adapter->cfgs[i];
5220  if (wined3d_check_pixel_format_color(&adapter->gl_info, cfg, display_format)
5221  && wined3d_check_pixel_format_depth(&adapter->gl_info, cfg, ds_format))
5222  return TRUE;
5223  }
5224  }
5225 
5226  return FALSE;
5227 }
#define ORM_FBO
#define WINED3DFMT_FLAG_STENCIL
#define TRUE
Definition: types.h:120
struct wined3d_pixel_format * cfgs
unsigned int cfg_count
static BOOL wined3d_check_pixel_format_color(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format)
Definition: directx.c:5038
struct wined3d_gl_info gl_info
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4
static BOOL wined3d_check_pixel_format_depth(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format)
Definition: directx.c:5058
enum wined3d_format_id id
unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]
#define WINED3DFMT_FLAG_DEPTH

Referenced by wined3d_check_device_format().

◆ CheckRenderTargetCapability()

static BOOL CheckRenderTargetCapability ( const struct wined3d_adapter adapter,
const struct wined3d_format adapter_format,
const struct wined3d_format check_format,
enum wined3d_gl_resource_type  gl_type 
)
static

Definition at line 5230 of file directx.c.

5233 {
5234  /* Filter out non-RT formats */
5235  if (!(check_format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET))
5236  return FALSE;
5238  return TRUE;
5240  {
5241  const struct wined3d_pixel_format *cfgs = adapter->cfgs;
5242  unsigned int i;
5243 
5244  /* In backbuffer mode the front and backbuffer share the same WGL
5245  * pixelformat. The format must match in RGB, alpha is allowed to be
5246  * different. (Only the backbuffer can have alpha.) */
5247  if (adapter_format->red_size != check_format->red_size
5248  || adapter_format->green_size != check_format->green_size
5249  || adapter_format->blue_size != check_format->blue_size)
5250  {
5251  TRACE("[FAILED]\n");
5252  return FALSE;
5253  }
5254 
5255  /* Check if there is a WGL pixel format matching the requirements, the format should also be window
5256  * drawable (not offscreen; e.g. Nvidia offers R5G6B5 for pbuffers even when X is running at 24bit) */
5257  for (i = 0; i < adapter->cfg_count; ++i)
5258  {
5259  if (cfgs[i].windowDrawable
5260  && wined3d_check_pixel_format_color(&adapter->gl_info, &cfgs[i], check_format))
5261  {
5262  TRACE("Pixel format %d is compatible with format %s.\n",
5264  return TRUE;
5265  }
5266  }
5267  }
5268  return FALSE;
5269 }
#define ORM_FBO
#define TRUE
Definition: types.h:120
struct wined3d_pixel_format * cfgs
unsigned int cfg_count
static BOOL wined3d_check_pixel_format_color(const struct wined3d_gl_info *gl_info, const struct wined3d_pixel_format *cfg, const struct wined3d_format *format)
Definition: directx.c:5038
struct wined3d_gl_info gl_info
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static BOOL check_format(LPSTR path, LPSTR inf)
Definition: misc.c:87
#define ORM_BACKBUFFER
#define TRACE(s)
Definition: solgame.cpp:4
#define WINED3DFMT_FLAG_RENDERTARGET
_In_ LONG iPixelFormat
Definition: winddi.h:3488
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3922

Referenced by wined3d_check_device_format().

◆ d3d_level_from_caps()

static enum wined3d_d3d_level d3d_level_from_caps ( const struct shader_caps shader_caps,
const struct fragment_caps fragment_caps,
DWORD  glsl_version 
)
static

Definition at line 1872 of file directx.c.

1873 {
1874  if (shader_caps->vs_version >= 5)
1875  return WINED3D_D3D_LEVEL_11;
1876  if (shader_caps->vs_version == 4)
1877  return WINED3D_D3D_LEVEL_10;
1878  if (shader_caps->vs_version == 3)
1879  {
1880  /* wined3d with default settings at the moment doesn't expose SM4+ on
1881  * Mesa drivers. */
1882  if (glsl_version >= MAKEDWORD_VERSION(4, 30))
1883  return WINED3D_D3D_LEVEL_11;
1884  if (glsl_version >= MAKEDWORD_VERSION(1, 30))
1885  return WINED3D_D3D_LEVEL_10;
1886  return WINED3D_D3D_LEVEL_9_SM3;
1887  }
1888  if (shader_caps->vs_version == 2)
1889  return WINED3D_D3D_LEVEL_9_SM2;
1890  if (shader_caps->vs_version == 1)
1891  return WINED3D_D3D_LEVEL_8;
1892 
1894  return WINED3D_D3D_LEVEL_7;
1896  return WINED3D_D3D_LEVEL_6;
1897 
1898  return WINED3D_D3D_LEVEL_5;
1899 }
unsigned int vs_version
#define WINED3DTEXOPCAPS_DOTPRODUCT3
Definition: wined3d.h:1170
DWORD MaxSimultaneousTextures
#define MAKEDWORD_VERSION(maj, min)

Referenced by wined3d_guess_card().

◆ diffuse_d3dcolor()

static void WINE_GLAPI diffuse_d3dcolor ( const void data)
static

Definition at line 6316 of file directx.c.

6317 {
6318  DWORD diffuseColor = *((const DWORD *)data);
6319 
6320  context_get_current()->gl_info->gl_ops.gl.p_glColor4ub(D3DCOLOR_B_R(diffuseColor),
6321  D3DCOLOR_B_G(diffuseColor),
6322  D3DCOLOR_B_B(diffuseColor),
6323  D3DCOLOR_B_A(diffuseColor));
6324 }
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
#define D3DCOLOR_B_B(dw)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3DCOLOR_B_G(dw)
#define D3DCOLOR_B_R(dw)
#define D3DCOLOR_B_A(dw)

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ enumerate_gl_extensions()

static void enumerate_gl_extensions ( struct wined3d_gl_info gl_info,
const struct wined3d_extension_map map,
unsigned int  map_entries_count 
)
static

Definition at line 2677 of file directx.c.

2679 {
2680  const char *gl_extension_name;
2681  unsigned int i, j;
2682  GLint extensions_count;
2683 
2684  gl_info->gl_ops.gl.p_glGetIntegerv(GL_NUM_EXTENSIONS, &extensions_count);
2685  for (i = 0; i < extensions_count; ++i)
2686  {
2687  gl_extension_name = (const char *)GL_EXTCALL(glGetStringi(GL_EXTENSIONS, i));
2688  TRACE("- %s.\n", debugstr_a(gl_extension_name));
2689  for (j = 0; j < map_entries_count; ++j)
2690  {
2691  if (!strcmp(gl_extension_name, map[j].extension_string))
2692  {
2693  TRACE("FOUND: %s support.\n", map[j].extension_string);
2694  gl_info->supported[map[j].extension] = TRUE;
2695  break;
2696  }
2697  }
2698  }
2699 }
#define TRUE
Definition: types.h:120
struct opengl_funcs gl_ops
#define GL_EXTENSIONS
Definition: gl.h:690
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOL supported[WINED3D_GL_EXT_COUNT]
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
Definition: _map.h:44
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
int GLint
Definition: gl.h:156
#define GL_NUM_EXTENSIONS
Definition: glext.h:517

Referenced by wined3d_adapter_init_gl_caps().

◆ fixup_extensions()

static void fixup_extensions ( struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 1751 of file directx.c.

1754 {
1755  unsigned int i;
1756 
1757  for (i = 0; i < ARRAY_SIZE(quirk_table); ++i)
1758  {
1759  if (!quirk_table[i].match(gl_info, ctx, gl_renderer, gl_vendor, card_vendor, device)) continue;
1760  TRACE("Applying driver quirk \"%s\".\n", quirk_table[i].description);
1761  quirk_table[i].apply(gl_info);
1762  }
1763 
1764  /* Find out if PBOs work as they are supposed to. */
1765  test_pbo_functionality(gl_info);
1766 }
const char * description
Definition: directx.c:2502
static void test_pbo_functionality(struct wined3d_gl_info *gl_info)
Definition: directx.c:571
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: devices.h:37
struct match match
Definition: match.c:33
#define TRACE(s)
Definition: solgame.cpp:4
static const struct driver_quirk quirk_table[]
Definition: directx.c:1097
#define ARRAY_SIZE(a)
Definition: main.h:24
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

Referenced by wined3d_adapter_init_gl_caps().

◆ generic_d3dcolor()

static void WINE_GLAPI generic_d3dcolor ( GLuint  idx,
const void data 
)
static

Definition at line 6344 of file directx.c.

6345 {
6346  DWORD color = *((const DWORD *)data);
6347 
6348  context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4Nub(idx,
6351 }
GLuint color
Definition: glext.h:6243
unsigned int idx
Definition: utils.c:41
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
#define D3DCOLOR_B_B(dw)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3DCOLOR_B_G(dw)
#define D3DCOLOR_B_R(dw)
#define D3DCOLOR_B_A(dw)

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ generic_float16_2()

static void WINE_GLAPI generic_float16_2 ( GLuint  idx,
const void data 
)
static

Definition at line 6367 of file directx.c.

6368 {
6369  float x = float_16_to_32(((const unsigned short *)data) + 0);
6370  float y = float_16_to_32(((const unsigned short *)data) + 1);
6371 
6372  context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib2f(idx, x, y);
6373 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
unsigned int idx
Definition: utils.c:41
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN
Definition: math.c:2247
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ generic_float16_4()

static void WINE_GLAPI generic_float16_4 ( GLuint  idx,
const void data 
)
static

Definition at line 6375 of file directx.c.

6376 {
6377  float x = float_16_to_32(((const unsigned short *)data) + 0);
6378  float y = float_16_to_32(((const unsigned short *)data) + 1);
6379  float z = float_16_to_32(((const unsigned short *)data) + 2);
6380  float w = float_16_to_32(((const unsigned short *)data) + 3);
6381 
6382  context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4f(idx, x, y, z, w);
6383 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
unsigned int idx
Definition: utils.c:41
GLdouble GLdouble z
Definition: glext.h:5874
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN
Definition: math.c:2247
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ generic_short2n()

static void WINE_GLAPI generic_short2n ( GLuint  idx,
const void data 
)
static

Definition at line 6353 of file directx.c.

6354 {
6355  const GLshort s[] = {((const GLshort *)data)[0], ((const GLshort *)data)[1], 0, 1};
6356 
6357  context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4Nsv(idx, s);
6358 }
unsigned int idx
Definition: utils.c:41
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble s
Definition: gl.h:2039
short GLshort
Definition: gl.h:155

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ generic_ushort2n()

static void WINE_GLAPI generic_ushort2n ( GLuint  idx,
const void data 
)
static

Definition at line 6360 of file directx.c.

6361 {
6362  const GLushort s[] = {((const GLushort *)data)[0], ((const GLushort *)data)[1], 0, 1};
6363 
6364  context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4Nusv(idx, s);
6365 }
unsigned int idx
Definition: utils.c:41
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLdouble s
Definition: gl.h:2039
unsigned short GLushort
Definition: gl.h:158

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ get_driver_version_info()

static const struct driver_version_information* get_driver_version_info ( enum wined3d_display_driver  driver,
enum wined3d_driver_model  driver_model 
)
static

Definition at line 1536 of file directx.c.

1538 {
1539  unsigned int i;
1540 
1541  TRACE("Looking up version info for driver=%d driver_model=%d\n", driver, driver_model);
1542  for (i = 0; i < ARRAY_SIZE(driver_version_table); ++i)
1543  {
1545 
1546  if (entry->driver == driver && (driver_model == DRIVER_MODEL_GENERIC
1547  || entry->driver_model == driver_model))
1548  {
1549  TRACE("Found driver \"%s\", version %u, subversion %u, build %u.\n",
1550  entry->driver_name, entry->version, entry->subversion, entry->build);
1551  return entry;
1552  }
1553  }
1554  return NULL;
1555 }
enum wined3d_driver_model driver_model
Definition: directx.c:1217
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
uint32_t entry
Definition: isohybrid.c:63
static const struct driver_version_information driver_version_table[]
Definition: directx.c:1225
#define ARRAY_SIZE(a)
Definition: main.h:24
struct @1596::@1597 driver

Referenced by init_driver_info().

◆ get_gpu_description()

static const struct gpu_description* get_gpu_description ( enum wined3d_pci_vendor  vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 1557 of file directx.c.

1559 {
1560  unsigned int i;
1561 
1562  for (i = 0; i < ARRAY_SIZE(gpu_description_table); ++i)
1563  {
1565  return &gpu_description_table[i];
1566  }
1567 
1568  return NULL;
1569 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: devices.h:37
smooth NULL
Definition: ftsmooth.c:416
static const struct gpu_description gpu_description_table[]
Definition: directx.c:1282
const WCHAR * vendor
Definition: db.cpp:860
#define ARRAY_SIZE(a)
Definition: main.h:24

Referenced by query_gpu_description(), and wined3d_adapter_init_gl_caps().

◆ get_max_gl_version()

static DWORD get_max_gl_version ( const struct wined3d_gl_info gl_info,
DWORD  flags 
)
static

Definition at line 6607 of file directx.c.

6608 {
6609  const char *gl_vendor, *gl_renderer;
6610 
6613 
6614  gl_vendor = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_VENDOR);
6615  gl_renderer = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_RENDERER);
6616  if (!gl_vendor || !gl_renderer
6617  || wined3d_guess_card_vendor(gl_vendor, gl_renderer) == HW_VENDOR_NVIDIA)
6618  return MAKEDWORD_VERSION(1, 0);
6619 
6621 }
struct opengl_funcs gl_ops
#define GL_RENDERER
Definition: gl.h:688
#define GL_VENDOR
Definition: gl.h:687
static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_string, const char *gl_renderer)
Definition: directx.c:1831
#define MAKEDWORD_VERSION(maj, min)

Referenced by wined3d_adapter_init().

◆ init_driver_info()

static void init_driver_info ( struct wined3d_driver_info driver_info,
const struct gpu_description gpu_desc,
UINT64  vram_bytes 
)
static

Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff. In order to avoid this application bug we limit the amount of video memory to LONG_MAX for older Windows versions.

Definition at line 1628 of file directx.c.

1630 {
1631  OSVERSIONINFOW os_version;
1632  WORD driver_os_version;
1635  const struct driver_version_information *version_info;
1636 
1637  memset(&os_version, 0, sizeof(os_version));
1638  os_version.dwOSVersionInfoSize = sizeof(os_version);
1639  if (!GetVersionExW(&os_version))
1640  {
1641  ERR("Failed to get OS version, reporting 2000/XP.\n");
1642  driver_os_version = 6;
1644  }
1645  else
1646  {
1647  TRACE("OS version %u.%u.\n", os_version.dwMajorVersion, os_version.dwMinorVersion);
1648  switch (os_version.dwMajorVersion)
1649  {
1650  case 4:
1651  /* If needed we could distinguish between 9x and NT4, but this code won't make
1652  * sense for NT4 since it had no way to obtain this info through DirectDraw 3.0.
1653  */
1654  driver_os_version = 4;
1656  break;
1657 
1658  case 5:
1659  driver_os_version = 6;
1661  break;
1662 
1663  case 6:
1664  if (os_version.dwMinorVersion == 0)
1665  {
1666  driver_os_version = 7;
1668  }
1669  else if (os_version.dwMinorVersion == 1)
1670  {
1671  driver_os_version = 8;
1673  }
1674  else
1675  {
1676  if (os_version.dwMinorVersion > 2)
1677  {
1678  FIXME("Unhandled OS version %u.%u, reporting Win 8.\n",
1679  os_version.dwMajorVersion, os_version.dwMinorVersion);
1680  }
1681  driver_os_version = 9;
1683  }
1684  break;
1685 
1686  case 10:
1687  driver_os_version = 10;
1689  break;
1690 
1691  default:
1692  FIXME("Unhandled OS version %u.%u, reporting 2000/XP.\n",
1693  os_version.dwMajorVersion, os_version.dwMinorVersion);
1694  driver_os_version = 6;
1696  break;
1697  }
1698  }
1699 
1700  driver_info->vendor = gpu_desc->vendor;
1701  driver_info->device = gpu_desc->card;
1702  driver_info->description = gpu_desc->description;
1703  driver_info->vram_bytes = vram_bytes ? vram_bytes : (UINT64)gpu_desc->vidmem * 1024 * 1024;
1704  driver = gpu_desc->driver;
1705 
1711  if (driver_model < DRIVER_MODEL_NT6X && driver_info->vram_bytes > LONG_MAX)
1712  {
1713  TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX);
1714  driver_info->vram_bytes = LONG_MAX;
1715  }
1716 
1717  /* Try to obtain driver version information for the current Windows version. This fails in
1718  * some cases:
1719  * - the gpu is not available on the currently selected OS version:
1720  * - Geforce GTX480 on Win98. When running applications in compatibility mode on Windows,
1721  * version information for the current Windows version is returned instead of faked info.
1722  * We do the same and assume the default Windows version to emulate is WinXP.
1723  *
1724  * - Videocard is a Riva TNT but winver is set to win7 (there are no drivers for this beast)
1725  * For now return the XP driver info. Perhaps later on we should return VESA.
1726  *
1727  * - the gpu is not in our database (can happen when the user overrides the vendor_id / device_id)
1728  * This could be an indication that our database is not up to date, so this should be fixed.
1729  */
1730  if ((version_info = get_driver_version_info(driver, driver_model))
1731  || (version_info = get_driver_version_info(driver, DRIVER_MODEL_GENERIC)))
1732  {
1733  driver_info->name = version_info->driver_name;
1734  driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, version_info->version);
1735  driver_info->version_low = MAKEDWORD_VERSION(version_info->subversion, version_info->build);
1736  }
1737  else
1738  {
1739  ERR("No driver version info found for device %04x:%04x, driver model %#x.\n",
1740  driver_info->vendor, driver_info->device, driver_model);
1741  driver_info->name = "Display";
1742  driver_info->version_high = MAKEDWORD_VERSION(driver_os_version, 15);
1743  driver_info->version_low = MAKEDWORD_VERSION(8, 6); /* Nvidia RIVA TNT, arbitrary */
1744  }
1745 
1746  TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n",
1747  driver_info->version_high, driver_info->version_low);
1748 }
enum wined3d_pci_vendor vendor
unsigned int vidmem
Definition: directx.c:1277
BOOL WINAPI GetVersionExW(IN LPOSVERSIONINFOW lpVersionInformation)
Definition: version.c:37
const char * description
Definition: directx.c:1275
wined3d_driver_model
Definition: directx.c:62
enum wined3d_driver_model driver_model
Definition: directx.c:1217
#define FIXME(fmt,...)
Definition: debug.h:110
#define TRACE(s)
Definition: solgame.cpp:4
ULONG dwMajorVersion
Definition: rtltypes.h:243
if(!(yy_init))
Definition: macro.lex.yy.c:714
static const struct driver_version_information * get_driver_version_info(enum wined3d_display_driver driver, enum wined3d_driver_model driver_model)
Definition: directx.c:1536
ULONG dwOSVersionInfoSize
Definition: rtltypes.h:242
unsigned short WORD
Definition: ntddk_ex.h:93
enum wined3d_pci_device device
#define LONG_MAX
Definition: limits.h:43
#define MAKEDWORD_VERSION(maj, min)
#define ERR(fmt,...)
Definition: debug.h:109
enum wined3d_display_driver driver
Definition: directx.c:1276
ULONG dwMinorVersion
Definition: rtltypes.h:244
const char * description
const char * driver_name
Definition: directx.c:1218
wined3d_display_driver
Definition: directx.c:41
unsigned long long UINT64
#define memset(x, y, z)
Definition: compat.h:39
struct @1596::@1597 driver

Referenced by wined3d_adapter_init_gl_caps().

◆ invalid_func()

static void WINE_GLAPI invalid_func ( const void data)
static

Definition at line 6268 of file directx.c.

6269 {
6270  ERR("Invalid vertex attribute function called.\n");
6271  DebugBreak();
6272 }
void WINAPI DebugBreak(void)
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ invalid_generic_attrib_func()

static void WINE_GLAPI invalid_generic_attrib_func ( GLuint  idx,
const void data 
)
static

Definition at line 6280 of file directx.c.

6281 {
6282  ERR("Invalid attribute function called.\n");
6283  DebugBreak();
6284 }
void WINAPI DebugBreak(void)
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ invalid_texcoord_func()

static void WINE_GLAPI invalid_texcoord_func ( GLenum  unit,
const void data 
)
static

Definition at line 6274 of file directx.c.

6275 {
6276  ERR("Invalid texcoord function called.\n");
6277  DebugBreak();
6278 }
void WINAPI DebugBreak(void)
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ load_gl_funcs()

static void load_gl_funcs ( struct wined3d_gl_info gl_info)
static

Definition at line 2701 of file directx.c.

2702 {
2703 #define USE_GL_FUNC(pfn) gl_info->gl_ops.ext.p_##pfn = (void *)wglGetProcAddress(#pfn);
2704  /* GL_APPLE_fence */
2705  USE_GL_FUNC(glDeleteFencesAPPLE)
2706  USE_GL_FUNC(glFinishFenceAPPLE)
2707  USE_GL_FUNC(glFinishObjectAPPLE)
2708  USE_GL_FUNC(glGenFencesAPPLE)
2709  USE_GL_FUNC(glIsFenceAPPLE)
2710  USE_GL_FUNC(glSetFenceAPPLE)
2711  USE_GL_FUNC(glTestFenceAPPLE)
2712  USE_GL_FUNC(glTestObjectAPPLE)
2713  /* GL_APPLE_flush_buffer_range */
2714  USE_GL_FUNC(glBufferParameteriAPPLE)
2715  USE_GL_FUNC(glFlushMappedBufferRangeAPPLE)
2716  /* GL_ARB_base_instance */
2717  USE_GL_FUNC(glDrawArraysInstancedBaseInstance)
2718  USE_GL_FUNC(glDrawElementsInstancedBaseVertexBaseInstance)
2719  /* GL_ARB_blend_func_extended */
2720  USE_GL_FUNC(glBindFragDataLocationIndexed)
2721  USE_GL_FUNC(glGetFragDataIndex)
2722  /* GL_ARB_clear_buffer_object */
2723  USE_GL_FUNC(glClearBufferData)
2724  USE_GL_FUNC(glClearBufferSubData)
2725  /* GL_ARB_clear_texture */
2726  USE_GL_FUNC(glClearTexImage)
2727  USE_GL_FUNC(glClearTexSubImage)
2728  /* GL_ARB_clip_control */
2729  USE_GL_FUNC(glClipControl)
2730  /* GL_ARB_color_buffer_float */
2731  USE_GL_FUNC(glClampColorARB)
2732  /* GL_ARB_compute_shader */
2733  USE_GL_FUNC(glDispatchCompute)
2734  USE_GL_FUNC(glDispatchComputeIndirect)
2735  /* GL_ARB_copy_buffer */
2736  USE_GL_FUNC(glCopyBufferSubData)
2737  /* GL_ARB_copy_image */
2738  USE_GL_FUNC(glCopyImageSubData)
2739  /* GL_ARB_debug_output */
2740  USE_GL_FUNC(glDebugMessageCallbackARB)
2741  USE_GL_FUNC(glDebugMessageControlARB)
2742  USE_GL_FUNC(glDebugMessageInsertARB)
2743  USE_GL_FUNC(glGetDebugMessageLogARB)
2744  /* GL_ARB_draw_buffers */
2745  USE_GL_FUNC(glDrawBuffersARB)
2746  /* GL_ARB_draw_elements_base_vertex */
2747  USE_GL_FUNC(glDrawElementsBaseVertex)
2748  USE_GL_FUNC(glDrawElementsInstancedBaseVertex)
2749  USE_GL_FUNC(glDrawRangeElementsBaseVertex)
2750  USE_GL_FUNC(glMultiDrawElementsBaseVertex)
2751  /* GL_ARB_draw_indirect */
2752  USE_GL_FUNC(glDrawArraysIndirect)
2753  USE_GL_FUNC(glDrawElementsIndirect)
2754  /* GL_ARB_draw_instanced */
2755  USE_GL_FUNC(glDrawArraysInstancedARB)
2756  USE_GL_FUNC(glDrawElementsInstancedARB)
2757  /* GL_ARB_ES2_compatibility */
2758  USE_GL_FUNC(glReleaseShaderCompiler)
2759  USE_GL_FUNC(glShaderBinary)
2760  USE_GL_FUNC(glGetShaderPrecisionFormat)
2761  USE_GL_FUNC(glDepthRangef)
2762  USE_GL_FUNC(glClearDepthf)
2763  /* GL_ARB_framebuffer_no_attachments */
2764  USE_GL_FUNC(glFramebufferParameteri)
2765  /* GL_ARB_framebuffer_object */
2766  USE_GL_FUNC(glBindFramebuffer)
2767  USE_GL_FUNC(glBindRenderbuffer)
2768  USE_GL_FUNC(glBlitFramebuffer)
2769  USE_GL_FUNC(glCheckFramebufferStatus)
2770  USE_GL_FUNC(glDeleteFramebuffers)
2771  USE_GL_FUNC(glDeleteRenderbuffers)
2772  USE_GL_FUNC(glFramebufferRenderbuffer)
2773  USE_GL_FUNC(glFramebufferTexture)
2774  USE_GL_FUNC(glFramebufferTexture1D)
2775  USE_GL_FUNC(glFramebufferTexture2D)
2776  USE_GL_FUNC(glFramebufferTexture3D)
2777  USE_GL_FUNC(glFramebufferTextureLayer)
2778  USE_GL_FUNC(glGenFramebuffers)
2779  USE_GL_FUNC(glGenRenderbuffers)
2780  USE_GL_FUNC(glGenerateMipmap)
2781  USE_GL_FUNC(glGetFramebufferAttachmentParameteriv)
2782  USE_GL_FUNC(glGetRenderbufferParameteriv)
2783  USE_GL_FUNC(glIsFramebuffer)
2784  USE_GL_FUNC(glIsRenderbuffer)
2785  USE_GL_FUNC(glRenderbufferStorage)
2786  USE_GL_FUNC(glRenderbufferStorageMultisample)
2787  /* GL_ARB_geometry_shader4 */
2788  USE_GL_FUNC(glFramebufferTextureARB)
2789  USE_GL_FUNC(glFramebufferTextureFaceARB)
2790  USE_GL_FUNC(glFramebufferTextureLayerARB)
2791  USE_GL_FUNC(glProgramParameteriARB)
2792  /* GL_ARB_instanced_arrays */
2793  USE_GL_FUNC(glVertexAttribDivisorARB)
2794  /* GL_ARB_internalformat_query */
2795  USE_GL_FUNC(glGetInternalformativ)
2796  /* GL_ARB_internalformat_query2 */
2797  USE_GL_FUNC(glGetInternalformati64v)
2798  /* GL_ARB_map_buffer_range */
2799  USE_GL_FUNC(glFlushMappedBufferRange)
2800  USE_GL_FUNC(glMapBufferRange)
2801  /* GL_ARB_multisample */
2802  USE_GL_FUNC(glSampleCoverageARB)
2803  /* GL_ARB_multitexture */
2816  /* GL_ARB_occlusion_query */
2817  USE_GL_FUNC(glBeginQueryARB)
2818  USE_GL_FUNC(glDeleteQueriesARB)
2819  USE_GL_FUNC(glEndQueryARB)
2820  USE_GL_FUNC(glGenQueriesARB)
2821  USE_GL_FUNC(glGetQueryivARB)
2822  USE_GL_FUNC(glGetQueryObjectivARB)
2823  USE_GL_FUNC(glGetQueryObjectuivARB)
2824  USE_GL_FUNC(glIsQueryARB)
2825  /* GL_ARB_point_parameters */
2826  USE_GL_FUNC(glPointParameterfARB)
2827  USE_GL_FUNC(glPointParameterfvARB)
2828  /* GL_ARB_provoking_vertex */
2829  USE_GL_FUNC(glProvokingVertex)
2830  /* GL_ARB_sample_shading */
2831  USE_GL_FUNC(glMinSampleShadingARB)
2832  /* GL_ARB_sampler_objects */
2833  USE_GL_FUNC(glGenSamplers)
2834  USE_GL_FUNC(glDeleteSamplers)
2835  USE_GL_FUNC(glIsSampler)
2836  USE_GL_FUNC(glBindSampler)
2837  USE_GL_FUNC(glSamplerParameteri)
2838  USE_GL_FUNC(glSamplerParameterf)
2839  USE_GL_FUNC(glSamplerParameteriv)
2840  USE_GL_FUNC(glSamplerParameterfv)
2841  USE_GL_FUNC(glSamplerParameterIiv)
2842  USE_GL_FUNC(glSamplerParameterIuiv)
2843  USE_GL_FUNC(glGetSamplerParameteriv)
2844  USE_GL_FUNC(glGetSamplerParameterfv)
2845  USE_GL_FUNC(glGetSamplerParameterIiv)
2846  USE_GL_FUNC(glGetSamplerParameterIuiv)
2847  /* GL_ARB_shader_atomic_counters */
2848  USE_GL_FUNC(glGetActiveAtomicCounterBufferiv)
2849  /* GL_ARB_shader_image_load_store */
2850  USE_GL_FUNC(glBindImageTexture)
2851  USE_GL_FUNC(glMemoryBarrier)
2852  /* GL_ARB_shader_objects */
2853  USE_GL_FUNC(glAttachObjectARB)
2854  USE_GL_FUNC(glBindAttribLocationARB)
2855  USE_GL_FUNC(glCompileShaderARB)
2856  USE_GL_FUNC(glCreateProgramObjectARB)
2857  USE_GL_FUNC(glCreateShaderObjectARB)
2858  USE_GL_FUNC(glDeleteObjectARB)
2859  USE_GL_FUNC(glDetachObjectARB)
2860  USE_GL_FUNC(glGetActiveUniformARB)
2861  USE_GL_FUNC(glGetAttachedObjectsARB)
2862  USE_GL_FUNC(glGetAttribLocationARB)
2863  USE_GL_FUNC(glGetHandleARB)
2864  USE_GL_FUNC(glGetInfoLogARB)
2865  USE_GL_FUNC(glGetObjectParameterfvARB)
2866  USE_GL_FUNC(glGetObjectParameterivARB)
2867  USE_GL_FUNC(glGetShaderSourceARB)
2868  USE_GL_FUNC(glGetUniformLocationARB)
2869  USE_GL_FUNC(glGetUniformfvARB)
2870  USE_GL_FUNC(glGetUniformivARB)
2871  USE_GL_FUNC(glLinkProgramARB)
2872  USE_GL_FUNC(glShaderSourceARB)
2873  USE_GL_FUNC(glUniform1fARB)
2874  USE_GL_FUNC(glUniform1fvARB)
2875  USE_GL_FUNC(glUniform1iARB)
2876  USE_GL_FUNC(glUniform1ivARB)
2877  USE_GL_FUNC(glUniform2fARB)
2878  USE_GL_FUNC(glUniform2fvARB)
2879  USE_GL_FUNC(glUniform2iARB)
2880  USE_GL_FUNC(glUniform2ivARB)
2881  USE_GL_FUNC(glUniform3fARB)
2882  USE_GL_FUNC(glUniform3fvARB)
2883  USE_GL_FUNC(glUniform3iARB)
2884  USE_GL_FUNC(glUniform3ivARB)
2885  USE_GL_FUNC(glUniform4fARB)
2886  USE_GL_FUNC(glUniform4fvARB)
2887  USE_GL_FUNC(glUniform4iARB)
2888  USE_GL_FUNC(glUniform4ivARB)
2889  USE_GL_FUNC(glUniformMatrix2fvARB)
2890  USE_GL_FUNC(glUniformMatrix3fvARB)
2891  USE_GL_FUNC(glUniformMatrix4fvARB)
2892  USE_GL_FUNC(glUseProgramObjectARB)
2893  USE_GL_FUNC(glValidateProgramARB)
2894  /* GL_ARB_shader_storage_buffer_object */
2895  USE_GL_FUNC(glShaderStorageBlockBinding)
2896  /* GL_ARB_sync */
2897  USE_GL_FUNC(glClientWaitSync)
2898  USE_GL_FUNC(glDeleteSync)
2899  USE_GL_FUNC(glFenceSync)
2900  USE_GL_FUNC(glGetInteger64v)
2901  USE_GL_FUNC(glGetSynciv)
2902  USE_GL_FUNC(glIsSync)
2903  USE_GL_FUNC(glWaitSync)
2904  /* GL_ARB_tessellation_shader */
2905  USE_GL_FUNC(glPatchParameteri)
2906  USE_GL_FUNC(glPatchParameterfv)
2907  /* GL_ARB_texture_buffer_object */
2908  USE_GL_FUNC(glTexBufferARB)
2909  /* GL_ARB_texture_buffer_range */
2910  USE_GL_FUNC(glTexBufferRange)
2911  /* GL_ARB_texture_compression */
2912  USE_GL_FUNC(glCompressedTexImage2DARB)
2913  USE_GL_FUNC(glCompressedTexImage3DARB)
2914  USE_GL_FUNC(glCompressedTexSubImage2DARB)
2915  USE_GL_FUNC(glCompressedTexSubImage3DARB)
2916  USE_GL_FUNC(glGetCompressedTexImageARB)
2917  /* GL_ARB_texture_multisample */
2918  USE_GL_FUNC(glGetMultisamplefv);
2919  USE_GL_FUNC(glSampleMaski);
2920  USE_GL_FUNC(glTexImage2DMultisample);
2921  USE_GL_FUNC(glTexImage3DMultisample);
2922  /* GL_ARB_texture_storage */
2923  USE_GL_FUNC(glTexStorage1D)
2924  USE_GL_FUNC(glTexStorage2D)
2925  USE_GL_FUNC(glTexStorage3D)
2926  /* GL_ARB_texture_storage_multisample */
2927  USE_GL_FUNC(glTexStorage2DMultisample);
2928  USE_GL_FUNC(glTexStorage3DMultisample);
2929  /* GL_ARB_texture_view */
2930  USE_GL_FUNC(glTextureView)
2931  /* GL_ARB_timer_query */
2932  USE_GL_FUNC(glQueryCounter)
2933  USE_GL_FUNC(glGetQueryObjectui64v)
2934  /* GL_ARB_transform_feedback2 */
2935  USE_GL_FUNC(glBindTransformFeedback);
2936  USE_GL_FUNC(glDeleteTransformFeedbacks);
2937  USE_GL_FUNC(glDrawTransformFeedback);
2938  USE_GL_FUNC(glGenTransformFeedbacks);
2939  USE_GL_FUNC(glIsTransformFeedback);
2940  USE_GL_FUNC(glPauseTransformFeedback);
2941  USE_GL_FUNC(glResumeTransformFeedback);
2942  /* GL_ARB_transform_feedback3 */
2943  USE_GL_FUNC(glBeginQueryIndexed);
2944  USE_GL_FUNC(glDrawTransformFeedbackStream);
2945  USE_GL_FUNC(glEndQueryIndexed);
2946  USE_GL_FUNC(glGetQueryIndexediv);
2947  /* GL_ARB_uniform_buffer_object */
2948  USE_GL_FUNC(glBindBufferBase)
2949  USE_GL_FUNC(glBindBufferRange)
2950  USE_GL_FUNC(glGetActiveUniformBlockName)
2951  USE_GL_FUNC(glGetActiveUniformBlockiv)
2952  USE_GL_FUNC(glGetActiveUniformName)
2953  USE_GL_FUNC(glGetActiveUniformsiv)
2954  USE_GL_FUNC(glGetIntegeri_v)
2955  USE_GL_FUNC(glGetUniformBlockIndex)
2956  USE_GL_FUNC(glGetUniformIndices)
2957  USE_GL_FUNC(glUniformBlockBinding)
2958  /* GL_ARB_vertex_buffer_object */
2959  USE_GL_FUNC(glBindBufferARB)
2960  USE_GL_FUNC(glBufferDataARB)
2961  USE_GL_FUNC(glBufferSubDataARB)
2962  USE_GL_FUNC(glDeleteBuffersARB)
2963  USE_GL_FUNC(glGenBuffersARB)
2964  USE_GL_FUNC(glGetBufferParameterivARB)
2965  USE_GL_FUNC(glGetBufferPointervARB)
2966  USE_GL_FUNC(glGetBufferSubDataARB)
2967  USE_GL_FUNC(glIsBufferARB)
2968  USE_GL_FUNC(glMapBufferARB)
2969  USE_GL_FUNC(glUnmapBufferARB)
2970  /* GL_ARB_vertex_program */
2971  USE_GL_FUNC(glBindProgramARB)
2972  USE_GL_FUNC(glDeleteProgramsARB)
2973  USE_GL_FUNC(glDisableVertexAttribArrayARB)
2974  USE_GL_FUNC(glEnableVertexAttribArrayARB)
2975  USE_GL_FUNC(glGenProgramsARB)
2976  USE_GL_FUNC(glGetProgramivARB)
2977  USE_GL_FUNC(glProgramEnvParameter4fvARB)
2978  USE_GL_FUNC(glProgramLocalParameter4fvARB)
2979  USE_GL_FUNC(glProgramStringARB)
2980  USE_GL_FUNC(glVertexAttrib1dARB)
2981  USE_GL_FUNC(glVertexAttrib1dvARB)
2982  USE_GL_FUNC(glVertexAttrib1fARB)
2983  USE_GL_FUNC(glVertexAttrib1fvARB)
2984  USE_GL_FUNC(glVertexAttrib1sARB)
2985  USE_GL_FUNC(glVertexAttrib1svARB)
2986  USE_GL_FUNC(glVertexAttrib2dARB)
2987  USE_GL_FUNC(glVertexAttrib2dvARB)
2988  USE_GL_FUNC(glVertexAttrib2fARB)
2989  USE_GL_FUNC(glVertexAttrib2fvARB)
2990  USE_GL_FUNC(glVertexAttrib2sARB)
2991  USE_GL_FUNC(glVertexAttrib2svARB)
2992  USE_GL_FUNC(glVertexAttrib3dARB)
2993  USE_GL_FUNC(glVertexAttrib3dvARB)
2994  USE_GL_FUNC(glVertexAttrib3fARB)
2995  USE_GL_FUNC(glVertexAttrib3fvARB)
2996  USE_GL_FUNC(glVertexAttrib3sARB)
2997  USE_GL_FUNC(glVertexAttrib3svARB)
2998  USE_GL_FUNC(glVertexAttrib4NbvARB)
2999  USE_GL_FUNC(glVertexAttrib4NivARB)
3000  USE_GL_FUNC(glVertexAttrib4NsvARB)
3001  USE_GL_FUNC(glVertexAttrib4NubARB)
3002  USE_GL_FUNC(glVertexAttrib4NubvARB)
3003  USE_GL_FUNC(glVertexAttrib4NuivARB)
3004  USE_GL_FUNC(glVertexAttrib4NusvARB)
3005  USE_GL_FUNC(glVertexAttrib4bvARB)
3006  USE_GL_FUNC(glVertexAttrib4dARB)
3007  USE_GL_FUNC(glVertexAttrib4dvARB)
3008  USE_GL_FUNC(glVertexAttrib4fARB)
3009  USE_GL_FUNC(glVertexAttrib4fvARB)
3010  USE_GL_FUNC(glVertexAttrib4ivARB)
3011  USE_GL_FUNC(glVertexAttrib4sARB)
3012  USE_GL_FUNC(glVertexAttrib4svARB)
3013  USE_GL_FUNC(glVertexAttrib4ubvARB)
3014  USE_GL_FUNC(glVertexAttrib4uivARB)
3015  USE_GL_FUNC(glVertexAttrib4usvARB)
3016  USE_GL_FUNC(glVertexAttribPointerARB)
3017  /* GL_ARB_viewport_array */
3018  USE_GL_FUNC(glDepthRangeArrayv)
3019  USE_GL_FUNC(glDepthRangeIndexed)
3020  USE_GL_FUNC(glGetDoublei_v)
3021  USE_GL_FUNC(glGetFloati_v)
3022  USE_GL_FUNC(glScissorArrayv)
3023  USE_GL_FUNC(glScissorIndexed)
3024  USE_GL_FUNC(glScissorIndexedv)
3025  USE_GL_FUNC(glViewportArrayv)
3026  USE_GL_FUNC(glViewportIndexedf)
3027  USE_GL_FUNC(glViewportIndexedfv)
3028  /* GL_ATI_fragment_shader */
3029  USE_GL_FUNC(glAlphaFragmentOp1ATI)
3030  USE_GL_FUNC(glAlphaFragmentOp2ATI)
3031  USE_GL_FUNC(glAlphaFragmentOp3ATI)
3032  USE_GL_FUNC(glBeginFragmentShaderATI)
3033  USE_GL_FUNC(glBindFragmentShaderATI)
3034  USE_GL_FUNC(glColorFragmentOp1ATI)
3035  USE_GL_FUNC(glColorFragmentOp2ATI)
3036  USE_GL_FUNC(glColorFragmentOp3ATI)
3037  USE_GL_FUNC(glDeleteFragmentShaderATI)
3038  USE_GL_FUNC(glEndFragmentShaderATI)
3039  USE_GL_FUNC(glGenFragmentShadersATI)
3040  USE_GL_FUNC(glPassTexCoordATI)
3041  USE_GL_FUNC(glSampleMapATI)
3042  USE_GL_FUNC(glSetFragmentShaderConstantATI)
3043  /* GL_ATI_separate_stencil */
3044  USE_GL_FUNC(glStencilOpSeparateATI)
3045  USE_GL_FUNC(glStencilFuncSeparateATI)
3046  /* GL_EXT_blend_color */
3047  USE_GL_FUNC(glBlendColorEXT)
3048  /* GL_EXT_blend_equation_separate */
3049  USE_GL_FUNC(glBlendFuncSeparateEXT)
3050  /* GL_EXT_blend_func_separate */
3051  USE_GL_FUNC(glBlendEquationSeparateEXT)
3052  /* GL_EXT_blend_minmax */
3053  USE_GL_FUNC(glBlendEquationEXT)
3054  /* GL_EXT_depth_bounds_test */
3055  USE_GL_FUNC(glDepthBoundsEXT)
3056  /* GL_EXT_draw_buffers2 */
3057  USE_GL_FUNC(glColorMaskIndexedEXT)
3058  USE_GL_FUNC(glDisableIndexedEXT)
3059  USE_GL_FUNC(glEnableIndexedEXT)
3060  USE_GL_FUNC(glGetBooleanIndexedvEXT)
3061  USE_GL_FUNC(glGetIntegerIndexedvEXT)
3062  USE_GL_FUNC(glIsEnabledIndexedEXT)
3063  /* GL_EXT_fog_coord */
3064  USE_GL_FUNC(glFogCoordPointerEXT)
3065  USE_GL_FUNC(glFogCoorddEXT)
3066  USE_GL_FUNC(glFogCoorddvEXT)
3067  USE_GL_FUNC(glFogCoordfEXT)
3068  USE_GL_FUNC(glFogCoordfvEXT)
3069  /* GL_EXT_framebuffer_blit */
3070  USE_GL_FUNC(glBlitFramebufferEXT)
3071  /* GL_EXT_framebuffer_multisample */
3072  USE_GL_FUNC(glRenderbufferStorageMultisampleEXT)
3073  /* GL_EXT_framebuffer_object */
3074  USE_GL_FUNC(glBindFramebufferEXT)
3075  USE_GL_FUNC(glBindRenderbufferEXT)
3076  USE_GL_FUNC(glCheckFramebufferStatusEXT)
3077  USE_GL_FUNC(glDeleteFramebuffersEXT)
3078  USE_GL_FUNC(glDeleteRenderbuffersEXT)
3079  USE_GL_FUNC(glFramebufferRenderbufferEXT)
3080  USE_GL_FUNC(glFramebufferTexture1DEXT)
3081  USE_GL_FUNC(glFramebufferTexture2DEXT)
3082  USE_GL_FUNC(glFramebufferTexture3DEXT)
3083  USE_GL_FUNC(glGenFramebuffersEXT)
3084  USE_GL_FUNC(glGenRenderbuffersEXT)
3085  USE_GL_FUNC(glGenerateMipmapEXT)
3086  USE_GL_FUNC(glGetFramebufferAttachmentParameterivEXT)
3087  USE_GL_FUNC(glGetRenderbufferParameterivEXT)
3088  USE_GL_FUNC(glIsFramebufferEXT)
3089  USE_GL_FUNC(glIsRenderbufferEXT)
3090  USE_GL_FUNC(glRenderbufferStorageEXT)
3091  /* GL_EXT_gpu_program_parameters */
3092  USE_GL_FUNC(glProgramEnvParameters4fvEXT)
3093  USE_GL_FUNC(glProgramLocalParameters4fvEXT)
3094  /* GL_EXT_gpu_shader4 */
3095  USE_GL_FUNC(glBindFragDataLocationEXT)
3096  USE_GL_FUNC(glGetFragDataLocationEXT)
3097  USE_GL_FUNC(glGetUniformuivEXT)
3098  USE_GL_FUNC(glGetVertexAttribIivEXT)
3099  USE_GL_FUNC(glGetVertexAttribIuivEXT)
3100  USE_GL_FUNC(glUniform1uiEXT)
3101  USE_GL_FUNC(glUniform1uivEXT)
3102  USE_GL_FUNC(glUniform2uiEXT)
3103  USE_GL_FUNC(glUniform2uivEXT)
3104  USE_GL_FUNC(glUniform3uiEXT)
3105  USE_GL_FUNC(glUniform3uivEXT)
3106  USE_GL_FUNC(glUniform4uiEXT)
3107  USE_GL_FUNC(glUniform4uivEXT)
3108  USE_GL_FUNC(glVertexAttribI1iEXT)
3109  USE_GL_FUNC(glVertexAttribI1ivEXT)
3110  USE_GL_FUNC(glVertexAttribI1uiEXT)
3111  USE_GL_FUNC(glVertexAttribI1uivEXT)
3112  USE_GL_FUNC(glVertexAttribI2iEXT)
3113  USE_GL_FUNC(glVertexAttribI2ivEXT)
3114  USE_GL_FUNC(glVertexAttribI2uiEXT)
3115  USE_GL_FUNC(glVertexAttribI2uivEXT)
3116  USE_GL_FUNC(glVertexAttribI3iEXT)
3117  USE_GL_FUNC(glVertexAttribI3ivEXT)
3118  USE_GL_FUNC(glVertexAttribI3uiEXT)
3119  USE_GL_FUNC(glVertexAttribI3uivEXT)
3120  USE_GL_FUNC(glVertexAttribI4bvEXT)
3121  USE_GL_FUNC(glVertexAttribI4iEXT)
3122  USE_GL_FUNC(glVertexAttribI4ivEXT)
3123  USE_GL_FUNC(glVertexAttribI4svEXT)
3124  USE_GL_FUNC(glVertexAttribI4ubvEXT)
3125  USE_GL_FUNC(glVertexAttribI4uiEXT)
3126  USE_GL_FUNC(glVertexAttribI4uivEXT)
3127  USE_GL_FUNC(glVertexAttribI4usvEXT)
3128  USE_GL_FUNC(glVertexAttribIPointerEXT)
3129  /* GL_EXT_point_parameters */
3130  USE_GL_FUNC(glPointParameterfEXT)
3131  USE_GL_FUNC(glPointParameterfvEXT)
3132  /* GL_EXT_polygon_offset_clamp */
3133  USE_GL_FUNC(glPolygonOffsetClampEXT)
3134  /* GL_EXT_provoking_vertex */
3135  USE_GL_FUNC(glProvokingVertexEXT)
3136  /* GL_EXT_secondary_color */
3137  USE_GL_FUNC(glSecondaryColor3fEXT)
3138  USE_GL_FUNC(glSecondaryColor3fvEXT)
3139  USE_GL_FUNC(glSecondaryColor3ubEXT)
3140  USE_GL_FUNC(glSecondaryColor3ubvEXT)
3141  USE_GL_FUNC(glSecondaryColorPointerEXT)
3142  /* GL_EXT_stencil_two_side */
3143  USE_GL_FUNC(glActiveStencilFaceEXT)
3144  /* GL_EXT_texture3D */
3146  USE_GL_FUNC(glTexImage3DEXT)
3148  USE_GL_FUNC(glTexSubImage3DEXT)
3149  /* GL_NV_fence */
3150  USE_GL_FUNC(glDeleteFencesNV)
3151  USE_GL_FUNC(glFinishFenceNV)
3152  USE_GL_FUNC(glGenFencesNV)
3153  USE_GL_FUNC(glGetFenceivNV)
3154  USE_GL_FUNC(glIsFenceNV)
3155  USE_GL_FUNC(glSetFenceNV)
3156  USE_GL_FUNC(glTestFenceNV)
3157  /* GL_NV_half_float */
3158  USE_GL_FUNC(glColor3hNV)
3159  USE_GL_FUNC(glColor3hvNV)
3160  USE_GL_FUNC(glColor4hNV)
3161  USE_GL_FUNC(glColor4hvNV)
3162  USE_GL_FUNC(glFogCoordhNV)
3163  USE_GL_FUNC(glFogCoordhvNV)
3164  USE_GL_FUNC(glMultiTexCoord1hNV)
3165  USE_GL_FUNC(glMultiTexCoord1hvNV)
3166  USE_GL_FUNC(glMultiTexCoord2hNV)
3167  USE_GL_FUNC(glMultiTexCoord2hvNV)
3168  USE_GL_FUNC(glMultiTexCoord3hNV)
3169  USE_GL_FUNC(glMultiTexCoord3hvNV)
3170  USE_GL_FUNC(glMultiTexCoord4hNV)
3171  USE_GL_FUNC(glMultiTexCoord4hvNV)
3172  USE_GL_FUNC(glNormal3hNV)
3173  USE_GL_FUNC(glNormal3hvNV)
3174  USE_GL_FUNC(glSecondaryColor3hNV)
3175  USE_GL_FUNC(glSecondaryColor3hvNV)
3176  USE_GL_FUNC(glTexCoord1hNV)
3177  USE_GL_FUNC(glTexCoord1hvNV)
3178  USE_GL_FUNC(glTexCoord2hNV)
3179  USE_GL_FUNC(glTexCoord2hvNV)
3180  USE_GL_FUNC(glTexCoord3hNV)
3181  USE_GL_FUNC(glTexCoord3hvNV)
3182  USE_GL_FUNC(glTexCoord4hNV)
3183  USE_GL_FUNC(glTexCoord4hvNV)
3184  USE_GL_FUNC(glVertex2hNV)
3185  USE_GL_FUNC(glVertex2hvNV)
3186  USE_GL_FUNC(glVertex3hNV)
3187  USE_GL_FUNC(glVertex3hvNV)
3188  USE_GL_FUNC(glVertex4hNV)
3189  USE_GL_FUNC(glVertex4hvNV)
3190  USE_GL_FUNC(glVertexAttrib1hNV)
3191  USE_GL_FUNC(glVertexAttrib1hvNV)
3192  USE_GL_FUNC(glVertexAttrib2hNV)
3193  USE_GL_FUNC(glVertexAttrib2hvNV)
3194  USE_GL_FUNC(glVertexAttrib3hNV)
3195  USE_GL_FUNC(glVertexAttrib3hvNV)
3196  USE_GL_FUNC(glVertexAttrib4hNV)
3197  USE_GL_FUNC(glVertexAttrib4hvNV)
3198  USE_GL_FUNC(glVertexAttribs1hvNV)
3199  USE_GL_FUNC(glVertexAttribs2hvNV)
3200  USE_GL_FUNC(glVertexAttribs3hvNV)
3201  USE_GL_FUNC(glVertexAttribs4hvNV)
3202  USE_GL_FUNC(glVertexWeighthNV)
3203  USE_GL_FUNC(glVertexWeighthvNV)
3204  /* GL_NV_point_sprite */
3205  USE_GL_FUNC(glPointParameteriNV)
3206  USE_GL_FUNC(glPointParameterivNV)
3207  /* GL_NV_register_combiners */
3208  USE_GL_FUNC(glCombinerInputNV)
3209  USE_GL_FUNC(glCombinerOutputNV)
3210  USE_GL_FUNC(glCombinerParameterfNV)
3211  USE_GL_FUNC(glCombinerParameterfvNV)
3212  USE_GL_FUNC(glCombinerParameteriNV)
3213  USE_GL_FUNC(glCombinerParameterivNV)
3214  USE_GL_FUNC(glFinalCombinerInputNV)
3215  /* WGL extensions */
3216  USE_GL_FUNC(wglChoosePixelFormatARB)
3217  USE_GL_FUNC(wglGetExtensionsStringARB)
3218  USE_GL_FUNC(wglGetPixelFormatAttribfvARB)
3219  USE_GL_FUNC(wglGetPixelFormatAttribivARB)
3220  USE_GL_FUNC(wglQueryCurrentRendererIntegerWINE)
3221  USE_GL_FUNC(wglQueryCurrentRendererStringWINE)
3222  USE_GL_FUNC(wglQueryRendererIntegerWINE)
3223  USE_GL_FUNC(wglQueryRendererStringWINE)
3224  USE_GL_FUNC(wglSetPixelFormatWINE)
3225  USE_GL_FUNC(wglSwapIntervalEXT)
3226 
3227  /* Newer core functions */
3228  USE_GL_FUNC(glActiveTexture) /* OpenGL 1.3 */
3229  USE_GL_FUNC(glAttachShader) /* OpenGL 2.0 */
3230  USE_GL_FUNC(glBeginQuery) /* OpenGL 1.5 */
3231  USE_GL_FUNC(glBeginTransformFeedback) /* OpenGL 3.0 */
3232  USE_GL_FUNC(glBindAttribLocation) /* OpenGL 2.0 */
3233  USE_GL_FUNC(glBindBuffer) /* OpenGL 1.5 */
3234  USE_GL_FUNC(glBindFragDataLocation) /* OpenGL 3.0 */
3235  USE_GL_FUNC(glBindVertexArray) /* OpenGL 3.0 */
3236  USE_GL_FUNC(glBlendColor) /* OpenGL 1.4 */
3237  USE_GL_FUNC(glBlendEquation) /* OpenGL 1.4 */
3238  USE_GL_FUNC(glBlendEquationSeparate) /* OpenGL 2.0 */
3239  USE_GL_FUNC(glBlendFuncSeparate) /* OpenGL 1.4 */
3240  USE_GL_FUNC(glBufferData) /* OpenGL 1.5 */
3241  USE_GL_FUNC(glBufferSubData) /* OpenGL 1.5 */
3242  USE_GL_FUNC(glColorMaski) /* OpenGL 3.0 */
3243  USE_GL_FUNC(glCompileShader) /* OpenGL 2.0 */
3244  USE_GL_FUNC(glCompressedTexImage2D) /* OpenGL 1.3 */
3245  USE_GL_FUNC(glCompressedTexImage3D) /* OpenGL 1.3 */
3246  USE_GL_FUNC(glCompressedTexSubImage2D) /* OpenGL 1.3 */
3247  USE_GL_FUNC(glCompressedTexSubImage3D) /* OpenGL 1.3 */
3248  USE_GL_FUNC(glCreateProgram) /* OpenGL 2.0 */
3249  USE_GL_FUNC(glCreateShader) /* OpenGL 2.0 */
3250  USE_GL_FUNC(glDebugMessageCallback) /* OpenGL 4.3 */
3251  USE_GL_FUNC(glDebugMessageControl) /* OpenGL 4.3 */
3252  USE_GL_FUNC(glDebugMessageInsert) /* OpenGL 4.3 */
3253  USE_GL_FUNC(glDeleteBuffers) /* OpenGL 1.5 */
3254  USE_GL_FUNC(glDeleteProgram) /* OpenGL 2.0 */
3255  USE_GL_FUNC(glDeleteQueries) /* OpenGL 1.5 */
3256  USE_GL_FUNC(glDeleteShader) /* OpenGL 2.0 */
3257  USE_GL_FUNC(glDeleteVertexArrays) /* OpenGL 3.0 */
3258  USE_GL_FUNC(glDetachShader) /* OpenGL 2.0 */
3259  USE_GL_FUNC(glDisablei) /* OpenGL 3.0 */
3260  USE_GL_FUNC(glDisableVertexAttribArray) /* OpenGL 2.0 */
3261  USE_GL_FUNC(glDrawArraysInstanced) /* OpenGL 3.1 */
3262  USE_GL_FUNC(glDrawBuffers) /* OpenGL 2.0 */
3263  USE_GL_FUNC(glDrawElementsInstanced) /* OpenGL 3.1 */
3264  USE_GL_FUNC(glEnablei) /* OpenGL 3.0 */
3265  USE_GL_FUNC(glEnableVertexAttribArray) /* OpenGL 2.0 */
3266  USE_GL_FUNC(glEndQuery) /* OpenGL 1.5 */
3267  USE_GL_FUNC(glEndTransformFeedback) /* OpenGL 3.0 */
3268  USE_GL_FUNC(glFramebufferTexture) /* OpenGL 3.2 */
3269  USE_GL_FUNC(glGenBuffers) /* OpenGL 1.5 */
3270  USE_GL_FUNC(glGenQueries) /* OpenGL 1.5 */
3271  USE_GL_FUNC(glGenVertexArrays) /* OpenGL 3.0 */
3272  USE_GL_FUNC(glGetActiveUniform) /* OpenGL 2.0 */
3273  USE_GL_FUNC(glGetAttachedShaders) /* OpenGL 2.0 */
3274  USE_GL_FUNC(glGetAttribLocation) /* OpenGL 2.0 */
3275  USE_GL_FUNC(glGetBooleani_v) /* OpenGL 3.0 */
3276  USE_GL_FUNC(glGetBufferSubData) /* OpenGL 1.5 */
3277  USE_GL_FUNC(glGetCompressedTexImage) /* OpenGL 1.3 */
3278  USE_GL_FUNC(glGetDebugMessageLog) /* OpenGL 4.3 */
3279  USE_GL_FUNC(glGetIntegeri_v) /* OpenGL 3.0 */
3280  USE_GL_FUNC(glGetProgramInfoLog) /* OpenGL 2.0 */
3281  USE_GL_FUNC(glGetProgramiv) /* OpenGL 2.0 */
3282  USE_GL_FUNC(glGetQueryiv) /* OpenGL 1.5 */
3283  USE_GL_FUNC(glGetQueryObjectuiv) /* OpenGL 1.5 */
3284  USE_GL_FUNC(glGetShaderInfoLog) /* OpenGL 2.0 */
3285  USE_GL_FUNC(glGetShaderiv) /* OpenGL 2.0 */
3286  USE_GL_FUNC(glGetShaderSource) /* OpenGL 2.0 */
3287  USE_GL_FUNC(glGetStringi) /* OpenGL 3.0 */
3288  USE_GL_FUNC(glGetTextureLevelParameteriv) /* OpenGL 4.5 */
3289  USE_GL_FUNC(glGetTextureParameteriv) /* OpenGL 4.5 */
3290  USE_GL_FUNC(glGetUniformfv) /* OpenGL 2.0 */
3291  USE_GL_FUNC(glGetUniformiv) /* OpenGL 2.0 */
3292  USE_GL_FUNC(glGetUniformLocation) /* OpenGL 2.0 */
3293  USE_GL_FUNC(glIsEnabledi) /* OpenGL 3.0 */
3294  USE_GL_FUNC(glLinkProgram) /* OpenGL 2.0 */
3295  USE_GL_FUNC(glMapBuffer) /* OpenGL 1.5 */
3296  USE_GL_FUNC(glPointParameteri) /* OpenGL 1.4 */
3297  USE_GL_FUNC(glPointParameteriv) /* OpenGL 1.4 */
3298  USE_GL_FUNC(glShaderSource) /* OpenGL 2.0 */
3299  USE_GL_FUNC(glStencilFuncSeparate) /* OpenGL 2.0 */
3300  USE_GL_FUNC(glStencilOpSeparate) /* OpenGL 2.0 */
3301  USE_GL_FUNC(glTexBuffer) /* OpenGL 3.1 */
3302  USE_GL_FUNC(glTexImage3D) /* OpenGL 1.2 */
3303  USE_GL_FUNC(glTexSubImage3D) /* OpenGL 1.2 */
3304  USE_GL_FUNC(glTransformFeedbackVaryings) /* OpenGL 3.0 */
3305  USE_GL_FUNC(glUniform1f) /* OpenGL 2.0 */
3306  USE_GL_FUNC(glUniform1fv) /* OpenGL 2.0 */
3307  USE_GL_FUNC(glUniform1i) /* OpenGL 2.0 */
3308  USE_GL_FUNC(glUniform1iv) /* OpenGL 2.0 */
3309  USE_GL_FUNC(glUniform2f) /* OpenGL 2.0 */
3310  USE_GL_FUNC(glUniform2fv) /* OpenGL 2.0 */
3311  USE_GL_FUNC(glUniform2i) /* OpenGL 2.0 */
3312  USE_GL_FUNC(glUniform2iv) /* OpenGL 2.0 */
3313  USE_GL_FUNC(glUniform3f) /* OpenGL 2.0 */
3314  USE_GL_FUNC(glUniform3fv) /* OpenGL 2.0 */
3315  USE_GL_FUNC(glUniform3i) /* OpenGL 2.0 */
3316  USE_GL_FUNC(glUniform3iv) /* OpenGL 2.0 */
3317  USE_GL_FUNC(glUniform4f) /* OpenGL 2.0 */
3318  USE_GL_FUNC(glUniform4fv) /* OpenGL 2.0 */
3319  USE_GL_FUNC(glUniform4i) /* OpenGL 2.0 */
3320  USE_GL_FUNC(glUniform4iv) /* OpenGL 2.0 */
3321  USE_GL_FUNC(glUniformMatrix2fv) /* OpenGL 2.0 */
3322  USE_GL_FUNC(glUniformMatrix3fv) /* OpenGL 2.0 */
3323  USE_GL_FUNC(glUniformMatrix4fv) /* OpenGL 2.0 */
3324  USE_GL_FUNC(glUnmapBuffer) /* OpenGL 1.5 */
3325  USE_GL_FUNC(glUseProgram) /* OpenGL 2.0 */
3326  USE_GL_FUNC(glValidateProgram) /* OpenGL 2.0 */
3327  USE_GL_FUNC(glVertexAttrib1f) /* OpenGL 2.0 */
3328  USE_GL_FUNC(glVertexAttrib1fv) /* OpenGL 2.0 */
3329  USE_GL_FUNC(glVertexAttrib2f) /* OpenGL 2.0 */
3330  USE_GL_FUNC(glVertexAttrib2fv) /* OpenGL 2.0 */
3331  USE_GL_FUNC(glVertexAttrib3f) /* OpenGL 2.0 */
3332  USE_GL_FUNC(glVertexAttrib3fv) /* OpenGL 2.0 */
3333  USE_GL_FUNC(glVertexAttrib4f) /* OpenGL 2.0 */
3334  USE_GL_FUNC(glVertexAttrib4fv) /* OpenGL 2.0 */
3335  USE_GL_FUNC(glVertexAttrib4Nsv) /* OpenGL 2.0 */
3336  USE_GL_FUNC(glVertexAttrib4Nub) /* OpenGL 2.0 */
3337  USE_GL_FUNC(glVertexAttrib4Nubv) /* OpenGL 2.0 */
3338  USE_GL_FUNC(glVertexAttrib4Nusv) /* OpenGL 2.0 */
3339  USE_GL_FUNC(glVertexAttrib4sv) /* OpenGL 2.0 */
3340  USE_GL_FUNC(glVertexAttrib4ubv) /* OpenGL 2.0 */
3341  USE_GL_FUNC(glVertexAttribDivisor) /* OpenGL 3.3 */
3342  USE_GL_FUNC(glVertexAttribIPointer) /* OpenGL 3.0 */
3343  USE_GL_FUNC(glVertexAttribPointer) /* OpenGL 2.0 */
3344 #undef USE_GL_FUNC
3345 
3346 #ifndef USE_WIN32_OPENGL
3347  /* hack: use the functions directly from the TEB table to bypass the thunks */
3348  /* note that we still need the above wglGetProcAddress calls to initialize the table */
3349  gl_info->gl_ops.ext = ((struct opengl_funcs *)NtCurrentTeb()->glTable)->ext;
3350 #endif
3351 
3352 #define MAP_GL_FUNCTION(core_func, ext_func) \
3353  do \
3354  { \
3355  if (!gl_info->gl_ops.ext.p_##core_func) \
3356  gl_info->gl_ops.ext.p_##core_func = gl_info->gl_ops.ext.p_##ext_func; \
3357  } while (0)
3358 #define MAP_GL_FUNCTION_CAST(core_func, ext_func) \
3359  do \
3360  { \
3361  if (!gl_info->gl_ops.ext.p_##core_func) \
3362  gl_info->gl_ops.ext.p_##core_func = (void *)gl_info->gl_ops.ext.p_##ext_func; \
3363  } while (0)
3364 
3366  MAP_GL_FUNCTION(glAttachShader, glAttachObjectARB);
3367  MAP_GL_FUNCTION(glBeginQuery, glBeginQueryARB);
3368  MAP_GL_FUNCTION(glBindAttribLocation, glBindAttribLocationARB);
3369  MAP_GL_FUNCTION(glBindBuffer, glBindBufferARB);
3370  MAP_GL_FUNCTION(glBindFragDataLocation, glBindFragDataLocationEXT);
3371  MAP_GL_FUNCTION(glBlendColor, glBlendColorEXT);
3372  MAP_GL_FUNCTION(glBlendEquation, glBlendEquationEXT);
3373  MAP_GL_FUNCTION(glBlendEquationSeparate, glBlendEquationSeparateEXT);
3374  MAP_GL_FUNCTION(glBlendFuncSeparate, glBlendFuncSeparateEXT);
3375  MAP_GL_FUNCTION(glBufferData, glBufferDataARB);
3376  MAP_GL_FUNCTION(glBufferSubData, glBufferSubDataARB);
3377  MAP_GL_FUNCTION(glColorMaski, glColorMaskIndexedEXT);
3378  MAP_GL_FUNCTION(glCompileShader, glCompileShaderARB);
3379  MAP_GL_FUNCTION(glCompressedTexImage2D, glCompressedTexImage2DARB);
3380  MAP_GL_FUNCTION(glCompressedTexImage3D, glCompressedTexImage3DARB);
3381  MAP_GL_FUNCTION(glCompressedTexSubImage2D, glCompressedTexSubImage2DARB);
3382  MAP_GL_FUNCTION(glCompressedTexSubImage3D, glCompressedTexSubImage3DARB);
3383  MAP_GL_FUNCTION(glCreateProgram, glCreateProgramObjectARB);
3384  MAP_GL_FUNCTION(glCreateShader, glCreateShaderObjectARB);
3385  MAP_GL_FUNCTION(glDebugMessageCallback, glDebugMessageCallbackARB);
3386  MAP_GL_FUNCTION(glDebugMessageControl, glDebugMessageControlARB);
3387  MAP_GL_FUNCTION(glDebugMessageInsert, glDebugMessageInsertARB);
3388  MAP_GL_FUNCTION(glDeleteBuffers, glDeleteBuffersARB);
3389  MAP_GL_FUNCTION(glDeleteProgram, glDeleteObjectARB);
3390  MAP_GL_FUNCTION(glDeleteQueries, glDeleteQueriesARB);
3391  MAP_GL_FUNCTION(glDeleteShader, glDeleteObjectARB);
3392  MAP_GL_FUNCTION(glDetachShader, glDetachObjectARB);
3393  MAP_GL_FUNCTION(glDisablei, glDisableIndexedEXT);
3394  MAP_GL_FUNCTION(glDisableVertexAttribArray, glDisableVertexAttribArrayARB);
3395  MAP_GL_FUNCTION(glDrawArraysInstanced, glDrawArraysInstancedARB);
3396  MAP_GL_FUNCTION(glDrawBuffers, glDrawBuffersARB);
3397  MAP_GL_FUNCTION(glDrawElementsInstanced, glDrawElementsInstancedARB);
3398  MAP_GL_FUNCTION(glEnablei, glEnableIndexedEXT);
3399  MAP_GL_FUNCTION(glEnableVertexAttribArray, glEnableVertexAttribArrayARB);
3400  MAP_GL_FUNCTION(glEndQuery, glEndQueryARB);
3401  MAP_GL_FUNCTION(glFramebufferTexture, glFramebufferTextureARB);
3402  MAP_GL_FUNCTION(glGenBuffers, glGenBuffersARB);
3403  MAP_GL_FUNCTION(glGenQueries, glGenQueriesARB);
3404  MAP_GL_FUNCTION(glGetActiveUniform, glGetActiveUniformARB);
3405  MAP_GL_FUNCTION(glGetAttachedShaders, glGetAttachedObjectsARB);
3406  MAP_GL_FUNCTION(glGetAttribLocation, glGetAttribLocationARB);
3407  MAP_GL_FUNCTION(glGetBooleani_v, glGetBooleanIndexedvEXT);
3408  MAP_GL_FUNCTION(glGetBufferSubData, glGetBufferSubDataARB);
3409  MAP_GL_FUNCTION(glGetCompressedTexImage, glGetCompressedTexImageARB);
3410  MAP_GL_FUNCTION(glGetDebugMessageLog, glGetDebugMessageLogARB);
3411  MAP_GL_FUNCTION(glGetIntegeri_v, glGetIntegerIndexedvEXT);
3412  MAP_GL_FUNCTION(glGetProgramInfoLog, glGetInfoLogARB);
3413  MAP_GL_FUNCTION(glGetProgramiv, glGetObjectParameterivARB);
3414  MAP_GL_FUNCTION(glGetQueryiv, glGetQueryivARB);
3415  MAP_GL_FUNCTION(glGetQueryObjectuiv, glGetQueryObjectuivARB);
3416  MAP_GL_FUNCTION(glGetShaderInfoLog, glGetInfoLogARB);
3417  MAP_GL_FUNCTION(glGetShaderiv, glGetObjectParameterivARB);
3418  MAP_GL_FUNCTION(glGetShaderSource, glGetShaderSourceARB);
3419  MAP_GL_FUNCTION(glGetUniformfv, glGetUniformfvARB);
3420  MAP_GL_FUNCTION(glGetUniformiv, glGetUniformivARB);
3421  MAP_GL_FUNCTION(glGetUniformLocation, glGetUniformLocationARB);
3422  MAP_GL_FUNCTION(glIsEnabledi, glIsEnabledIndexedEXT);
3423  MAP_GL_FUNCTION(glLinkProgram, glLinkProgramARB);
3424  MAP_GL_FUNCTION(glMapBuffer, glMapBufferARB);
3425  MAP_GL_FUNCTION(glMinSampleShading, glMinSampleShadingARB);
3426  MAP_GL_FUNCTION_CAST(glShaderSource, glShaderSourceARB);
3427  MAP_GL_FUNCTION(glTexBuffer, glTexBufferARB);
3428  MAP_GL_FUNCTION_CAST(glTexImage3D, glTexImage3DEXT);
3429  MAP_GL_FUNCTION(glTexSubImage3D, glTexSubImage3DEXT);
3430  MAP_GL_FUNCTION(glUniform1f, glUniform1fARB);
3431  MAP_GL_FUNCTION(glUniform1fv, glUniform1fvARB);
3432  MAP_GL_FUNCTION(glUniform1i, glUniform1iARB);
3433  MAP_GL_FUNCTION(glUniform1iv, glUniform1ivARB);
3434  MAP_GL_FUNCTION(glUniform2f, glUniform2fARB);
3435  MAP_GL_FUNCTION(glUniform2fv, glUniform2fvARB);
3436  MAP_GL_FUNCTION(glUniform2i, glUniform2iARB);
3437  MAP_GL_FUNCTION(glUniform2iv, glUniform2ivARB);
3438  MAP_GL_FUNCTION(glUniform3f, glUniform3fARB);
3439  MAP_GL_FUNCTION(glUniform3fv, glUniform3fvARB);
3440  MAP_GL_FUNCTION(glUniform3i, glUniform3iARB);
3441  MAP_GL_FUNCTION(glUniform3iv, glUniform3ivARB);
3442  MAP_GL_FUNCTION(glUniform4f, glUniform4fARB);
3443  MAP_GL_FUNCTION(glUniform4fv, glUniform4fvARB);
3444  MAP_GL_FUNCTION(glUniform4i, glUniform4iARB);
3445  MAP_GL_FUNCTION(glUniform4iv, glUniform4ivARB);
3446  MAP_GL_FUNCTION(glUniformMatrix2fv, glUniformMatrix2fvARB);
3447  MAP_GL_FUNCTION(glUniformMatrix3fv, glUniformMatrix3fvARB);
3448  MAP_GL_FUNCTION(glUniformMatrix4fv, glUniformMatrix4fvARB);
3449  MAP_GL_FUNCTION(glUnmapBuffer, glUnmapBufferARB);
3450  MAP_GL_FUNCTION(glUseProgram, glUseProgramObjectARB);
3451  MAP_GL_FUNCTION(glValidateProgram, glValidateProgramARB);
3452  MAP_GL_FUNCTION(glVertexAttrib1f, glVertexAttrib1fARB);
3453  MAP_GL_FUNCTION(glVertexAttrib1fv, glVertexAttrib1fvARB);
3454  MAP_GL_FUNCTION(glVertexAttrib2f, glVertexAttrib2fARB);
3455  MAP_GL_FUNCTION(glVertexAttrib2fv, glVertexAttrib2fvARB);
3456  MAP_GL_FUNCTION(glVertexAttrib3f, glVertexAttrib3fARB);
3457  MAP_GL_FUNCTION(glVertexAttrib3fv, glVertexAttrib3fvARB);
3458  MAP_GL_FUNCTION(glVertexAttrib4f, glVertexAttrib4fARB);
3459  MAP_GL_FUNCTION(glVertexAttrib4fv, glVertexAttrib4fvARB);
3460  MAP_GL_FUNCTION(glVertexAttrib4Nsv, glVertexAttrib4NsvARB);
3461  MAP_GL_FUNCTION(glVertexAttrib4Nub, glVertexAttrib4NubARB);
3462  MAP_GL_FUNCTION(glVertexAttrib4Nubv, glVertexAttrib4NubvARB);
3463  MAP_GL_FUNCTION(glVertexAttrib4Nusv, glVertexAttrib4NusvARB);
3464  MAP_GL_FUNCTION(glVertexAttrib4sv, glVertexAttrib4svARB);
3465  MAP_GL_FUNCTION(glVertexAttrib4ubv, glVertexAttrib4ubvARB);
3466  MAP_GL_FUNCTION(glVertexAttribDivisor, glVertexAttribDivisorARB);
3467  MAP_GL_FUNCTION(glVertexAttribIPointer, glVertexAttribIPointerEXT);
3468  MAP_GL_FUNCTION(glVertexAttribPointer, glVertexAttribPointerARB);
3469 #undef MAP_GL_FUNCTION
3470 #undef MAP_GL_FUNCTION_CAST
3471 }
struct opengl_funcs gl_ops
GLAPI void GLAPIENTRY glMultiTexCoord1fvARB(GLenum target, const GLfloat *v)
GLAPI void GLAPIENTRY glClientActiveTextureARB(GLenum texture)
GLAPI void GLAPIENTRY glBlendEquation(GLenum mode)
GLAPI void GLAPIENTRY glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data)
#define MAP_GL_FUNCTION_CAST(core_func, ext_func)
GLAPI void GLAPIENTRY glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data)
GLAPI void GLAPIENTRY glMultiTexCoord4svARB(GLenum target, const GLshort *v)
GLAPI void GLAPIENTRY glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
char ext[3]
Definition: mkdosfs.c:358
GLAPI void GLAPIENTRY glMultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
GLAPI void GLAPIENTRY glMultiTexCoord2svARB(GLenum target, const GLshort *v)
GLAPI void GLAPIENTRY glMultiTexCoord4fvARB(GLenum target, const GLfloat *v)
GLAPI void GLAPIENTRY glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels)
GLAPI void GLAPIENTRY glCompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)
#define MAP_GL_FUNCTION(core_func, ext_func)
GLAPI void GLAPIENTRY glActiveTextureARB(GLenum texture)
GLAPI void GLAPIENTRY glGetCompressedTexImage(GLenum target, GLint lod, GLvoid *img)
GLAPI void GLAPIENTRY glMultiTexCoord2fvARB(GLenum target, const GLfloat *v)
GLAPI void GLAPIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
GLAPI void GLAPIENTRY glMultiTexCoord1fARB(GLenum target, GLfloat s)
GLAPI void GLAPIENTRY glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data)
GLAPI void GLAPIENTRY glActiveTexture(GLenum texture)
GLAPI void GLAPIENTRY glMultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
#define USE_GL_FUNC(pfn)
GLAPI void GLAPIENTRY glMultiTexCoord3fvARB(GLenum target, const GLfloat *v)
GLAPI void GLAPIENTRY glMultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)

Referenced by wined3d_adapter_init_gl_caps().

◆ match_allows_spec_alpha()

static BOOL match_allows_spec_alpha ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 675 of file directx.c.

678 {
679  GLenum error;
680  DWORD data[16];
681 
683  return FALSE;
684 
685  while (gl_info->gl_ops.gl.p_glGetError());
686  GL_EXTCALL(glSecondaryColorPointerEXT)(4, GL_UNSIGNED_BYTE, 4, data);
687  error = gl_info->gl_ops.gl.p_glGetError();
688 
689  if (error == GL_NO_ERROR)
690  {
691  TRACE("GL Implementation accepts 4 component specular color pointers\n");
692  return TRUE;
693  }
694  else
695  {
696  TRACE("GL implementation does not accept 4 component specular colors, error %s\n",
698  return FALSE;
699  }
700 }
#define TRUE
Definition: types.h:120
struct opengl_funcs gl_ops
#define error(str)
Definition: mkdosfs.c:1605
#define GL_UNSIGNED_BYTE
Definition: gl.h:178
#define GL_NO_ERROR
Definition: gl.h:693
BOOL supported[WINED3D_GL_EXT_COUNT]
const char * debug_glerror(GLenum error)
Definition: utils.c:4737
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
unsigned int GLenum
Definition: gl.h:150

◆ match_amd_r300_to_500()

static BOOL match_amd_r300_to_500 ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 522 of file directx.c.

525 {
526  if (card_vendor != HW_VENDOR_AMD) return FALSE;
527  if (device == CARD_AMD_RADEON_9500) return TRUE;
528  if (device == CARD_AMD_RADEON_X700) return TRUE;
529  if (device == CARD_AMD_RADEON_X1600) return TRUE;
530  return FALSE;
531 }
#define TRUE
Definition: types.h:120
Definition: devices.h:37
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

◆ match_apple()

static BOOL match_apple ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 549 of file directx.c.

552 {
553  /* MacOS has various specialities in the extensions it advertises. Some have to be loaded from
554  * the opengl 1.2+ core, while other extensions are advertised, but software emulated. So try to
555  * detect the Apple OpenGL implementation to apply some extension fixups afterwards.
556  *
557  * Detecting this isn't really easy. The vendor string doesn't mention Apple. Compile-time checks
558  * aren't sufficient either because a Linux binary may display on a macos X server via remote X11.
559  * So try to detect the GL implementation by looking at certain Apple extensions. Some extensions
560  * like client storage might be supported on other implementations too, but GL_APPLE_flush_render
561  * is specific to the Mac OS X window management, and GL_APPLE_ycbcr_422 is QuickTime specific. So
562  * the chance that other implementations support them is rather small since Win32 QuickTime uses
563  * DirectDraw, not OpenGL.
564  *
565  * This test has been moved into wined3d_guess_gl_vendor()
566  */
567  return gl_vendor == GL_VENDOR_APPLE;
568 }

◆ match_apple_intel()

static BOOL match_apple_intel ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 636 of file directx.c.

639 {
640  return (card_vendor == HW_VENDOR_INTEL) && (gl_vendor == GL_VENDOR_APPLE);
641 }
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

◆ match_apple_nonr500ati()

static BOOL match_apple_nonr500ati ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 643 of file directx.c.

646 {
647  if (gl_vendor != GL_VENDOR_APPLE) return FALSE;
648  if (card_vendor != HW_VENDOR_AMD) return FALSE;
649  if (device == CARD_AMD_RADEON_X1600) return FALSE;
650  return TRUE;
651 }
#define TRUE
Definition: types.h:120
Definition: devices.h:37
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

◆ match_broken_arb_fog()

static BOOL match_broken_arb_fog ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 842 of file directx.c.

845 {
846  DWORD data[4];
847  GLuint tex, fbo;
848  GLenum status;
849  float color[4] = {0.0f, 1.0f, 0.0f, 0.0f};
850  GLuint prog;
851  GLint err_pos;
852  static const char program_code[] =
853  "!!ARBfp1.0\n"
854  "OPTION ARB_fog_linear;\n"
855  "MOV result.color, {1.0, 0.0, 0.0, 0.0};\n"
856  "END\n";
857 
859  return FALSE;
860  if (!gl_info->supported[ARB_FRAGMENT_PROGRAM])
861  return FALSE;
862  if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
863  return FALSE;
864 
865  gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
866  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
867  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
868  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
869  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);
870  checkGLcall("glTexImage2D");
871 
872  gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
873  gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
874  gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
875  checkGLcall("glFramebufferTexture2D");
876 
877  status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
878  if (status != GL_FRAMEBUFFER_COMPLETE) ERR("FBO status %#x\n", status);
879  checkGLcall("glCheckFramebufferStatus");
880 
881  gl_info->gl_ops.gl.p_glClearColor(0.0f, 0.0f, 1.0f, 0.0f);
882  gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT);
883  checkGLcall("glClear");
884  gl_info->gl_ops.gl.p_glViewport(0, 0, 4, 1);
885  checkGLcall("glViewport");
886 
887  gl_info->gl_ops.gl.p_glEnable(GL_FOG);
888  gl_info->gl_ops.gl.p_glFogf(GL_FOG_START, 0.5f);
889  gl_info->gl_ops.gl.p_glFogf(GL_FOG_END, 0.5f);
890  gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
891  gl_info->gl_ops.gl.p_glHint(GL_FOG_HINT, GL_NICEST);
892  gl_info->gl_ops.gl.p_glFogfv(GL_FOG_COLOR, color);
893  checkGLcall("fog setup");
894 
895  GL_EXTCALL(glGenProgramsARB(1, &prog));
896  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, prog));
898  strlen(program_code), program_code));
899  gl_info->gl_ops.gl.p_glEnable(GL_FRAGMENT_PROGRAM_ARB);
900  checkGLcall("Test fragment program setup");
901 
902  gl_info->gl_ops.gl.p_glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &err_pos);
903  if (err_pos != -1)
904  {
905  const char *error_str;
906  error_str = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB);
907  FIXME("Fog test program error at position %d: %s\n\n", err_pos, debugstr_a(error_str));
908  }
909 
910  gl_info->gl_ops.gl.p_glBegin(GL_TRIANGLE_STRIP);
911  gl_info->gl_ops.gl.p_glVertex3f(-1.0f, -1.0f, 0.0f);
912  gl_info->gl_ops.gl.p_glVertex3f( 1.0f, -1.0f, 1.0f);
913  gl_info->gl_ops.gl.p_glVertex3f(-1.0f, 1.0f, 0.0f);
914  gl_info->gl_ops.gl.p_glVertex3f( 1.0f, 1.0f, 1.0f);
915  gl_info->gl_ops.gl.p_glEnd();
916  checkGLcall("ARBfp fog test draw");
917 
918  gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
919  checkGLcall("glGetTexImage");
920  data[0] &= 0x00ffffff;
921  data[1] &= 0x00ffffff;
922  data[2] &= 0x00ffffff;
923  data[3] &= 0x00ffffff;
924 
925  gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
926  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
927 
928  gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
929  gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
930  gl_info->gl_ops.gl.p_glDisable(GL_FOG);
931  GL_EXTCALL(glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0));
932  gl_info->gl_ops.gl.p_glDisable(GL_FRAGMENT_PROGRAM_ARB);
933  GL_EXTCALL(glDeleteProgramsARB(1, &prog));
934  checkGLcall("ARBfp fog test teardown");
935 
936  TRACE("Fog test data: %08x %08x %08x %08x\n", data[0], data[1], data[2], data[3]);
937  return data[0] != 0x00ff0000 || data[3] != 0x0000ff00;
938 }
#define ORM_FBO
#define GL_COLOR_BUFFER_BIT
Definition: gl.h:716
struct opengl_funcs gl_ops
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * prog
Definition: isohybrid.c:47
#define GL_NEAREST
Definition: gl.h:678
#define GL_FOG_HINT
Definition: gl.h:582
#define GL_RGB8
Definition: gl.h:755
#define GL_FOG_END
Definition: gl.h:420
#define GL_BGRA
Definition: gl.h:1485
#define GL_PROGRAM_ERROR_POSITION_ARB
Definition: glext.h:1400
#define GL_COLOR_ATTACHMENT0
Definition: glext.h:1714
GLuint color
Definition: glext.h:6243
#define FIXME(fmt,...)
Definition: debug.h:110
BOOL supported[WINED3D_GL_EXT_COUNT]
smooth NULL
Definition: ftsmooth.c:416
#define GL_FRAMEBUFFER
Definition: glext.h:1732
#define GL_TEXTURE_MIN_FILTER
Definition: gl.h:649
#define GL_FOG_MODE
Definition: gl.h:415
#define GL_FRAMEBUFFER_COMPLETE
Definition: glext.h:1707
#define GL_EXTCALL(f)
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define GL_FOG_COLOR
Definition: gl.h:417
#define debugstr_a
Definition: kernel32.h:31
#define GL_UNSIGNED_INT_8_8_8_8_REV
Definition: gl.h:1495
unsigned long DWORD
Definition: ntddk_ex.h:95
#define GL_LINEAR
Definition: gl.h:421
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define GL_PROGRAM_ERROR_STRING_ARB
Definition: glext.h:1404
#define GL_NICEST
Definition: gl.h:585
#define GL_FOG
Definition: gl.h:414
unsigned int GLenum
Definition: gl.h:150
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
#define GL_TEXTURE_MAG_FILTER
Definition: gl.h:648
#define checkGLcall(A)
#define GL_TEXTURE_2D
Definition: gl.h:645
#define GL_PROGRAM_FORMAT_ASCII_ARB
Definition: glext.h:1405
struct wined3d_fbo_ops fbo_ops
int GLint
Definition: gl.h:156
#define GL_TRIANGLE_STRIP
Definition: gl.h:195
static SERVICE_STATUS status
Definition: service.c:31
#define GL_FOG_START
Definition: gl.h:419
#define GL_FRAGMENT_PROGRAM_ARB
Definition: glext.h:1466
Definition: ps.c:97

◆ match_broken_nv_clip()

static BOOL match_broken_nv_clip ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 703 of file directx.c.

706 {
707  GLuint prog;
708  BOOL ret = FALSE;
709  GLint pos;
710  static const char testcode[] =
711  "!!ARBvp1.0\n"
712  "OPTION NV_vertex_program2;\n"
713  "MOV result.clip[0], 0.0;\n"
714  "MOV result.position, 0.0;\n"
715  "END\n";
716 
717  if (!gl_info->supported[NV_VERTEX_PROGRAM2_OPTION]) return FALSE;
718 
719  while (gl_info->gl_ops.gl.p_glGetError());
720 
721  GL_EXTCALL(glGenProgramsARB(1, &prog));
722  if(!prog)
723  {
724  ERR("Failed to create the NVvp clip test program\n");
725  return FALSE;
726  }
727  GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog));
729  strlen(testcode), testcode));
730  gl_info->gl_ops.gl.p_glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
731  if(pos != -1)
732  {
733  WARN("GL_NV_vertex_program2_option result.clip[] test failed\n");
734  TRACE("error: %s\n", debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
735  ret = TRUE;
736  while (gl_info->gl_ops.gl.p_glGetError());
737  }
738  else TRACE("GL_NV_vertex_program2_option result.clip[] test passed\n");
739 
740  GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0));
741  GL_EXTCALL(glDeleteProgramsARB(1, &prog));
742  checkGLcall("GL_NV_vertex_program2_option result.clip[] test cleanup");
743 
744  return ret;
745 }
#define TRUE
Definition: types.h:120
struct opengl_funcs gl_ops
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * prog
Definition: isohybrid.c:47
#define WARN(fmt,...)
Definition: debug.h:111
#define GL_PROGRAM_ERROR_POSITION_ARB
Definition: glext.h:1400
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL supported[WINED3D_GL_EXT_COUNT]
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
int ret
#define GL_PROGRAM_ERROR_STRING_ARB
Definition: glext.h:1404
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
#define GL_VERTEX_PROGRAM_ARB
Definition: glext.h:1385
#define checkGLcall(A)
#define GL_PROGRAM_FORMAT_ASCII_ARB
Definition: glext.h:1405
int GLint
Definition: gl.h:156

◆ match_broken_rgba16()

static BOOL match_broken_rgba16 ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 800 of file directx.c.

803 {
804  /* GL_RGBA16 uses GL_RGBA8 internally on Geforce 7 and older cards.
805  * This leads to graphical bugs in Half Life 2 and Unreal engine games. */
806  GLuint tex;
807  GLint size;
808 
809  gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
810  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
811  gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA16, 4, 4, 0, GL_RGBA, GL_UNSIGNED_SHORT, NULL);
812  checkGLcall("glTexImage2D");
813 
814  gl_info->gl_ops.gl.p_glGetTexLevelParameteriv(GL_TEXTURE_2D, 0, GL_TEXTURE_RED_SIZE, &size);
815  checkGLcall("glGetTexLevelParameteriv");
816  TRACE("Real color depth is %d\n", size);
817 
818  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
819  checkGLcall("glBindTexture");
820  gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
821  checkGLcall("glDeleteTextures");
822 
823  return size < 16;
824 }
#define GL_UNSIGNED_SHORT
Definition: gl.h:180
struct opengl_funcs gl_ops
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
GLsizeiptr size
Definition: glext.h:5919
unsigned int GLuint
Definition: gl.h:159
#define checkGLcall(A)
#define GL_TEXTURE_2D
Definition: gl.h:645
#define GL_TEXTURE_RED_SIZE
Definition: gl.h:661
int GLint
Definition: gl.h:156
#define GL_RGBA
Definition: gl.h:503
#define GL_RGBA16
Definition: gl.h:765

◆ match_broken_viewport_subpixel_bits()

static BOOL match_broken_viewport_subpixel_bits ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 940 of file directx.c.

943 {
944  if (!gl_info->supported[ARB_VIEWPORT_ARRAY])
945  return FALSE;
947  return FALSE;
949 }
#define ORM_FBO
BOOL supported[WINED3D_GL_EXT_COUNT]
BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx *ctx)
Definition: utils.c:3574

◆ match_dx10_capable()

static BOOL match_dx10_capable ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 653 of file directx.c.

656 {
657  /* DX9 cards support 40 single float varyings in hardware, most drivers report 32. ATI misreports
658  * 44 varyings. So assume that if we have more than 44 varyings we have a dx10 card.
659  * This detection is for the gl_ClipPos varying quirk. If a d3d9 card really supports more than 44
660  * varyings and we subtract one in dx9 shaders it's not going to hurt us because the dx9 limit is
661  * hardcoded
662  *
663  * dx10 cards usually have 64 varyings */
664  return gl_info->limits.glsl_varyings > 44;
665 }
struct wined3d_gl_limits limits

Referenced by match_not_dx10_capable().

◆ match_fbo_tex_update()

static BOOL match_fbo_tex_update ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 748 of file directx.c.

751 {
752  char data[4 * 4 * 4];
753  GLuint tex, fbo;
754  GLenum status;
755 
757 
758  memset(data, 0xcc, sizeof(data));
759 
760  gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
761  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
762  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
763  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
764  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);
765  checkGLcall("glTexImage2D");
766 
767  gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
768  gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
769  gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
770  checkGLcall("glFramebufferTexture2D");
771 
772  status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
773  if (status != GL_FRAMEBUFFER_COMPLETE) ERR("FBO status %#x\n", status);
774  checkGLcall("glCheckFramebufferStatus");
775 
776  memset(data, 0x11, sizeof(data));
777  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);
778  checkGLcall("glTexSubImage2D");
779 
780  gl_info->gl_ops.gl.p_glClearColor(0.996f, 0.729f, 0.745f, 0.792f);
781  gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT);
782  checkGLcall("glClear");
783 
784  gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
785  checkGLcall("glGetTexImage");
786 
787  gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
788  gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
789  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
790  checkGLcall("glBindTexture");
791 
792  gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
793  gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
794  checkGLcall("glDeleteTextures");
795 
796  return *(DWORD *)data == 0x11111111;
797 }
#define ORM_FBO
#define GL_COLOR_BUFFER_BIT
Definition: gl.h:716
struct opengl_funcs gl_ops
#define GL_NEAREST
Definition: gl.h:678
#define GL_BGRA
Definition: gl.h:1485
#define GL_COLOR_ATTACHMENT0
Definition: glext.h:1714
smooth NULL
Definition: ftsmooth.c:416
#define GL_FRAMEBUFFER
Definition: glext.h:1732
#define GL_TEXTURE_MIN_FILTER
Definition: gl.h:649
#define GL_FRAMEBUFFER_COMPLETE
Definition: glext.h:1707
GLfloat f
Definition: glext.h:7540
#define GL_UNSIGNED_INT_8_8_8_8_REV
Definition: gl.h:1495
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define GL_RGBA8
Definition: gl.h:762
unsigned int GLenum
Definition: gl.h:150
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
#define GL_TEXTURE_MAG_FILTER
Definition: gl.h:648
#define checkGLcall(A)
#define GL_TEXTURE_2D
Definition: gl.h:645
struct wined3d_fbo_ops fbo_ops
#define memset(x, y, z)
Definition: compat.h:39
static SERVICE_STATUS status
Definition: service.c:31
Definition: ps.c:97

◆ match_fglrx()

static BOOL match_fglrx ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 826 of file directx.c.

829 {
830  return gl_vendor == GL_VENDOR_FGLRX;
831 }

◆ match_geforce5()

static BOOL match_geforce5 ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 533 of file directx.c.

536 {
538  {
542  {
543  return TRUE;
544  }
545  }
546  return FALSE;
547 }
#define TRUE
Definition: types.h:120
Definition: devices.h:37
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

◆ match_not_dx10_capable()

static BOOL match_not_dx10_capable ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 667 of file directx.c.

670 {
671  return !match_dx10_capable(gl_info, ctx, gl_renderer, gl_vendor, card_vendor, device);
672 }
static BOOL match_dx10_capable(const struct wined3d_gl_info *gl_info, struct wined3d_caps_gl_ctx *ctx, const char *gl_renderer, enum wined3d_gl_vendor gl_vendor, enum wined3d_pci_vendor card_vendor, enum wined3d_pci_device device)
Definition: directx.c:653
Definition: devices.h:37
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

◆ match_r200()

static BOOL match_r200 ( const struct wined3d_gl_info gl_info,
struct wined3d_caps_gl_ctx ctx,
const char gl_renderer,
enum wined3d_gl_vendor  gl_vendor,
enum wined3d_pci_vendor  card_vendor,
enum wined3d_pci_device  device 
)
static

Definition at line 833 of file directx.c.

836 {
837  if (card_vendor != HW_VENDOR_AMD) return FALSE;
838  if (device == CARD_AMD_RADEON_8500) return TRUE;
839  return FALSE;
840 }
#define TRUE
Definition: types.h:120
Definition: devices.h:37
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2501

◆ parse_extension_string()

static void parse_extension_string ( struct wined3d_gl_info gl_info,
const char extensions,
const struct wined3d_extension_map map,
UINT  entry_count 
)
static

Definition at line 2643 of file directx.c.

2645 {
2646  while (*extensions)
2647  {
2648  const char *start;
2649  size_t len;
2650  UINT i;
2651 
2652  while (isspace(*extensions))
2653  ++extensions;
2654  start = extensions;
2655  while (!isspace(*extensions) && *extensions)
2656  ++extensions;
2657 
2658  len = extensions - start;
2659  if (!len)
2660  continue;
2661 
2662  TRACE("- %s.\n", debugstr_an(start, len));
2663 
2664  for (i = 0; i < entry_count; ++i)
2665  {
2666  if (len == strlen(map[i].extension_string)
2667  && !memcmp(start, map[i].extension_string, len))
2668  {
2669  TRACE(" FOUND: %s support.\n", map[i].extension_string);
2670  gl_info->supported[map[i].extension] = TRUE;
2671  break;
2672  }
2673  }
2674  }
2675 }
#define isspace(c)
Definition: acclib.h:69
#define TRUE
Definition: types.h:120
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
BOOL supported[WINED3D_GL_EXT_COUNT]
#define TRACE(s)
Definition: solgame.cpp:4
Definition: _map.h:44
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:47
GLenum GLsizei len
Definition: glext.h:6722
GLuint start
Definition: gl.h:1545
unsigned int UINT
Definition: ndis.h:50

Referenced by wined3d_adapter_init_gl_caps().

◆ position_d3dcolor()

static void WINE_GLAPI position_d3dcolor ( const void data)
static

Definition at line 6289 of file directx.c.

6290 {
6291  DWORD pos = *((const DWORD *)data);
6292 
6293  FIXME("Add a test for fixed function position from d3dcolor type.\n");
6294  context_get_current()->gl_info->gl_ops.gl.p_glVertex4s(D3DCOLOR_B_R(pos),
6295  D3DCOLOR_B_G(pos),
6296  D3DCOLOR_B_B(pos),
6297  D3DCOLOR_B_A(pos));
6298 }
#define FIXME(fmt,...)
Definition: debug.h:110
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
#define D3DCOLOR_B_B(dw)
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3DCOLOR_B_G(dw)
#define D3DCOLOR_B_R(dw)
#define D3DCOLOR_B_A(dw)

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ position_float4()

static void WINE_GLAPI position_float4 ( const void data)
static

Definition at line 6300 of file directx.c.

6301 {
6302  const GLfloat *pos = data;
6303 
6304  if (pos[3] != 0.0f && pos[3] != 1.0f)
6305  {
6306  float w = 1.0f / pos[3];
6307 
6308  context_get_current()->gl_info->gl_ops.gl.p_glVertex4f(pos[0] * w, pos[1] * w, pos[2] * w, w);
6309  }
6310  else
6311  {
6312  context_get_current()->gl_info->gl_ops.gl.p_glVertex3fv(pos);
6313  }
6314 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
GLfloat f
Definition: glext.h:7540
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
float GLfloat
Definition: gl.h:161

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ query_gpu_description()

static const struct gpu_description* query_gpu_description ( const struct wined3d_gl_info gl_info,
UINT64 vram_bytes 
)
static

Definition at line 1571 of file directx.c.

1572 {
1575  const struct gpu_description *gpu_description;
1576  static unsigned int once;
1577 
1578  if (gl_info->supported[WGL_WINE_QUERY_RENDERER])
1579  {
1580  GLuint value;
1581 
1582  if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_VENDOR_ID_WINE, &value)))
1583  vendor = value;
1584  if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_DEVICE_ID_WINE, &value)))
1585  device = value;
1586  if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_VIDEO_MEMORY_WINE, &value)))
1587  *vram_bytes = (UINT64)value * 1024 * 1024;
1588  TRACE("Card reports vendor PCI ID 0x%04x, device PCI ID 0x%04x, 0x%s bytes of video memory.\n",
1589  vendor, device, wine_dbgstr_longlong(*vram_bytes));
1590  }
1591  else if (gl_info->supported[NVX_GPU_MEMORY_INFO])
1592  {
1593  GLint vram_kb;
1594  gl_info->gl_ops.gl.p_glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &vram_kb);
1595 
1596  *vram_bytes = (UINT64)vram_kb * 1024;
1597  TRACE("Got 0x%s as video memory from NVX_GPU_MEMORY_INFO extension.\n",
1598  wine_dbgstr_longlong(*vram_bytes));
1599  }
1600 
1602  {
1604  TRACE("Overriding vendor PCI ID with 0x%04x.\n", vendor);
1605  }
1606 
1608  {
1610  TRACE("Overriding device PCI ID with 0x%04x.\n", device);
1611  }
1612 
1614  {
1615  *vram_bytes = wined3d_settings.emulated_textureram;
1616  TRACE("Overriding amount of video memory with 0x%s bytes.\n",
1617  wine_dbgstr_longlong(*vram_bytes));
1618  }
1619 
1623  ERR_(winediag)("Invalid GPU override %04x:%04x specified, ignoring.\n", vendor, device);
1624 
1625  return gpu_description;
1626 }
wined3d_pci_device
struct opengl_funcs gl_ops
#define ERR_(ch,...)
Definition: debug.h:156
#define WGL_RENDERER_DEVICE_ID_WINE
Definition: wgl.h:5048
#define PCI_DEVICE_NONE
Definition: devices.h:37
BOOL supported[WINED3D_GL_EXT_COUNT]
#define WGL_RENDERER_VIDEO_MEMORY_WINE
Definition: wgl.h:5058
#define WGL_RENDERER_VENDOR_ID_WINE
Definition: wgl.h:5056
#define GL_EXTCALL(f)
#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
Definition: wgl.h:1585
#define TRACE(s)
Definition: solgame.cpp:4
const WCHAR * vendor
Definition: db.cpp:860
unsigned short pci_vendor_id
#define PCI_VENDOR_NONE
unsigned short pci_device_id
GLsizei const GLfloat * value
Definition: glext.h:6069
static const struct gpu_description * get_gpu_description(enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
Definition: directx.c:1557
unsigned int GLuint
Definition: gl.h:159
static __inline const char * wine_dbgstr_longlong(ULONGLONG ll)
Definition: compat.h:41
int GLint
Definition: gl.h:156
unsigned long long UINT64
wined3d_pci_vendor

Referenced by wined3d_adapter_init_gl_caps().

◆ quirk_allows_specular_alpha()

static void quirk_allows_specular_alpha ( struct wined3d_gl_info gl_info)
static

Definition at line 1026 of file directx.c.

1027 {
1029 }
#define WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA

◆ quirk_amd_dx9()

static void quirk_amd_dx9 ( struct wined3d_gl_info gl_info)
static

Definition at line 960 of file directx.c.

961 {
962  /* MacOS advertises GL_ARB_texture_non_power_of_two on ATI r500 and earlier cards, although
963  * these cards only support GL_ARB_texture_rectangle(D3DPTEXTURECAPS_NONPOW2CONDITIONAL).
964  * If real NP2 textures are used, the driver falls back to software. We could just remove the
965  * extension and use GL_ARB_texture_rectangle instead, but texture_rectangle is inconvenient
966  * due to the non-normalized texture coordinates. Thus set an internal extension flag,
967  * GL_WINE_normalized_texrect, which signals the code that it can use non power of two textures
968  * as per GL_ARB_texture_non_power_of_two, but has to stick to the texture_rectangle limits.
969  *
970  * fglrx doesn't advertise GL_ARB_texture_non_power_of_two, but it advertises opengl 2.0 which
971  * has this extension promoted to core. The extension loading code sets this extension supported
972  * due to that, so this code works on fglrx as well. */
974  {
975  TRACE("GL_ARB_texture_non_power_of_two advertised on R500 or earlier card, removing.\n");
978  }
979 }
#define TRUE
Definition: types.h:120
BOOL supported[WINED3D_GL_EXT_COUNT]
#define TRACE(s)
Definition: solgame.cpp:4

◆ quirk_apple_glsl_constants()

static void quirk_apple_glsl_constants ( struct wined3d_gl_info gl_info)
static

Definition at line 951 of file directx.c.

952 {
953  /* MacOS needs uniforms for relative addressing offsets. This can accumulate to quite a few uniforms.
954  * Beyond that the general uniform isn't optimal, so reserve a number of uniforms. 12 vec4's should
955  * allow 48 different offsets or other helper immediate values. */
956  TRACE("Reserving 12 GLSL constants for compiler private use.\n");
957  gl_info->reserved_glsl_constants = max(gl_info->reserved_glsl_constants, 12);
958 }
#define max(a, b)
Definition: svc.c:63
#define TRACE(s)
Definition: solgame.cpp:4

◆ quirk_broken_arb_fog()

static void quirk_broken_arb_fog ( struct wined3d_gl_info gl_info)
static

Definition at line 1074 of file directx.c.

1075 {
1077 }
#define WINED3D_QUIRK_BROKEN_ARB_FOG

◆ quirk_broken_rgba16()

static void quirk_broken_rgba16 ( struct wined3d_gl_info gl_info)
static

Definition at line 1041 of file directx.c.

1042 {
1043  gl_info->quirks |= WINED3D_QUIRK_BROKEN_RGBA16;
1044 }
#define WINED3D_QUIRK_BROKEN_RGBA16

◆ quirk_broken_viewport_subpixel_bits()

static void quirk_broken_viewport_subpixel_bits ( struct wined3d_gl_info gl_info)
static

Definition at line 1079 of file directx.c.

1080 {
1081  if (gl_info->supported[ARB_CLIP_CONTROL])
1082  {
1083  TRACE("Disabling ARB_clip_control.\n");
1084  gl_info->supported[ARB_CLIP_CONTROL] = FALSE;
1085  }
1086 }
BOOL supported[WINED3D_GL_EXT_COUNT]
#define TRACE(s)
Definition: solgame.cpp:4

◆ quirk_clip_varying()

static void quirk_clip_varying ( struct wined3d_gl_info gl_info)
static

Definition at line 1021 of file directx.c.

1022 {
1024 }
#define WINED3D_QUIRK_GLSL_CLIP_VARYING

◆ quirk_disable_nvvp_clip()

static void quirk_disable_nvvp_clip ( struct wined3d_gl_info gl_info)
static

Definition at line 1031 of file directx.c.

1032 {
1034 }
#define WINED3D_QUIRK_NV_CLIP_BROKEN

◆ quirk_fbo_tex_update()

static void quirk_fbo_tex_update ( struct wined3d_gl_info gl_info)
static

Definition at line 1036 of file directx.c.

1037 {
1039 }
#define WINED3D_QUIRK_FBO_TEX_UPDATE

◆ quirk_infolog_spam()

static void quirk_infolog_spam ( struct wined3d_gl_info gl_info)
static

Definition at line 1046 of file directx.c.

1047 {
1048  gl_info->quirks |= WINED3D_QUIRK_INFO_LOG_SPAM;
1049 }
#define WINED3D_QUIRK_INFO_LOG_SPAM

◆ quirk_limited_tex_filtering()

static void quirk_limited_tex_filtering ( struct wined3d_gl_info gl_info)
static

Definition at line 1051 of file directx.c.

1052 {
1053  /* Nvidia GeForce 6xxx and 7xxx support accelerated VTF only on a few
1054  selected texture formats. They are apparently the only DX9 class GPUs
1055  supporting VTF.
1056  Also, DX9-era GPUs are somewhat limited with float textures
1057  filtering and blending. */
1059 }
#define WINED3D_QUIRK_LIMITED_TEX_FILTERING

◆ quirk_no_np2()

static void quirk_no_np2 ( struct wined3d_gl_info gl_info)
static

Definition at line 981 of file directx.c.

982 {
983  /* The nVidia GeForceFX series reports OpenGL 2.0 capabilities with the latest drivers versions, but
984  * doesn't explicitly advertise the ARB_tex_npot extension in the GL extension string.
985  * This usually means that ARB_tex_npot is supported in hardware as long as the application is staying
986  * within the limits enforced by the ARB_texture_rectangle extension. This however is not true for the
987  * FX series, which instantly falls back to a slower software path as soon as ARB_tex_npot is used.
988  * We therefore completely remove ARB_tex_npot from the list of supported extensions.
989  *
990  * Note that wine_normalized_texrect can't be used in this case because internally it uses ARB_tex_npot,
991  * triggering the software fallback. There is not much we can do here apart from disabling the
992  * software-emulated extension and re-enable ARB_tex_rect (which was previously disabled
993  * in wined3d_adapter_init_gl_caps).
994  * This fixup removes performance problems on both the FX 5900 and FX 5700 (e.g. for framebuffer
995  * post-processing effects in the game "Max Payne 2").
996  * The behaviour can be verified through a simple test app attached in bugreport #14724. */
997  TRACE("GL_ARB_texture_non_power_of_two advertised through OpenGL 2.0 on NV FX card, removing.\n");
1000 }
#define TRUE
Definition: types.h:120
BOOL supported[WINED3D_GL_EXT_COUNT]
#define TRACE(s)
Definition: solgame.cpp:4

◆ quirk_r200_constants()

static void quirk_r200_constants ( struct wined3d_gl_info gl_info)
static

Definition at line 1061 of file directx.c.

1062 {
1063  /* The Mesa r200 driver (and there is no other driver for this GPU Wine would run on)
1064  * loads some fog parameters (start, end, exponent, but not the color) into the
1065  * program.
1066  *
1067  * Apparently the fog hardware is only able to handle linear fog with a range of 0.0;1.0,
1068  * and it is the responsibility of the vertex pipeline to handle non-linear fog and
1069  * linear fog with start and end other than 0.0 and 1.0. */
1070  TRACE("Reserving 1 ARB constant for compiler private use.\n");
1071  gl_info->reserved_arb_constants = max(gl_info->reserved_arb_constants, 1);
1072 }
#define max(a, b)
Definition: svc.c:63
#define TRACE(s)
Definition: solgame.cpp:4

◆ quirk_texcoord_w()

static void quirk_texcoord_w ( struct wined3d_gl_info gl_info)
static

Definition at line 1002 of file directx.c.

1003 {
1004  /* The Intel GPUs on MacOS set the .w register of texcoords to 0.0 by default, which causes problems
1005  * with fixed function fragment processing. Ideally this flag should be detected with a test shader
1006  * and OpenGL feedback mode, but some GL implementations (MacOS ATI at least, probably all MacOS ones)
1007  * do not like vertex shaders in feedback mode and return an error, even though it should be valid
1008  * according to the spec.
1009  *
1010  * We don't want to enable this on all cards, as it adds an extra instruction per texcoord used. This
1011  * makes the shader slower and eats instruction slots which should be available to the d3d app.
1012  *
1013  * ATI Radeon HD 2xxx cards on MacOS have the issue. Instead of checking for the buggy cards, blacklist
1014  * all radeon cards on Macs and whitelist the good ones. That way we're prepared for the future. If
1015  * this workaround is activated on cards that do not need it, it won't break things, just affect
1016  * performance negatively. */
1017  TRACE("Enabling vertex texture coord fixes in vertex shaders.\n");
1019 }
#define TRACE(s)
Definition: solgame.cpp:4
#define WINED3D_QUIRK_SET_TEXCOORD_W

◆ select_card_handler()

static enum wined3d_pci_device select_card_handler ( const struct gl_vendor_selection table,
unsigned int  table_size,
enum wined3d_gl_vendor  gl_vendor,
const char gl_renderer 
)
static

Definition at line 2474 of file directx.c.

2476 {
2477  unsigned int i, j;
2478 
2479  for (i = 0; i < table_size; ++i)
2480  {
2481  if (table[i].gl_vendor != gl_vendor)
2482  continue;
2483 
2484  TRACE("Applying card selector \"%s\".\n", table[i].description);
2485 
2486  for (j = 0; j < table[i].cards_size; ++j)
2487  {
2488  if (strstr(gl_renderer, table[i].cards[j].renderer))
2489  return table[i].cards[j].id;
2490  }
2491  return PCI_DEVICE_NONE;
2492  }
2493  FIXME("Couldn't find a suitable card selector for GL vendor %04x (using GL_RENDERER %s)\n",
2494  gl_vendor, debugstr_a(gl_renderer));
2495 
2496  return PCI_DEVICE_NONE;
2497 }
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
const char * description
Definition: directx.c:2502
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define PCI_DEVICE_NONE
#define FIXME(fmt,...)
Definition: debug.h:110
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
LOCAL int table_size
Definition: write.c:65

Referenced by wined3d_guess_card().

◆ select_fragment_implementation()

static const struct fragment_pipeline* select_fragment_implementation ( const struct wined3d_gl_info gl_info,
const struct wined3d_shader_backend_ops shader_backend_ops 
)
static

Definition at line 2612 of file directx.c.

2614 {
2615  if (shader_backend_ops == &glsl_shader_backend && gl_info->supported[ARB_FRAGMENT_SHADER])
2616  return &glsl_fragment_pipe;
2617  if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
2618  return &arbfp_fragment_pipeline;
2619  if (gl_info->supported[ATI_FRAGMENT_SHADER])
2620  return &atifs_fragment_pipeline;
2621  if (gl_info->supported[NV_REGISTER_COMBINERS] && gl_info->supported[NV_TEXTURE_SHADER2])
2622  return &nvts_fragment_pipeline;
2623  if (gl_info->supported[NV_REGISTER_COMBINERS])
2624  return &nvrc_fragment_pipeline;
2625  return &ffp_fragment_pipeline;
2626 }
const struct fragment_pipeline nvrc_fragment_pipeline
const struct fragment_pipeline glsl_fragment_pipe
const struct fragment_pipeline ffp_fragment_pipeline
Definition: state.c:5322
const struct fragment_pipeline atifs_fragment_pipeline
BOOL supported[WINED3D_GL_EXT_COUNT]
const struct fragment_pipeline nvts_fragment_pipeline
const struct fragment_pipeline arbfp_fragment_pipeline
const struct wined3d_shader_backend_ops glsl_shader_backend

Referenced by wined3d_adapter_init_gl_caps().

◆ select_shader_backend()

static const struct wined3d_shader_backend_ops* select_shader_backend ( const struct wined3d_gl_info gl_info)
static

Definition at line 2628 of file directx.c.

2629 {
2630  BOOL glsl = wined3d_settings.glslRequested && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 20);
2631 
2632  if (glsl && gl_info->supported[ARB_VERTEX_SHADER] && gl_info->supported[ARB_FRAGMENT_SHADER])
2633  return &glsl_shader_backend;
2634  if (gl_info->supported[ARB_VERTEX_PROGRAM] && gl_info->supported[ARB_FRAGMENT_PROGRAM])
2636  if (glsl && (gl_info->supported[ARB_VERTEX_SHADER] || gl_info->supported[ARB_FRAGMENT_SHADER]))
2637  return &glsl_shader_backend;
2638  if (gl_info->supported[ARB_VERTEX_PROGRAM] || gl_info->supported[ARB_FRAGMENT_PROGRAM])
2640  return &none_shader_backend;
2641 }
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL supported[WINED3D_GL_EXT_COUNT]
const struct wined3d_shader_backend_ops none_shader_backend
Definition: shader.c:3303
#define MAKEDWORD_VERSION(maj, min)
const struct wined3d_shader_backend_ops glsl_shader_backend
const struct wined3d_shader_backend_ops arb_program_shader_backend

Referenced by wined3d_adapter_init_gl_caps().

◆ select_vertex_implementation()

static const struct wined3d_vertex_pipe_ops* select_vertex_implementation ( const struct wined3d_gl_info gl_info,
const struct wined3d_shader_backend_ops shader_backend_ops 
)
static

Definition at line 2604 of file directx.c.

2606 {
2607  if (shader_backend_ops == &glsl_shader_backend && gl_info->supported[ARB_VERTEX_SHADER])
2608  return &glsl_vertex_pipe;
2609  return &ffp_vertex_pipe;
2610 }
const struct wined3d_vertex_pipe_ops ffp_vertex_pipe
Definition: state.c:5251
const struct wined3d_vertex_pipe_ops glsl_vertex_pipe
BOOL supported[WINED3D_GL_EXT_COUNT]
const struct wined3d_shader_backend_ops glsl_shader_backend

Referenced by wined3d_adapter_init_gl_caps().

◆ specular_d3dcolor()

static void WINE_GLAPI specular_d3dcolor ( const void data)
static

Definition at line 6326 of file directx.c.

6327 {
6328  DWORD specularColor = *((const DWORD *)data);
6329  GLubyte d[] =
6330  {
6331  D3DCOLOR_B_R(specularColor),
6332  D3DCOLOR_B_G(specularColor),
6333  D3DCOLOR_B_B(specularColor)
6334  };
6335 
6336  context_get_current()->gl_info->gl_ops.ext.p_glSecondaryColor3ubvEXT(d);
6337 }
unsigned char GLubyte
Definition: gl.h:157
struct wined3d_context * context_get_current(void)
Definition: context.c:1495
#define D3DCOLOR_B_B(dw)
#define d
Definition: ke_i.h:81
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
#define D3DCOLOR_B_G(dw)
#define D3DCOLOR_B_R(dw)

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ test_arb_vs_offset_limit()

static BOOL test_arb_vs_offset_limit ( const struct wined3d_gl_info gl_info)
static

Definition at line 487 of file directx.c.

488 {
489  GLuint prog;
490  BOOL ret = FALSE;
491  static const char testcode[] =
492  "!!ARBvp1.0\n"
493  "PARAM C[66] = { program.env[0..65] };\n"
494  "ADDRESS A0;"
495  "PARAM zero = {0.0, 0.0, 0.0, 0.0};\n"
496  "ARL A0.x, zero.x;\n"
497  "MOV result.position, C[A0.x + 65];\n"
498  "END\n";
499 
500  while (gl_info->gl_ops.gl.p_glGetError());
501  GL_EXTCALL(glGenProgramsARB(1, &prog));
502  if(!prog) {
503  ERR("Failed to create an ARB offset limit test program\n");
504  }
505  GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog));
507  strlen(testcode), testcode));
508  if (gl_info->gl_ops.gl.p_glGetError())
509  {
510  TRACE("OpenGL implementation does not allow indirect addressing offsets > 63\n");
511  TRACE("error: %s\n", debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
512  ret = TRUE;
513  } else TRACE("OpenGL implementation allows offsets > 63\n");
514 
515  GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0));
516  GL_EXTCALL(glDeleteProgramsARB(1, &prog));
517  checkGLcall("ARB vp offset limit test cleanup");
518 
519  return ret;
520 }
#define TRUE
Definition: types.h:120
struct opengl_funcs gl_ops
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * prog
Definition: isohybrid.c:47
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
int ret
#define GL_PROGRAM_ERROR_STRING_ARB
Definition: glext.h:1404
#define ERR(fmt,...)
Definition: debug.h:109
unsigned int GLuint
Definition: gl.h:159
#define GL_VERTEX_PROGRAM_ARB
Definition: glext.h:1385
#define checkGLcall(A)
#define GL_PROGRAM_FORMAT_ASCII_ARB
Definition: glext.h:1405

Referenced by wined3d_adapter_init_gl_caps().

◆ test_pbo_functionality()

static void test_pbo_functionality ( struct wined3d_gl_info gl_info)
static

Definition at line 571 of file directx.c.

572 {
573  /* Some OpenGL implementations, namely Apple's Geforce 8 driver, advertises PBOs,
574  * but glTexSubImage from a PBO fails miserably, with the first line repeated over
575  * all the texture. This function detects this bug by its symptom and disables PBOs
576  * if the test fails.
577  *
578  * The test uploads a 4x4 texture via the PBO in the "native" format GL_BGRA,
579  * GL_UNSIGNED_INT_8_8_8_8_REV. This format triggers the bug, and it is what we use
580  * for D3DFMT_A8R8G8B8. Then the texture is read back without any PBO and the data
581  * read back is compared to the original. If they are equal PBOs are assumed to work,
582  * otherwise the PBO extension is disabled. */
583  GLuint texture, pbo;
584  static const unsigned int pattern[] =
585  {
586  0x00000000, 0x000000ff, 0x0000ff00, 0x40ff0000,
587  0x80ffffff, 0x40ffff00, 0x00ff00ff, 0x0000ffff,
588  0x00ffff00, 0x00ff00ff, 0x0000ffff, 0x000000ff,
589  0x80ff00ff, 0x0000ffff, 0x00ff00ff, 0x40ff00ff
590  };
591  unsigned int check[ARRAY_SIZE(pattern)];
592 
593  /* No PBO -> No point in testing them. */
594  if (!gl_info->supported[ARB_PIXEL_BUFFER_OBJECT]) return;
595 
596  while (gl_info->gl_ops.gl.p_glGetError());
597  gl_info->gl_ops.gl.p_glGenTextures(1, &texture);
598  gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, texture);
599 
600  gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, 0);
601  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);
602  checkGLcall("Specifying the PBO test texture");
603 
604  GL_EXTCALL(glGenBuffers(1, &pbo));
605  GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, pbo));
607  checkGLcall("Specifying the PBO test pbo");
608 
609  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);
610  checkGLcall("Loading the PBO test texture");
611 
612  GL_EXTCALL(glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0));
613 
614  gl_info->gl_ops.gl.p_glFinish(); /* just to be sure */
615 
616  memset(check, 0, sizeof(check));
617  gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, check);
618  checkGLcall("Reading back the PBO test texture");
619 
620  gl_info->gl_ops.gl.p_glDeleteTextures(1, &texture);
621  GL_EXTCALL(glDeleteBuffers(1, &pbo));
622  checkGLcall("PBO test cleanup");
623 
624  if (memcmp(check, pattern, sizeof(check)))
625  {
626  WARN_(d3d_perf)("PBO test failed, read back data doesn't match original.\n"
627  "Disabling PBOs. This may result in slower performance.\n");
629  }
630  else
631  {
632  TRACE("PBO test successful.\n");
633  }
634 }
struct opengl_funcs gl_ops
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
#define GL_STREAM_DRAW
Definition: glext.h:347
#define GL_BGRA
Definition: gl.h:1485
BOOL supported[WINED3D_GL_EXT_COUNT]
#define GL_PIXEL_UNPACK_BUFFER
Definition: glext.h:477
smooth NULL
Definition: ftsmooth.c:416
#define GL_EXTCALL(f)
#define TRACE(s)
Definition: solgame.cpp:4
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3433
GLenum GLuint texture
Definition: glext.h:6295
#define GL_UNSIGNED_INT_8_8_8_8_REV
Definition: gl.h:1495
void check(CONTEXT *pContext)
Definition: NtContinue.c:61
#define GL_RGBA8
Definition: gl.h:762
unsigned int GLuint
Definition: gl.h:159
#define ARRAY_SIZE(a)
Definition: main.h:24
#define checkGLcall(A)
#define GL_TEXTURE_2D
Definition: gl.h:645
#define memset(x, y, z)
Definition: compat.h:39
#define WARN_(ch,...)
Definition: debug.h:157
#define GL_TEXTURE_MAX_LEVEL
Definition: gl.h:1504
GLubyte * pattern
Definition: glext.h:7787

Referenced by fixup_extensions().

◆ warn_no_specular_func()

static void WINE_GLAPI warn_no_specular_func ( const void data)
static

Definition at line 6339 of file directx.c.

6340 {
6341  WARN("GL_EXT_secondary_color not supported.\n");
6342 }
#define WARN(fmt,...)
Definition: debug.h:111

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ WINE_DECLARE_DEBUG_CHANNEL() [1/2]

WINE_DECLARE_DEBUG_CHANNEL ( d3d_perf  )

◆ WINE_DECLARE_DEBUG_CHANNEL() [2/2]

WINE_DECLARE_DEBUG_CHANNEL ( winediag  )

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3d  )

◆ wined3d_adapter_cleanup()

static void wined3d_adapter_cleanup ( struct wined3d_adapter adapter)
static

Definition at line 451 of file directx.c.

452 {
453  heap_free(adapter->gl_info.formats);
454  heap_free(adapter->cfgs);
455 }
struct wined3d_pixel_format * cfgs
struct wined3d_gl_info gl_info
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by wined3d_decref().

◆ wined3d_adapter_init()

static BOOL wined3d_adapter_init ( struct wined3d_adapter adapter,
UINT  ordinal,
DWORD  wined3d_creation_flags 
)
static

Definition at line 6623 of file directx.c.

6624 {
6625  static const DWORD supported_gl_versions[] =
6626  {
6627  MAKEDWORD_VERSION(4, 4),
6628  MAKEDWORD_VERSION(3, 2),
6629  MAKEDWORD_VERSION(1, 0),
6630  };
6631  struct wined3d_gl_info *gl_info = &adapter->gl_info;
6632  struct wined3d_caps_gl_ctx caps_gl_ctx = {0};
6633  unsigned int i;
6634  DISPLAY_DEVICEW display_device;
6635  DWORD max_gl_version;
6636 
6637  TRACE("adapter %p, ordinal %u.\n", adapter, ordinal);
6638 
6639  adapter->ordinal = ordinal;
6640 
6641 /* Dynamically load all GL core functions */
6642 #ifdef USE_WIN32_OPENGL
6643  {
6644  HMODULE mod_gl = GetModuleHandleA("opengl32.dll");
6645 #define USE_GL_FUNC(f) gl_info->gl_ops.gl.p_##f = (void *)GetProcAddress(mod_gl, #f);
6647 #undef USE_GL_FUNC
6648  gl_info->gl_ops.wgl.p_wglSwapBuffers = (void *)GetProcAddress(mod_gl, "wglSwapBuffers");
6649  gl_info->gl_ops.wgl.p_wglGetPixelFormat = (void *)GetProcAddress(mod_gl, "wglGetPixelFormat");
6650  }
6651 #else
6652  /* To bypass the opengl32 thunks retrieve functions from the WGL driver instead of opengl32 */
6653  {
6654  HDC hdc = GetDC( 0 );
6655  const struct opengl_funcs *wgl_driver = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION );
6656  ReleaseDC( 0, hdc );
6657  if (!wgl_driver || wgl_driver == (void *)-1) return FALSE;
6658  gl_info->gl_ops.wgl = wgl_driver->wgl;
6659  gl_info->gl_ops.gl = wgl_driver->gl;
6660  }
6661 #endif
6662 
6663  glEnableWINE = gl_info->gl_ops.gl.p_glEnable;
6664  glDisableWINE = gl_info->gl_ops.gl.p_glDisable;
6665 
6666  if (!AllocateLocallyUniqueId(&adapter->luid))
6667  {
6668  ERR("Failed to set adapter LUID (%#x).\n", GetLastError());
6669  return FALSE;
6670  }
6671  TRACE("Allocated LUID %08x:%08x for adapter %p.\n",
6672  adapter->luid.HighPart, adapter->luid.LowPart, adapter);
6673 
6674  if (!wined3d_caps_gl_ctx_create(adapter, &caps_gl_ctx))
6675  {
6676  ERR("Failed to get a GL context for adapter %p.\n", adapter);
6677  return FALSE;
6678  }
6679 
6680  max_gl_version = get_max_gl_version(gl_info, wined3d_creation_flags);
6681  for (i = 0; i < ARRAY_SIZE(supported_gl_versions); ++i)
6682  {
6683  if (supported_gl_versions[i] <= max_gl_version)
6684  break;
6685  }
6686  if (i == ARRAY_SIZE(supported_gl_versions))
6687  {
6688  ERR_(winediag)("Requested invalid GL version %u.%u.\n",
6689  max_gl_version >> 16, max_gl_version & 0xffff);
6690  i = ARRAY_SIZE(supported_gl_versions) - 1;
6691  }
6692 
6693  for (; i < ARRAY_SIZE(supported_gl_versions); ++i)
6694  {
6695  gl_info->selected_gl_version = supported_gl_versions[i];
6696 
6697  if (wined3d_caps_gl_ctx_create_attribs(&caps_gl_ctx, gl_info))
6698  break;
6699 
6700  WARN("Couldn't create an OpenGL %u.%u context, trying fallback to a lower version.\n",
6701  supported_gl_versions[i] >> 16, supported_gl_versions[i] & 0xffff);
6702  }
6703 
6704  if (!wined3d_adapter_init_gl_caps(adapter, &caps_gl_ctx, wined3d_creation_flags))
6705  {
6706  ERR("Failed to initialize GL caps for adapter %p.\n", adapter);
6707  wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6708  return FALSE;
6709  }
6710 
6712  ERR_(winediag)("You are using the backbuffer for offscreen rendering. "
6713  "This is unsupported, and will be removed in a future version.\n");
6714 
6715  wined3d_adapter_init_fb_cfgs(adapter, caps_gl_ctx.dc);
6716  /* We haven't found any suitable formats. This should only happen in
6717  * case of GDI software rendering, which is pretty useless anyway. */
6718  if (!adapter->cfg_count)
6719  {
6720  WARN("No suitable pixel formats found.\n");
6721  wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6722  heap_free(adapter->cfgs);
6723  return FALSE;
6724  }
6725 
6726  if (!wined3d_adapter_init_format_info(adapter, &caps_gl_ctx))
6727  {
6728  ERR("Failed to initialize GL format info.\n");
6729  wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6730  heap_free(adapter->cfgs);
6731  return FALSE;
6732  }
6733 
6734  adapter->vram_bytes = adapter->driver_info.vram_bytes;
6735  adapter->vram_bytes_used = 0;
6736  TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->vram_bytes));
6737 
6738  display_device.cb = sizeof(display_device);
6739  EnumDisplayDevicesW(NULL, ordinal, &display_device, 0);
6740  TRACE("DeviceName: %s\n", debugstr_w(display_device.DeviceName));
6741  strcpyW(adapter->DeviceName, display_device.DeviceName);
6742 
6743  wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6744 
6746 
6747  return TRUE;
6748 }
struct opengl_funcs::@3514 wgl
#define TRUE
Definition: types.h:120
struct opengl_funcs gl_ops
struct wined3d_pixel_format * cfgs
static BOOL wined3d_caps_gl_ctx_create(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
Definition: directx.c:367
HDC WINAPI GetDC(_In_opt_ HWND)
unsigned int cfg_count
struct wined3d_driver_info driver_info
#define WARN(fmt,...)
Definition: debug.h:111
#define ERR_(ch,...)
Definition: debug.h:156
static HDC
Definition: imagelist.c:92
DWORD WINAPI GetLastError(VOID)
Definition: except.c:1059
static void wined3d_caps_gl_ctx_destroy(const struct wined3d_caps_gl_ctx *ctx)
Definition: directx.c:306
static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *caps_gl_ctx, DWORD wined3d_creation_flags)
Definition: directx.c:3837
struct opengl_funcs *CDECL __wine_get_wgl_driver(HDC hdc, UINT version)
struct wined3d_gl_info gl_info
WCHAR DeviceName[32]
Definition: wingdi.h:2796
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GL