ReactOS 0.4.15-dev-7958-gcd0bb1a
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 has_extension (const char *list, const char *ext)
 
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.

81{
91};
@ WINED3D_D3D_LEVEL_COUNT
Definition: directx.c:90
@ WINED3D_D3D_LEVEL_9_SM2
Definition: directx.c:86
@ WINED3D_D3D_LEVEL_7
Definition: directx.c:84
@ WINED3D_D3D_LEVEL_6
Definition: directx.c:83
@ WINED3D_D3D_LEVEL_5
Definition: directx.c:82
@ WINED3D_D3D_LEVEL_8
Definition: directx.c:85
@ WINED3D_D3D_LEVEL_9_SM3
Definition: directx.c:87
@ WINED3D_D3D_LEVEL_11
Definition: directx.c:89
@ WINED3D_D3D_LEVEL_10
Definition: directx.c:88

◆ 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.

42{
60};
@ DRIVER_UNKNOWN
Definition: directx.c:59
@ DRIVER_NVIDIA_GEFORCE6
Definition: directx.c:56
@ DRIVER_NVIDIA_GEFORCE2MX
Definition: directx.c:54
@ DRIVER_INTEL_GMA950
Definition: directx.c:50
@ DRIVER_AMD_R600
Definition: directx.c:46
@ DRIVER_INTEL_HD4000
Definition: directx.c:52
@ DRIVER_AMD_RAGE_128PRO
Definition: directx.c:43
@ DRIVER_INTEL_GMA900
Definition: directx.c:49
@ DRIVER_NVIDIA_TNT
Definition: directx.c:53
@ DRIVER_VMWARE
Definition: directx.c:58
@ DRIVER_INTEL_GMA3000
Definition: directx.c:51
@ DRIVER_NVIDIA_GEFORCEFX
Definition: directx.c:55
@ DRIVER_NVIDIA_GEFORCE8
Definition: directx.c:57
@ DRIVER_INTEL_GMA800
Definition: directx.c:48
@ DRIVER_AMD_RX
Definition: directx.c:47
@ DRIVER_AMD_R100
Definition: directx.c:44
@ DRIVER_AMD_R300
Definition: directx.c:45

◆ 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.

63{
69};
@ DRIVER_MODEL_NT6X
Definition: directx.c:68
@ DRIVER_MODEL_NT5X
Definition: directx.c:67
@ DRIVER_MODEL_GENERIC
Definition: directx.c:64
@ DRIVER_MODEL_WIN9X
Definition: directx.c:65
@ DRIVER_MODEL_NT40
Definition: directx.c:66

◆ 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.

72{
78};
@ GL_VENDOR_UNKNOWN
Definition: directx.c:73
@ GL_VENDOR_APPLE
Definition: directx.c:74
@ GL_VENDOR_MESA
Definition: directx.c:76
@ GL_VENDOR_FGLRX
Definition: directx.c:75
@ GL_VENDOR_NVIDIA
Definition: directx.c:77

Function Documentation

◆ adapter_adjust_memory()

UINT64 adapter_adjust_memory ( struct wined3d_adapter adapter,
INT64  amount 
)

Definition at line 441 of file directx.c.

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

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 5190 of file directx.c.

5193{
5194 /* Only allow depth/stencil formats */
5195 if (!(ds_format->depth_size || ds_format->stencil_size)) return FALSE;
5196
5197 /* Blacklist formats not supported on Windows */
5198 switch (ds_format->id)
5199 {
5200 case WINED3DFMT_S1_UINT_D15_UNORM: /* Breaks the shadowvol2 dx7 sdk sample */
5202 TRACE("[FAILED] - not supported on windows.\n");
5203 return FALSE;
5204
5205 default:
5206 break;
5207 }
5208
5210 {
5211 /* With FBOs WGL limitations do not apply, but the format needs to be FBO attachable */
5212 if (ds_format->flags[gl_type] & (WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL))
5213 return TRUE;
5214 }
5215 else
5216 {
5217 unsigned int i;
5218
5219 /* Walk through all WGL pixel formats to find a match */
5220 for (i = 0; i < adapter->cfg_count; ++i)
5221 {
5222 const struct wined3d_pixel_format *cfg = &adapter->cfgs[i];
5223 if (wined3d_check_pixel_format_color(&adapter->gl_info, cfg, display_format)
5224 && wined3d_check_pixel_format_depth(&adapter->gl_info, cfg, ds_format))
5225 return TRUE;
5226 }
5227 }
5228
5229 return FALSE;
5230}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
unsigned int flags[WINED3D_GL_RES_TYPE_COUNT]
enum wined3d_format_id id
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:5061
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:5041
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:131
#define WINED3DFMT_FLAG_STENCIL
#define ORM_FBO
#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 5233 of file directx.c.

5236{
5237 /* Filter out non-RT formats */
5238 if (!(check_format->flags[gl_type] & WINED3DFMT_FLAG_RENDERTARGET))
5239 return FALSE;
5241 return TRUE;
5243 {
5244 const struct wined3d_pixel_format *cfgs = adapter->cfgs;
5245 unsigned int i;
5246
5247 /* In backbuffer mode the front and backbuffer share the same WGL
5248 * pixelformat. The format must match in RGB, alpha is allowed to be
5249 * different. (Only the backbuffer can have alpha.) */
5250 if (adapter_format->red_size != check_format->red_size
5251 || adapter_format->green_size != check_format->green_size
5252 || adapter_format->blue_size != check_format->blue_size)
5253 {
5254 TRACE("[FAILED]\n");
5255 return FALSE;
5256 }
5257
5258 /* Check if there is a WGL pixel format matching the requirements, the format should also be window
5259 * drawable (not offscreen; e.g. Nvidia offers R5G6B5 for pbuffers even when X is running at 24bit) */
5260 for (i = 0; i < adapter->cfg_count; ++i)
5261 {
5262 if (cfgs[i].windowDrawable
5264 {
5265 TRACE("Pixel format %d is compatible with format %s.\n",
5267 return TRUE;
5268 }
5269 }
5270 }
5271 return FALSE;
5272}
const char * debug_d3dformat(enum wined3d_format_id format_id)
Definition: utils.c:3980
static BOOL check_format(LPSTR path, LPSTR inf)
Definition: misc.c:87
_In_ LONG iPixelFormat
Definition: winddi.h:3488
#define WINED3DFMT_FLAG_RENDERTARGET
#define ORM_BACKBUFFER

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 1869 of file directx.c.

1870{
1871 if (shader_caps->vs_version >= 5)
1872 return WINED3D_D3D_LEVEL_11;
1873 if (shader_caps->vs_version == 4)
1874 return WINED3D_D3D_LEVEL_10;
1875 if (shader_caps->vs_version == 3)
1876 {
1877 /* wined3d with default settings at the moment doesn't expose SM4+ on
1878 * Mesa drivers. */
1879 if (glsl_version >= MAKEDWORD_VERSION(4, 30))
1880 return WINED3D_D3D_LEVEL_11;
1881 if (glsl_version >= MAKEDWORD_VERSION(1, 30))
1882 return WINED3D_D3D_LEVEL_10;
1884 }
1885 if (shader_caps->vs_version == 2)
1887 if (shader_caps->vs_version == 1)
1888 return WINED3D_D3D_LEVEL_8;
1889
1891 return WINED3D_D3D_LEVEL_7;
1893 return WINED3D_D3D_LEVEL_6;
1894
1895 return WINED3D_D3D_LEVEL_5;
1896}
DWORD MaxSimultaneousTextures
unsigned int vs_version
#define WINED3DTEXOPCAPS_DOTPRODUCT3
Definition: wined3d.h:1168
#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 6327 of file directx.c.

6328{
6329 DWORD diffuseColor = *((const DWORD *)data);
6330
6331 context_get_current()->gl_info->gl_ops.gl.p_glColor4ub(D3DCOLOR_B_R(diffuseColor),
6332 D3DCOLOR_B_G(diffuseColor),
6333 D3DCOLOR_B_B(diffuseColor),
6334 D3DCOLOR_B_A(diffuseColor));
6335}
struct wined3d_context * context_get_current(void)
Definition: context.c:1507
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)
#define D3DCOLOR_B_B(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 2672 of file directx.c.

2674{
2675 const char *gl_extension_name;
2676 unsigned int i, j;
2677 GLint extensions_count;
2678
2679 gl_info->gl_ops.gl.p_glGetIntegerv(GL_NUM_EXTENSIONS, &extensions_count);
2680 for (i = 0; i < extensions_count; ++i)
2681 {
2682 gl_extension_name = (const char *)GL_EXTCALL(glGetStringi(GL_EXTENSIONS, i));
2683 TRACE("- %s.\n", debugstr_a(gl_extension_name));
2684 for (j = 0; j < map_entries_count; ++j)
2685 {
2686 if (!strcmp(gl_extension_name, map[j].extension_string))
2687 {
2688 TRACE("FOUND: %s support.\n", map[j].extension_string);
2689 gl_info->supported[map[j].extension] = TRUE;
2690 break;
2691 }
2692 }
2693 }
2694}
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
Definition: _map.h:48
#define GL_EXTENSIONS
Definition: gl.h:690
int GLint
Definition: gl.h:156
#define GL_NUM_EXTENSIONS
Definition: glext.h:517
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 debugstr_a
Definition: kernel32.h:31
BOOL supported[WINED3D_GL_EXT_COUNT]
struct opengl_funcs gl_ops
#define GL_EXTCALL(f)

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 1748 of file directx.c.

1751{
1752 unsigned int i;
1753
1754 for (i = 0; i < ARRAY_SIZE(quirk_table); ++i)
1755 {
1756 if (!quirk_table[i].match(gl_info, ctx, gl_renderer, gl_vendor, card_vendor, device)) continue;
1757 TRACE("Applying driver quirk \"%s\".\n", quirk_table[i].description);
1758 quirk_table[i].apply(gl_info);
1759 }
1760
1761 /* Find out if PBOs work as they are supposed to. */
1762 test_pbo_functionality(gl_info);
1763}
#define ARRAY_SIZE(A)
Definition: main.h:33
Definition: devices.h:37
Definition: match.c:28
enum wined3d_pci_vendor card_vendor
Definition: directx.c:2496
static const struct driver_quirk quirk_table[]
Definition: directx.c:1094
const char * description
Definition: directx.c:2497
static void test_pbo_functionality(struct wined3d_gl_info *gl_info)
Definition: directx.c:570

Referenced by wined3d_adapter_init_gl_caps().

◆ generic_d3dcolor()

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

Definition at line 6355 of file directx.c.

6356{
6357 DWORD color = *((const DWORD *)data);
6358
6359 context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4Nub(idx,
6362}
unsigned int idx
Definition: utils.c:41
GLuint color
Definition: glext.h:6243

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 6378 of file directx.c.

6379{
6380 float x = float_16_to_32(((const unsigned short *)data) + 0);
6381 float y = float_16_to_32(((const unsigned short *)data) + 1);
6382
6383 context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib2f(idx, x, y);
6384}
float float_16_to_32(const unsigned short in) DECLSPEC_HIDDEN
Definition: math.c:2203
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
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 6386 of file directx.c.

6387{
6388 float x = float_16_to_32(((const unsigned short *)data) + 0);
6389 float y = float_16_to_32(((const unsigned short *)data) + 1);
6390 float z = float_16_to_32(((const unsigned short *)data) + 2);
6391 float w = float_16_to_32(((const unsigned short *)data) + 3);
6392
6393 context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4f(idx, x, y, z, w);
6394}
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLdouble GLdouble z
Definition: glext.h:5874

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 6364 of file directx.c.

6365{
6366 const GLshort s[] = {((const GLshort *)data)[0], ((const GLshort *)data)[1], 0, 1};
6367
6368 context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4Nsv(idx, s);
6369}
short GLshort
Definition: gl.h:155
GLdouble s
Definition: gl.h:2039

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 6371 of file directx.c.

6372{
6373 const GLushort s[] = {((const GLushort *)data)[0], ((const GLushort *)data)[1], 0, 1};
6374
6375 context_get_current()->gl_info->gl_ops.ext.p_glVertexAttrib4Nusv(idx, s);
6376}
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 1531 of file directx.c.

1533{
1534 unsigned int i;
1535
1536 TRACE("Looking up version info for driver=%d driver_model=%d\n", driver, driver_model);
1537 for (i = 0; i < ARRAY_SIZE(driver_version_table); ++i)
1538 {
1540
1541 if (entry->driver == driver && (driver_model == DRIVER_MODEL_GENERIC
1542 || entry->driver_model == driver_model))
1543 {
1544 TRACE("Found driver \"%s\", version %u, subversion %u, build %u.\n",
1545 entry->driver_name, entry->version, entry->subversion, entry->build);
1546 return entry;
1547 }
1548 }
1549 return NULL;
1550}
#define NULL
Definition: types.h:112
uint32_t entry
Definition: isohybrid.c:63
struct @1669::@1670 driver
enum wined3d_driver_model driver_model
Definition: directx.c:1214
static const struct driver_version_information driver_version_table[]
Definition: directx.c:1222

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 1552 of file directx.c.

1554{
1555 unsigned int i;
1556
1557 for (i = 0; i < ARRAY_SIZE(gpu_description_table); ++i)
1558 {
1560 return &gpu_description_table[i];
1561 }
1562
1563 return NULL;
1564}
const WCHAR * vendor
Definition: db.cpp:872
static const struct gpu_description gpu_description_table[]
Definition: directx.c:1279

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 6618 of file directx.c.

6619{
6620 const char *gl_vendor, *gl_renderer;
6621
6624
6625 gl_vendor = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_VENDOR);
6626 gl_renderer = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_RENDERER);
6627 if (!gl_vendor || !gl_renderer
6628 || wined3d_guess_card_vendor(gl_vendor, gl_renderer) == HW_VENDOR_NVIDIA)
6630
6631 return MAKEDWORD_VERSION(4, 4);
6632}
#define HW_VENDOR_NVIDIA
Definition: builtin.c:4465
#define GL_RENDERER
Definition: gl.h:688
#define GL_VENDOR
Definition: gl.h:687
GLbitfield flags
Definition: glext.h:7161
static enum wined3d_pci_vendor wined3d_guess_card_vendor(const char *gl_vendor_string, const char *gl_renderer)
Definition: directx.c:1828
#define WINED3D_PIXEL_CENTER_INTEGER
Definition: wined3d.h:1322

Referenced by wined3d_adapter_init().

◆ has_extension()

static BOOL has_extension ( const char list,
const char ext 
)
static

Definition at line 6634 of file directx.c.

6635{
6636 size_t len = strlen(ext);
6637 while (list)
6638 {
6639 while (*list == ' ') list++;
6640 if (!strncmp(list, ext, len) && (!list[len] || list[len] == ' ')) return TRUE;
6641 list = strchr(list, ' ');
6642 }
6643 return FALSE;
6644}
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
char * strchr(const char *String, int ch)
Definition: utclib.c:501
Definition: list.h:37
static const WCHAR *const ext[]
Definition: module.c:53
GLenum GLsizei len
Definition: glext.h:6722

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 1623 of file directx.c.

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

Referenced by wined3d_adapter_init_gl_caps().

◆ invalid_func()

static void WINE_GLAPI invalid_func ( const void data)
static

Definition at line 6279 of file directx.c.

6280{
6281 ERR("Invalid vertex attribute function called.\n");
6282 DebugBreak();
6283}
void WINAPI DebugBreak(void)

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 6291 of file directx.c.

6292{
6293 ERR("Invalid attribute function called.\n");
6294 DebugBreak();
6295}

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 6285 of file directx.c.

6286{
6287 ERR("Invalid texcoord function called.\n");
6288 DebugBreak();
6289}

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 2696 of file directx.c.

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

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 674 of file directx.c.

677{
679 DWORD data[16];
680
681 if (!gl_info->supported[EXT_SECONDARY_COLOR])
682 return FALSE;
683
684 while (gl_info->gl_ops.gl.p_glGetError());
685 GL_EXTCALL(glSecondaryColorPointerEXT)(4, GL_UNSIGNED_BYTE, 4, data);
686 error = gl_info->gl_ops.gl.p_glGetError();
687
688 if (error == GL_NO_ERROR)
689 {
690 TRACE("GL Implementation accepts 4 component specular color pointers\n");
691 return TRUE;
692 }
693 else
694 {
695 TRACE("GL implementation does not accept 4 component specular colors, error %s\n",
697 return FALSE;
698 }
699}
const char * debug_glerror(GLenum error)
Definition: utils.c:4796
unsigned int GLenum
Definition: gl.h:150
#define GL_UNSIGNED_BYTE
Definition: gl.h:178
#define GL_NO_ERROR
Definition: gl.h:693
#define error(str)
Definition: mkdosfs.c:1605
@ EXT_SECONDARY_COLOR
Definition: wined3d_gl.h:168

◆ 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 521 of file directx.c.

524{
525 if (card_vendor != HW_VENDOR_AMD) return FALSE;
526 if (device == CARD_AMD_RADEON_9500) return TRUE;
527 if (device == CARD_AMD_RADEON_X700) return TRUE;
528 if (device == CARD_AMD_RADEON_X1600) return TRUE;
529 return FALSE;
530}
#define HW_VENDOR_AMD
Definition: builtin.c:4464
@ CARD_AMD_RADEON_X1600
@ CARD_AMD_RADEON_9500
@ CARD_AMD_RADEON_X700

◆ 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 548 of file directx.c.

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

◆ 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 635 of file directx.c.

638{
639 return (card_vendor == HW_VENDOR_INTEL) && (gl_vendor == GL_VENDOR_APPLE);
640}
#define HW_VENDOR_INTEL
Definition: builtin.c:4467

◆ 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 642 of file directx.c.

645{
646 if (gl_vendor != GL_VENDOR_APPLE) return FALSE;
647 if (card_vendor != HW_VENDOR_AMD) return FALSE;
648 if (device == CARD_AMD_RADEON_X1600) return FALSE;
649 return TRUE;
650}

◆ 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 841 of file directx.c.

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

◆ 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 702 of file directx.c.

705{
706 GLuint prog;
707 BOOL ret = FALSE;
708 GLint pos;
709 static const char testcode[] =
710 "!!ARBvp1.0\n"
711 "OPTION NV_vertex_program2;\n"
712 "MOV result.clip[0], 0.0;\n"
713 "MOV result.position, 0.0;\n"
714 "END\n";
715
716 if (!gl_info->supported[NV_VERTEX_PROGRAM2_OPTION]) return FALSE;
717
718 while (gl_info->gl_ops.gl.p_glGetError());
719
720 GL_EXTCALL(glGenProgramsARB(1, &prog));
721 if(!prog)
722 {
723 ERR("Failed to create the NVvp clip test program\n");
724 return FALSE;
725 }
726 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog));
728 strlen(testcode), testcode));
729 gl_info->gl_ops.gl.p_glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &pos);
730 if(pos != -1)
731 {
732 WARN("GL_NV_vertex_program2_option result.clip[] test failed\n");
733 TRACE("error: %s\n", debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
734 ret = TRUE;
735 while (gl_info->gl_ops.gl.p_glGetError());
736 }
737 else TRACE("GL_NV_vertex_program2_option result.clip[] test passed\n");
738
739 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0));
740 GL_EXTCALL(glDeleteProgramsARB(1, &prog));
741 checkGLcall("GL_NV_vertex_program2_option result.clip[] test cleanup");
742
743 return ret;
744}
#define WARN(fmt,...)
Definition: debug.h:112
unsigned int BOOL
Definition: ntddk_ex.h:94
#define GL_VERTEX_PROGRAM_ARB
Definition: glext.h:1385
int ret
@ NV_VERTEX_PROGRAM2_OPTION
Definition: wined3d_gl.h:203

◆ 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 799 of file directx.c.

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

◆ 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 937 of file directx.c.

940{
941 if (!gl_info->supported[ARB_VIEWPORT_ARRAY])
942 return FALSE;
944 return FALSE;
946}
BOOL wined3d_caps_gl_ctx_test_viewport_subpixel_bits(struct wined3d_caps_gl_ctx *ctx)
Definition: utils.c:3632
@ ARB_VIEWPORT_ARRAY
Definition: wined3d_gl.h:142

◆ 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 652 of file directx.c.

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

750{
751 char data[4 * 4 * 4];
752 GLuint tex, fbo;
754
756
757 memset(data, 0xcc, sizeof(data));
758
759 gl_info->gl_ops.gl.p_glGenTextures(1, &tex);
760 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, tex);
761 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
762 gl_info->gl_ops.gl.p_glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
763 gl_info->gl_ops.gl.p_glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
764 checkGLcall("glTexImage2D");
765
766 gl_info->fbo_ops.glGenFramebuffers(1, &fbo);
767 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
768 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex, 0);
769 checkGLcall("glFramebufferTexture2D");
770
771 status = gl_info->fbo_ops.glCheckFramebufferStatus(GL_FRAMEBUFFER);
772 if (status != GL_FRAMEBUFFER_COMPLETE) ERR("FBO status %#x\n", status);
773 checkGLcall("glCheckFramebufferStatus");
774
775 memset(data, 0x11, sizeof(data));
776 gl_info->gl_ops.gl.p_glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
777 checkGLcall("glTexSubImage2D");
778
779 gl_info->gl_ops.gl.p_glClearColor(0.996f, 0.729f, 0.745f, 0.792f);
780 gl_info->gl_ops.gl.p_glClear(GL_COLOR_BUFFER_BIT);
781 checkGLcall("glClear");
782
783 gl_info->gl_ops.gl.p_glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, data);
784 checkGLcall("glGetTexImage");
785
786 gl_info->fbo_ops.glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
787 gl_info->fbo_ops.glBindFramebuffer(GL_FRAMEBUFFER, 0);
788 gl_info->gl_ops.gl.p_glBindTexture(GL_TEXTURE_2D, 0);
789 checkGLcall("glBindTexture");
790
791 gl_info->fbo_ops.glDeleteFramebuffers(1, &fbo);
792 gl_info->gl_ops.gl.p_glDeleteTextures(1, &tex);
793 checkGLcall("glDeleteTextures");
794
795 return *(DWORD *)data == 0x11111111;
796}
#define GL_RGBA8
Definition: gl.h:762

◆ 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 825 of file directx.c.

828{
829 return gl_vendor == GL_VENDOR_FGLRX;
830}

◆ 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 532 of file directx.c.

535{
537 {
541 {
542 return TRUE;
543 }
544 }
545 return FALSE;
546}
@ CARD_NVIDIA_GEFORCEFX_5600
@ CARD_NVIDIA_GEFORCEFX_5200
@ CARD_NVIDIA_GEFORCEFX_5800

◆ 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 666 of file directx.c.

669{
670 return !match_dx10_capable(gl_info, ctx, gl_renderer, gl_vendor, card_vendor, device);
671}
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:652

◆ 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 832 of file directx.c.

835{
836 if (card_vendor != HW_VENDOR_AMD) return FALSE;
837 if (device == CARD_AMD_RADEON_8500) return TRUE;
838 return FALSE;
839}
@ CARD_AMD_RADEON_8500

◆ 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 2638 of file directx.c.

2640{
2641 while (*extensions)
2642 {
2643 const char *start;
2644 size_t len;
2645 UINT i;
2646
2647 while (isspace(*extensions))
2648 ++extensions;
2649 start = extensions;
2650 while (!isspace(*extensions) && *extensions)
2651 ++extensions;
2652
2653 len = extensions - start;
2654 if (!len)
2655 continue;
2656
2657 TRACE("- %s.\n", debugstr_an(start, len));
2658
2659 for (i = 0; i < entry_count; ++i)
2660 {
2661 if (len == strlen(map[i].extension_string)
2662 && !memcmp(start, map[i].extension_string, len))
2663 {
2664 TRACE(" FOUND: %s support.\n", map[i].extension_string);
2665 gl_info->supported[map[i].extension] = TRUE;
2666 break;
2667 }
2668 }
2669 }
2670}
#define isspace(c)
Definition: acclib.h:69
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
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 6300 of file directx.c.

6301{
6302 DWORD pos = *((const DWORD *)data);
6303
6304 FIXME("Add a test for fixed function position from d3dcolor type.\n");
6305 context_get_current()->gl_info->gl_ops.gl.p_glVertex4s(D3DCOLOR_B_R(pos),
6308 D3DCOLOR_B_A(pos));
6309}

Referenced by wined3d_adapter_init_ffp_attrib_ops().

◆ position_float4()

static void WINE_GLAPI position_float4 ( const void data)
static

Definition at line 6311 of file directx.c.

6312{
6313 const GLfloat *pos = data;
6314
6315 if (pos[3] != 0.0f && pos[3] != 1.0f)
6316 {
6317 float w = 1.0f / pos[3];
6318
6319 context_get_current()->gl_info->gl_ops.gl.p_glVertex4f(pos[0] * w, pos[1] * w, pos[2] * w, w);
6320 }
6321 else
6322 {
6323 context_get_current()->gl_info->gl_ops.gl.p_glVertex3fv(pos);
6324 }
6325}
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 1566 of file directx.c.

1567{
1570 const struct gpu_description *gpu_description;
1571 static unsigned int once;
1572
1573 if (gl_info->supported[WGL_WINE_QUERY_RENDERER])
1574 {
1575 GLuint value;
1576
1577 if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_VENDOR_ID_WINE, &value)))
1578 vendor = value;
1579 if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_DEVICE_ID_WINE, &value)))
1580 device = value;
1581 if (GL_EXTCALL(wglQueryCurrentRendererIntegerWINE(WGL_RENDERER_VIDEO_MEMORY_WINE, &value)))
1582 *vram_bytes = (UINT64)value * 1024 * 1024;
1583 TRACE("Card reports vendor PCI ID 0x%04x, device PCI ID 0x%04x, 0x%s bytes of video memory.\n",
1584 vendor, device, wine_dbgstr_longlong(*vram_bytes));
1585 }
1586 else if (gl_info->supported[NVX_GPU_MEMORY_INFO])
1587 {
1588 GLint vram_kb;
1589 gl_info->gl_ops.gl.p_glGetIntegerv(GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX, &vram_kb);
1590
1591 *vram_bytes = (UINT64)vram_kb * 1024;
1592 TRACE("Got 0x%s as video memory from NVX_GPU_MEMORY_INFO extension.\n",
1593 wine_dbgstr_longlong(*vram_bytes));
1594 }
1595
1597 {
1599 TRACE("Overriding vendor PCI ID with 0x%04x.\n", vendor);
1600 }
1601
1603 {
1605 TRACE("Overriding device PCI ID with 0x%04x.\n", device);
1606 }
1607
1609 {
1611 TRACE("Overriding amount of video memory with 0x%s bytes.\n",
1612 wine_dbgstr_longlong(*vram_bytes));
1613 }
1614
1618 ERR_(winediag)("Invalid GPU override %04x:%04x specified, ignoring.\n", vendor, device);
1619
1620 return gpu_description;
1621}
#define ERR_(ch,...)
Definition: debug.h:156
unsigned short pci_vendor_id
unsigned short pci_device_id
Definition: pdh_main.c:94
#define WGL_RENDERER_VENDOR_ID_WINE
Definition: wgl.h:5056
#define WGL_RENDERER_DEVICE_ID_WINE
Definition: wgl.h:5048
#define WGL_RENDERER_VIDEO_MEMORY_WINE
Definition: wgl.h:5058
#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX
Definition: wgl.h:1585
static const struct gpu_description * get_gpu_description(enum wined3d_pci_vendor vendor, enum wined3d_pci_device device)
Definition: directx.c:1552
@ WGL_WINE_QUERY_RENDERER
Definition: wined3d_gl.h:210
@ NVX_GPU_MEMORY_INFO
Definition: wined3d_gl.h:205
#define PCI_VENDOR_NONE
wined3d_pci_vendor
#define PCI_DEVICE_NONE
wined3d_pci_device

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 1023 of file directx.c.

1024{
1026}
#define WINED3D_QUIRK_ALLOWS_SPECULAR_ALPHA

◆ quirk_amd_dx9()

static void quirk_amd_dx9 ( struct wined3d_gl_info gl_info)
static

Definition at line 957 of file directx.c.

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

◆ quirk_apple_glsl_constants()

static void quirk_apple_glsl_constants ( struct wined3d_gl_info gl_info)
static

Definition at line 948 of file directx.c.

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

◆ quirk_broken_arb_fog()

static void quirk_broken_arb_fog ( struct wined3d_gl_info gl_info)
static

Definition at line 1071 of file directx.c.

1072{
1074}
#define WINED3D_QUIRK_BROKEN_ARB_FOG

◆ quirk_broken_rgba16()

static void quirk_broken_rgba16 ( struct wined3d_gl_info gl_info)
static

Definition at line 1038 of file directx.c.

1039{
1041}
#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 1076 of file directx.c.

1077{
1078 if (gl_info->supported[ARB_CLIP_CONTROL])
1079 {
1080 TRACE("Disabling ARB_clip_control.\n");
1081 gl_info->supported[ARB_CLIP_CONTROL] = FALSE;
1082 }
1083}
@ ARB_CLIP_CONTROL
Definition: wined3d_gl.h:49

◆ quirk_clip_varying()

static void quirk_clip_varying ( struct wined3d_gl_info gl_info)
static

Definition at line 1018 of file directx.c.

1019{
1021}
#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 1028 of file directx.c.

1029{
1031}
#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 1033 of file directx.c.

1034{
1036}
#define WINED3D_QUIRK_FBO_TEX_UPDATE

◆ quirk_infolog_spam()

static void quirk_infolog_spam ( struct wined3d_gl_info gl_info)
static

Definition at line 1043 of file directx.c.

1044{
1046}
#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 1048 of file directx.c.

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

◆ quirk_no_np2()

static void quirk_no_np2 ( struct wined3d_gl_info gl_info)
static

Definition at line 978 of file directx.c.

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

◆ quirk_r200_constants()

static void quirk_r200_constants ( struct wined3d_gl_info gl_info)
static

Definition at line 1058 of file directx.c.

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

◆ quirk_texcoord_w()

static void quirk_texcoord_w ( struct wined3d_gl_info gl_info)
static

Definition at line 999 of file directx.c.

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

2471{
2472 unsigned int i, j;
2473
2474 for (i = 0; i < table_size; ++i)
2475 {
2476 if (table[i].gl_vendor != gl_vendor)
2477 continue;
2478
2479 TRACE("Applying card selector \"%s\".\n", table[i].description);
2480
2481 for (j = 0; j < table[i].cards_size; ++j)
2482 {
2483 if (strstr(gl_renderer, table[i].cards[j].renderer))
2484 return table[i].cards[j].id;
2485 }
2486 return PCI_DEVICE_NONE;
2487 }
2488 FIXME("Couldn't find a suitable card selector for GL vendor %04x (using GL_RENDERER %s)\n",
2489 gl_vendor, debugstr_a(gl_renderer));
2490
2491 return PCI_DEVICE_NONE;
2492}
char * strstr(char *String1, char *String2)
Definition: utclib.c:653
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 2607 of file directx.c.

2609{
2610 if (shader_backend_ops == &glsl_shader_backend && gl_info->supported[ARB_FRAGMENT_SHADER])
2611 return &glsl_fragment_pipe;
2612 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
2614 if (gl_info->supported[ATI_FRAGMENT_SHADER])
2617 return &nvts_fragment_pipeline;
2618 if (gl_info->supported[NV_REGISTER_COMBINERS])
2619 return &nvrc_fragment_pipeline;
2620 return &ffp_fragment_pipeline;
2621}
const struct fragment_pipeline arbfp_fragment_pipeline
const struct fragment_pipeline atifs_fragment_pipeline
const struct fragment_pipeline ffp_fragment_pipeline
Definition: state.c:5921
const struct wined3d_shader_backend_ops glsl_shader_backend
const struct fragment_pipeline glsl_fragment_pipe
const struct fragment_pipeline nvts_fragment_pipeline
const struct fragment_pipeline nvrc_fragment_pipeline
@ NV_TEXTURE_SHADER2
Definition: wined3d_gl.h:199
@ ATI_FRAGMENT_SHADER
Definition: wined3d_gl.h:144
@ ARB_FRAGMENT_SHADER
Definition: wined3d_gl.h:71
@ NV_REGISTER_COMBINERS
Definition: wined3d_gl.h:194

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 2623 of file directx.c.

2624{
2626
2627 if (glsl && gl_info->supported[ARB_VERTEX_SHADER] && gl_info->supported[ARB_FRAGMENT_SHADER])
2628 return &glsl_shader_backend;
2631 if (glsl && (gl_info->supported[ARB_VERTEX_SHADER] || gl_info->supported[ARB_FRAGMENT_SHADER]))
2632 return &glsl_shader_backend;
2635 return &none_shader_backend;
2636}
const struct wined3d_shader_backend_ops arb_program_shader_backend
const struct wined3d_shader_backend_ops none_shader_backend
Definition: shader.c:3245
@ ARB_VERTEX_PROGRAM
Definition: wined3d_gl.h:139
@ ARB_VERTEX_SHADER
Definition: wined3d_gl.h:140

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 2599 of file directx.c.

2601{
2602 if (shader_backend_ops == &glsl_shader_backend && gl_info->supported[ARB_VERTEX_SHADER])
2603 return &glsl_vertex_pipe;
2604 return &ffp_vertex_pipe;
2605}
const struct wined3d_vertex_pipe_ops ffp_vertex_pipe
Definition: state.c:5850
const struct wined3d_vertex_pipe_ops glsl_vertex_pipe

Referenced by wined3d_adapter_init_gl_caps().

◆ specular_d3dcolor()

static void WINE_GLAPI specular_d3dcolor ( const void data)
static

Definition at line 6337 of file directx.c.

6338{
6339 DWORD specularColor = *((const DWORD *)data);
6340 GLubyte d[] =
6341 {
6342 D3DCOLOR_B_R(specularColor),
6343 D3DCOLOR_B_G(specularColor),
6344 D3DCOLOR_B_B(specularColor)
6345 };
6346
6347 context_get_current()->gl_info->gl_ops.ext.p_glSecondaryColor3ubvEXT(d);
6348}
unsigned char GLubyte
Definition: gl.h:157
#define d
Definition: ke_i.h:81

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 486 of file directx.c.

487{
488 GLuint prog;
489 BOOL ret = FALSE;
490 static const char testcode[] =
491 "!!ARBvp1.0\n"
492 "PARAM C[66] = { program.env[0..65] };\n"
493 "ADDRESS A0;"
494 "PARAM zero = {0.0, 0.0, 0.0, 0.0};\n"
495 "ARL A0.x, zero.x;\n"
496 "MOV result.position, C[A0.x + 65];\n"
497 "END\n";
498
499 while (gl_info->gl_ops.gl.p_glGetError());
500 GL_EXTCALL(glGenProgramsARB(1, &prog));
501 if(!prog) {
502 ERR("Failed to create an ARB offset limit test program\n");
503 }
504 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, prog));
506 strlen(testcode), testcode));
507 if (gl_info->gl_ops.gl.p_glGetError())
508 {
509 TRACE("OpenGL implementation does not allow indirect addressing offsets > 63\n");
510 TRACE("error: %s\n", debugstr_a((const char *)gl_info->gl_ops.gl.p_glGetString(GL_PROGRAM_ERROR_STRING_ARB)));
511 ret = TRUE;
512 } else TRACE("OpenGL implementation allows offsets > 63\n");
513
514 GL_EXTCALL(glBindProgramARB(GL_VERTEX_PROGRAM_ARB, 0));
515 GL_EXTCALL(glDeleteProgramsARB(1, &prog));
516 checkGLcall("ARB vp offset limit test cleanup");
517
518 return ret;
519}

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 570 of file directx.c.

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

Referenced by fixup_extensions().

◆ warn_no_specular_func()

static void WINE_GLAPI warn_no_specular_func ( const void data)
static

Definition at line 6350 of file directx.c.

6351{
6352 WARN("GL_EXT_secondary_color not supported.\n");
6353}

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 450 of file directx.c.

451{
452 heap_free(adapter->gl_info.formats);
453 heap_free(adapter->cfgs);
454}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76

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 6646 of file directx.c.

6647{
6648 static const DWORD supported_gl_versions[] =
6649 {
6650 MAKEDWORD_VERSION(4, 4),
6651 MAKEDWORD_VERSION(3, 2),
6652 MAKEDWORD_VERSION(1, 0),
6653 };
6654 struct wined3d_gl_info *gl_info = &adapter->gl_info;
6655 struct wined3d_caps_gl_ctx caps_gl_ctx = {0};
6656 unsigned int i;
6657 DISPLAY_DEVICEW display_device;
6658 DWORD max_gl_version;
6659
6660 TRACE("adapter %p, ordinal %u.\n", adapter, ordinal);
6661
6662 adapter->ordinal = ordinal;
6663
6664/* Dynamically load all GL core functions */
6665#ifdef USE_WIN32_OPENGL
6666 {
6667 HMODULE mod_gl = GetModuleHandleA("opengl32.dll");
6668#define USE_GL_FUNC(f) gl_info->gl_ops.gl.p_##f = (void *)GetProcAddress(mod_gl, #f);
6670#undef USE_GL_FUNC
6671 gl_info->gl_ops.wgl.p_wglSwapBuffers = (void *)GetProcAddress(mod_gl, "wglSwapBuffers");
6672 gl_info->gl_ops.wgl.p_wglGetPixelFormat = (void *)GetProcAddress(mod_gl, "wglGetPixelFormat");
6673 }
6674#else
6675 /* To bypass the opengl32 thunks retrieve functions from the WGL driver instead of opengl32 */
6676 {
6677 HDC hdc = GetDC( 0 );
6678 const struct opengl_funcs *wgl_driver = __wine_get_wgl_driver( hdc, WINE_WGL_DRIVER_VERSION );
6679 ReleaseDC( 0, hdc );
6680 if (!wgl_driver || wgl_driver == (void *)-1) return FALSE;
6681 gl_info->gl_ops.wgl = wgl_driver->wgl;
6682 gl_info->gl_ops.gl = wgl_driver->gl;
6683 }
6684#endif
6685
6686 glEnableWINE = gl_info->gl_ops.gl.p_glEnable;
6687 glDisableWINE = gl_info->gl_ops.gl.p_glDisable;
6688
6689 if (!AllocateLocallyUniqueId(&adapter->luid))
6690 {
6691 ERR("Failed to set adapter LUID (%#x).\n", GetLastError());
6692 return FALSE;
6693 }
6694 TRACE("Allocated LUID %08x:%08x for adapter %p.\n",
6695 adapter->luid.HighPart, adapter->luid.LowPart, adapter);
6696
6697 if (!wined3d_caps_gl_ctx_create(adapter, &caps_gl_ctx))
6698 {
6699 ERR("Failed to get a GL context for adapter %p.\n", adapter);
6700 return FALSE;
6701 }
6702
6703 max_gl_version = get_max_gl_version(gl_info, wined3d_creation_flags);
6704
6705 if (wined3d_creation_flags & WINED3D_REQUEST_D3D10)
6706 {
6707 const char *gl_extensions = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_EXTENSIONS);
6708 if (!has_extension(gl_extensions, "GL_ARB_compatibility"))
6709 {
6710 ERR_(winediag)("GL_ARB_compatibility not supported, requesting context with GL version 3.2.\n");
6711 max_gl_version = MAKEDWORD_VERSION(3, 2);
6712 }
6713 }
6714
6715 for (i = 0; i < ARRAY_SIZE(supported_gl_versions); ++i)
6716 {
6717 if (supported_gl_versions[i] <= max_gl_version)
6718 break;
6719 }
6720 if (i == ARRAY_SIZE(supported_gl_versions))
6721 {
6722 ERR_(winediag)("Requested invalid GL version %u.%u.\n",
6723 max_gl_version >> 16, max_gl_version & 0xffff);
6724 i = ARRAY_SIZE(supported_gl_versions) - 1;
6725 }
6726
6727 for (; i < ARRAY_SIZE(supported_gl_versions); ++i)
6728 {
6729 gl_info->selected_gl_version = supported_gl_versions[i];
6730
6731 if (wined3d_caps_gl_ctx_create_attribs(&caps_gl_ctx, gl_info))
6732 break;
6733
6734 WARN("Couldn't create an OpenGL %u.%u context, trying fallback to a lower version.\n",
6735 supported_gl_versions[i] >> 16, supported_gl_versions[i] & 0xffff);
6736 }
6737
6738 if (!wined3d_adapter_init_gl_caps(adapter, &caps_gl_ctx, wined3d_creation_flags))
6739 {
6740 ERR("Failed to initialize GL caps for adapter %p.\n", adapter);
6741 wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6742 return FALSE;
6743 }
6744
6746 ERR_(winediag)("You are using the backbuffer for offscreen rendering. "
6747 "This is unsupported, and will be removed in a future version.\n");
6748
6750 /* We haven't found any suitable formats. This should only happen in
6751 * case of GDI software rendering, which is pretty useless anyway. */
6752 if (!adapter->cfg_count)
6753 {
6754 WARN("No suitable pixel formats found.\n");
6755 wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6756 heap_free(adapter->cfgs);
6757 return FALSE;
6758 }
6759
6760 if (!wined3d_adapter_init_format_info(adapter, &caps_gl_ctx))
6761 {
6762 ERR("Failed to initialize GL format info.\n");
6763 wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6764 heap_free(adapter->cfgs);
6765 return FALSE;
6766 }
6767
6768 adapter->vram_bytes = adapter->driver_info.vram_bytes;
6769 adapter->vram_bytes_used = 0;
6770 TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->vram_bytes));
6771
6772 display_device.cb = sizeof(display_device);
6773 EnumDisplayDevicesW(NULL, ordinal, &display_device, 0);
6774 TRACE("DeviceName: %s\n", debugstr_w(display_device.DeviceName));
6775 strcpyW(adapter->DeviceName, display_device.DeviceName);
6776
6777 wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
6778
6780
6781 return TRUE;
6782}
BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
Definition: utils.c:3803
BOOL WINAPI AllocateLocallyUniqueId(PLUID Luid)
Definition: security.c:1218
#define GetProcAddress(x, y)
Definition: compat.h:753
HMODULE WINAPI DECLSPEC_HOTPATCH GetModuleHandleA(LPCSTR lpModuleName)
Definition: loader.c:812
#define debugstr_w
Definition: kernel32.h:32
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:92
#define strcpyW(d, s)
Definition: unicode.h:29
WCHAR DeviceName[32]
Definition: wingdi.h:2818
struct opengl_funcs::@3673 wgl
struct opengl_funcs::@3674 gl
const struct wined3d_gl_info * gl_info
#define ALL_WGL_FUNCS
Definition: wgl_driver.h:3031
#define WINE_WGL_DRIVER_VERSION
Definition: wgl_driver.h:10
struct opengl_funcs *CDECL __wine_get_wgl_driver(HDC hdc, UINT version)
BOOL WINAPI EnumDisplayDevicesW(LPCWSTR lpDevice, DWORD iDevNum, PDISPLAY_DEVICEW lpDisplayDevice, DWORD dwFlags)
Definition: display.c:78
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
static void wined3d_caps_gl_ctx_destroy(const struct wined3d_caps_gl_ctx *ctx)
Definition: directx.c:305
static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter *adapter, HDC dc)
Definition: directx.c:6491
static DWORD get_max_gl_version(const struct wined3d_gl_info *gl_info, DWORD flags)
Definition: directx.c:6618
static BOOL wined3d_caps_gl_ctx_create(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
Definition: directx.c:366
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:3847
static BOOL wined3d_caps_gl_ctx_create_attribs(struct wined3d_caps_gl_ctx *caps_gl_ctx, struct wined3d_gl_info *gl_info)
Definition: directx.c:336
static void wined3d_adapter_init_ffp_attrib_ops(struct wined3d_adapter *adapter)
Definition: directx.c:6396
static BOOL has_extension(const char *list, const char *ext)
Definition: directx.c:6634
#define WINED3D_REQUEST_D3D10
Definition: wined3d.h:1329
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

Referenced by wined3d_init().

◆ wined3d_adapter_init_fb_cfgs()

static void wined3d_adapter_init_fb_cfgs ( struct wined3d_adapter adapter,
HDC  dc 
)
static

Definition at line 6491 of file directx.c.

6492{
6493 const struct wined3d_gl_info *gl_info = &adapter->gl_info;
6494 int i;
6495
6496 if (gl_info->supported[WGL_ARB_PIXEL_FORMAT])
6497 {
6498 UINT attrib_count = 0;
6499 GLint cfg_count;
6500 int attribs[11];
6501 int values[11];
6502 int attribute;
6503
6505 GL_EXTCALL(wglGetPixelFormatAttribivARB(dc, 0, 0, 1, &attribute, &cfg_count));
6506
6507 adapter->cfgs = heap_calloc(cfg_count, sizeof(*adapter->cfgs));
6508 attribs[attrib_count++] = WGL_RED_BITS_ARB;
6509 attribs[attrib_count++] = WGL_GREEN_BITS_ARB;
6510 attribs[attrib_count++] = WGL_BLUE_BITS_ARB;
6511 attribs[attrib_count++] = WGL_ALPHA_BITS_ARB;
6512 attribs[attrib_count++] = WGL_COLOR_BITS_ARB;
6513 attribs[attrib_count++] = WGL_DEPTH_BITS_ARB;
6514 attribs[attrib_count++] = WGL_STENCIL_BITS_ARB;
6515 attribs[attrib_count++] = WGL_DRAW_TO_WINDOW_ARB;
6516 attribs[attrib_count++] = WGL_PIXEL_TYPE_ARB;
6517 attribs[attrib_count++] = WGL_DOUBLE_BUFFER_ARB;
6518 attribs[attrib_count++] = WGL_AUX_BUFFERS_ARB;
6519
6520 for (i = 0, adapter->cfg_count = 0; i < cfg_count; ++i)
6521 {
6522 struct wined3d_pixel_format *cfg = &adapter->cfgs[adapter->cfg_count];
6523 int format_id = i + 1;
6524
6525 if (!GL_EXTCALL(wglGetPixelFormatAttribivARB(dc, format_id, 0, attrib_count, attribs, values)))
6526 continue;
6527
6528 cfg->iPixelFormat = format_id;
6529 cfg->redSize = values[0];
6530 cfg->greenSize = values[1];
6531 cfg->blueSize = values[2];
6532 cfg->alphaSize = values[3];
6533 cfg->colorSize = values[4];
6534 cfg->depthSize = values[5];
6535 cfg->stencilSize = values[6];
6536 cfg->windowDrawable = values[7];
6537 cfg->iPixelType = values[8];
6538 cfg->doubleBuffer = values[9];
6539 cfg->auxBuffers = values[10];
6540
6541 cfg->numSamples = 0;
6542 /* Check multisample support. */
6543 if (gl_info->supported[ARB_MULTISAMPLE])
6544 {
6546 int values[2];
6547
6548 if (GL_EXTCALL(wglGetPixelFormatAttribivARB(dc, format_id, 0, 2, attribs, values)))
6549 {
6550 /* values[0] = WGL_SAMPLE_BUFFERS_ARB which tells whether
6551 * multisampling is supported. values[1] = number of
6552 * multisample buffers. */
6553 if (values[0])
6554 cfg->numSamples = values[1];
6555 }
6556 }
6557
6558 TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, "
6559 "depth=%d, stencil=%d, samples=%d, windowDrawable=%d\n",
6560 cfg->iPixelFormat, cfg->iPixelType, cfg->doubleBuffer,
6561 cfg->redSize, cfg->greenSize, cfg->blueSize, cfg->alphaSize,
6562 cfg->depthSize, cfg->stencilSize, cfg->numSamples, cfg->windowDrawable);
6563
6564 ++adapter->cfg_count;
6565 }
6566 }
6567 else
6568 {
6569 int cfg_count;
6570
6571 cfg_count = DescribePixelFormat(dc, 0, 0, 0);
6572 adapter->cfgs = heap_calloc(cfg_count, sizeof(*adapter->cfgs));
6573
6574 for (i = 0, adapter->cfg_count = 0; i < cfg_count; ++i)
6575 {
6576 struct wined3d_pixel_format *cfg = &adapter->cfgs[adapter->cfg_count];
6578 int format_id = i + 1;
6579
6580 if (!DescribePixelFormat(dc, format_id, sizeof(pfd), &pfd))
6581 continue;
6582
6583 /* We only want HW acceleration using an OpenGL ICD driver.
6584 * PFD_GENERIC_FORMAT = slow opengl 1.1 gdi software rendering.
6585 * PFD_GENERIC_ACCELERATED = partial hw acceleration using a MCD
6586 * driver (e.g. 3dfx minigl). */
6588 {
6589 TRACE("Skipping format %d because it isn't ICD accelerated.\n", format_id);
6590 continue;
6591 }
6592
6593 cfg->iPixelFormat = format_id;
6594 cfg->redSize = pfd.cRedBits;
6595 cfg->greenSize = pfd.cGreenBits;
6596 cfg->blueSize = pfd.cBlueBits;
6597 cfg->alphaSize = pfd.cAlphaBits;
6598 cfg->colorSize = pfd.cColorBits;
6599 cfg->depthSize = pfd.cDepthBits;
6601 cfg->windowDrawable = (pfd.dwFlags & PFD_DRAW_TO_WINDOW) ? 1 : 0;
6603 cfg->doubleBuffer = (pfd.dwFlags & PFD_DOUBLEBUFFER) ? 1 : 0;
6604 cfg->auxBuffers = pfd.cAuxBuffers;
6605 cfg->numSamples = 0;
6606
6607 TRACE("iPixelFormat=%d, iPixelType=%#x, doubleBuffer=%d, RGBA=%d/%d/%d/%d, "
6608 "depth=%d, stencil=%d, windowDrawable=%d\n",
6609 cfg->iPixelFormat, cfg->iPixelType, cfg->doubleBuffer,
6610 cfg->redSize, cfg->greenSize, cfg->blueSize, cfg->alphaSize,
6611 cfg->depthSize, cfg->stencilSize, cfg->windowDrawable);
6612
6613 ++adapter->cfg_count;
6614 }
6615 }
6616}
GLboolean GLenum GLenum GLvoid * values
Definition: glext.h:5666
const GLint * attribs
Definition: glext.h:10538
static const WCHAR dc[]
static UINT format_id
Definition: clipboard.c:1343
static void * heap_calloc(SIZE_T count, SIZE_T size)
Definition: heap.h:49
static PIXELFORMATDESCRIPTOR pfd
Definition: ssstars.c:67
#define WGL_STENCIL_BITS_ARB
Definition: wgl.h:5064
#define WGL_BLUE_BITS_ARB
Definition: wgl.h:4998
#define WGL_GREEN_BITS_ARB
Definition: wgl.h:5026
#define WGL_ALPHA_BITS_ARB
Definition: wgl.h:4973
#define WGL_PIXEL_TYPE_ARB
Definition: wgl.h:5044
#define WGL_DEPTH_BITS_ARB
Definition: wgl.h:5012
#define WGL_DOUBLE_BUFFER_ARB
Definition: wgl.h:5015
#define WGL_TYPE_COLORINDEX_ARB
Definition: wgl.h:5098
#define WGL_SAMPLES_ARB
Definition: wgl.h:5059
#define WGL_DRAW_TO_WINDOW_ARB
Definition: wgl.h:5018
#define WGL_TYPE_RGBA_ARB
Definition: wgl.h:5099
#define WGL_NUMBER_PIXEL_FORMATS_ARB
Definition: wgl.h:5038
#define WGL_SAMPLE_BUFFERS_ARB
Definition: wgl.h:5060
#define WGL_RED_BITS_ARB
Definition: wgl.h:5045
#define WGL_AUX_BUFFERS_ARB
Definition: wgl.h:4985
#define WGL_COLOR_BITS_ARB
Definition: wgl.h:5000
@ WGL_ARB_PIXEL_FORMAT
Definition: wined3d_gl.h:207
@ ARB_MULTISAMPLE
Definition: wined3d_gl.h:84
int WINAPI DescribePixelFormat(_In_ HDC hdc, _In_ int iPixelFormat, _In_ UINT nBytes, _Out_writes_bytes_opt_(nBytes) LPPIXELFORMATDESCRIPTOR ppfd)
#define PFD_GENERIC_FORMAT
Definition: wingdi.h:307
#define PFD_DRAW_TO_WINDOW
Definition: wingdi.h:303
#define PFD_GENERIC_ACCELERATED
Definition: wingdi.h:313
#define PFD_TYPE_RGBA
Definition: wingdi.h:296
#define PFD_DOUBLEBUFFER
Definition: wingdi.h:301

Referenced by wined3d_adapter_init().

◆ wined3d_adapter_init_ffp_attrib_ops()

static void wined3d_adapter_init_ffp_attrib_ops ( struct wined3d_adapter adapter)
static

Definition at line 6396 of file directx.c.

6397{
6398 const struct wined3d_gl_info *gl_info = &adapter->gl_info;
6399 struct wined3d_d3d_info *d3d_info = &adapter->d3d_info;
6400 struct wined3d_ffp_attrib_ops *ops = &d3d_info->ffp_attrib_ops;
6401 unsigned int i;
6402
6403 for (i = 0; i < WINED3D_FFP_EMIT_COUNT; ++i)
6404 {
6405 ops->position[i] = invalid_func;
6406 ops->diffuse[i] = invalid_func;
6407 ops->specular[i] = invalid_func;
6408 ops->normal[i] = invalid_func;
6411 }
6412
6413 ops->position[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glVertex3fv;
6414 if (!d3d_info->xyzrhw)
6416 else
6417 ops->position[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glVertex4fv;
6419 ops->position[WINED3D_FFP_EMIT_SHORT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glVertex2sv;
6420
6421 ops->diffuse[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor3fv;
6422 ops->diffuse[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4fv;
6424 ops->diffuse[WINED3D_FFP_EMIT_UBYTE4N] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4ubv;
6425 ops->diffuse[WINED3D_FFP_EMIT_SHORT4N] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4sv;
6426 ops->diffuse[WINED3D_FFP_EMIT_USHORT4N] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glColor4usv;
6427
6428 /* No 4 component entry points here. */
6429 if (gl_info->supported[EXT_SECONDARY_COLOR])
6430 ops->specular[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)GL_EXTCALL(glSecondaryColor3fvEXT);
6431 else
6433 if (gl_info->supported[EXT_SECONDARY_COLOR])
6435 else
6437
6438 /* Only 3 component entry points here. Test how others behave. Float4
6439 * normals are used by one of our tests, trying to pass it to the pixel
6440 * shader, which fails on Windows. */
6441 ops->normal[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glNormal3fv;
6442 /* Just ignore the 4th value. */
6443 ops->normal[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_attrib_func)gl_info->gl_ops.gl.p_glNormal3fv;
6444
6445 ops->texcoord[WINED3D_FFP_EMIT_FLOAT1] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord1fvARB;
6446 ops->texcoord[WINED3D_FFP_EMIT_FLOAT2] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord2fvARB;
6447 ops->texcoord[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord3fvARB;
6448 ops->texcoord[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord4fvARB;
6449 ops->texcoord[WINED3D_FFP_EMIT_SHORT2] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord2svARB;
6450 ops->texcoord[WINED3D_FFP_EMIT_SHORT4] = (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord4svARB;
6451 if (gl_info->supported[NV_HALF_FLOAT])
6452 {
6453 /* Not supported by ARB_HALF_FLOAT_VERTEX, so check for NV_HALF_FLOAT. */
6455 (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord2hvNV;
6457 (wined3d_ffp_texcoord_func)gl_info->gl_ops.ext.p_glMultiTexCoord4hvNV;
6458 }
6459
6460 ops->generic[WINED3D_FFP_EMIT_FLOAT1] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib1fv;
6461 ops->generic[WINED3D_FFP_EMIT_FLOAT2] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib2fv;
6462 ops->generic[WINED3D_FFP_EMIT_FLOAT3] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib3fv;
6463 ops->generic[WINED3D_FFP_EMIT_FLOAT4] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4fv;
6464 if (gl_info->supported[ARB_VERTEX_ARRAY_BGRA])
6466 else
6468 (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4Nubv;
6469 ops->generic[WINED3D_FFP_EMIT_UBYTE4] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4ubv;
6470 ops->generic[WINED3D_FFP_EMIT_SHORT2] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib2sv;
6471 ops->generic[WINED3D_FFP_EMIT_SHORT4] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4sv;
6472 ops->generic[WINED3D_FFP_EMIT_UBYTE4N] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4Nubv;
6474 ops->generic[WINED3D_FFP_EMIT_SHORT4N] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4Nsv;
6476 ops->generic[WINED3D_FFP_EMIT_USHORT4N] = (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4Nusv;
6477 if (gl_info->supported[NV_HALF_FLOAT] && gl_info->supported[NV_VERTEX_PROGRAM])
6478 {
6480 (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib2hvNV;
6482 (wined3d_generic_attrib_func)gl_info->gl_ops.ext.p_glVertexAttrib4hvNV;
6483 }
6484 else
6485 {
6488 }
6489}
struct wined3d_ffp_attrib_ops ffp_attrib_ops
wined3d_ffp_texcoord_func texcoord[WINED3D_FFP_EMIT_COUNT]
wined3d_ffp_attrib_func position[WINED3D_FFP_EMIT_COUNT]
wined3d_generic_attrib_func generic[WINED3D_FFP_EMIT_COUNT]
wined3d_ffp_attrib_func normal[WINED3D_FFP_EMIT_COUNT]
wined3d_ffp_attrib_func specular[WINED3D_FFP_EMIT_COUNT]
wined3d_ffp_attrib_func diffuse[WINED3D_FFP_EMIT_COUNT]
static void WINE_GLAPI diffuse_d3dcolor(const void *data)
Definition: directx.c:6327
static void WINE_GLAPI generic_float16_2(GLuint idx, const void *data)
Definition: directx.c:6378
static void WINE_GLAPI invalid_func(const void *data)
Definition: directx.c:6279
static void WINE_GLAPI generic_d3dcolor(GLuint idx, const void *data)
Definition: directx.c:6355
static void WINE_GLAPI position_d3dcolor(const void *data)
Definition: directx.c:6300
static void WINE_GLAPI generic_ushort2n(GLuint idx, const void *data)
Definition: directx.c:6371
static void WINE_GLAPI specular_d3dcolor(const void *data)
Definition: directx.c:6337
static void WINE_GLAPI generic_short2n(GLuint idx, const void *data)
Definition: directx.c:6364
static void WINE_GLAPI generic_float16_4(GLuint idx, const void *data)
Definition: directx.c:6386
static void WINE_GLAPI invalid_texcoord_func(GLenum unit, const void *data)
Definition: directx.c:6285
static void WINE_GLAPI warn_no_specular_func(const void *data)
Definition: directx.c:6350
static void WINE_GLAPI invalid_generic_attrib_func(GLuint idx, const void *data)
Definition: directx.c:6291
static void WINE_GLAPI position_float4(const void *data)
Definition: directx.c:6311
@ NV_HALF_FLOAT
Definition: wined3d_gl.h:191
@ NV_VERTEX_PROGRAM
Definition: wined3d_gl.h:200
@ ARB_VERTEX_ARRAY_BGRA
Definition: wined3d_gl.h:136
void(WINE_GLAPI * wined3d_ffp_texcoord_func)(GLenum unit, const void *data)
@ WINED3D_FFP_EMIT_D3DCOLOR
@ WINED3D_FFP_EMIT_FLOAT16_2
@ WINED3D_FFP_EMIT_UBYTE4N
@ WINED3D_FFP_EMIT_COUNT
@ WINED3D_FFP_EMIT_FLOAT2
@ WINED3D_FFP_EMIT_SHORT4N
@ WINED3D_FFP_EMIT_USHORT2N
@ WINED3D_FFP_EMIT_SHORT2N
@ WINED3D_FFP_EMIT_UBYTE4
@ WINED3D_FFP_EMIT_FLOAT4
@ WINED3D_FFP_EMIT_FLOAT3
@ WINED3D_FFP_EMIT_FLOAT16_4
@ WINED3D_FFP_EMIT_USHORT4N
@ WINED3D_FFP_EMIT_SHORT2
@ WINED3D_FFP_EMIT_SHORT4
@ WINED3D_FFP_EMIT_FLOAT1
void(WINE_GLAPI * wined3d_ffp_attrib_func)(const void *data)
void(WINE_GLAPI * wined3d_generic_attrib_func)(GLuint idx, const void *data)

Referenced by wined3d_adapter_init().

◆ wined3d_adapter_init_gl_caps()

static BOOL wined3d_adapter_init_gl_caps ( struct wined3d_adapter adapter,
struct wined3d_caps_gl_ctx caps_gl_ctx,
DWORD  wined3d_creation_flags 
)
static

Definition at line 3847 of file directx.c.

3849{
3850 static const struct
3851 {
3852 enum wined3d_gl_extension extension;
3853 DWORD min_gl_version;
3854 }
3855 core_extensions[] =
3856 {
3898 /* We don't want to enable EXT_GPU_SHADER4: even though similar
3899 * functionality is available in core GL 3.0 / GLSL 1.30, it's different
3900 * enough that reusing the same flag for the new features hurts more
3901 * than it helps. */
3902 /* EXT_framebuffer_object, EXT_framebuffer_blit,
3903 * EXT_framebuffer_multisample and EXT_packed_depth_stencil
3904 * are integrated into ARB_framebuffer_object. */
3905
3911 /* We don't need or want GL_ARB_texture_rectangle (core in 3.1). */
3912
3914 /* ARB_geometry_shader4 exposes a somewhat different API compared to 3.2
3915 * core geometry shaders so it's not really correct to expose the
3916 * extension for core-only support. */
3920 {ARB_SYNC, MAKEDWORD_VERSION(3, 2)},
3923
3933
3941
3944
3955
3971
3973
3977
3980 };
3981 struct wined3d_driver_info *driver_info = &adapter->driver_info;
3982 const char *gl_vendor_str, *gl_renderer_str, *gl_version_str;
3983 struct wined3d_gl_info *gl_info = &adapter->gl_info;
3984 const struct gpu_description *gpu_description;
3985 struct wined3d_vertex_caps vertex_caps;
3987 struct shader_caps shader_caps;
3988 const char *WGL_Extensions = NULL;
3989 enum wined3d_gl_vendor gl_vendor;
3990 DWORD gl_version, gl_ext_emul_mask;
3991 UINT64 vram_bytes = 0;
3992 HDC hdc;
3993 unsigned int i, j;
3994 GLint context_profile = 0;
3995
3996 TRACE("adapter %p.\n", adapter);
3997
3998 gl_renderer_str = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_RENDERER);
3999 TRACE("GL_RENDERER: %s.\n", debugstr_a(gl_renderer_str));
4000 if (!gl_renderer_str)
4001 {
4002 ERR("Received a NULL GL_RENDERER.\n");
4003 return FALSE;
4004 }
4005
4006 gl_vendor_str = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_VENDOR);
4007 TRACE("GL_VENDOR: %s.\n", debugstr_a(gl_vendor_str));
4008 if (!gl_vendor_str)
4009 {
4010 ERR("Received a NULL GL_VENDOR.\n");
4011 return FALSE;
4012 }
4013
4014 /* Parse the GL_VERSION field into major and minor information */
4015 gl_version_str = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_VERSION);
4016 TRACE("GL_VERSION: %s.\n", debugstr_a(gl_version_str));
4017 if (!gl_version_str)
4018 {
4019 ERR("Received a NULL GL_VERSION.\n");
4020 return FALSE;
4021 }
4022 gl_version = wined3d_parse_gl_version(gl_version_str);
4023
4024 load_gl_funcs(gl_info);
4025
4026 memset(gl_info->supported, 0, sizeof(gl_info->supported));
4028
4029 if (gl_version >= MAKEDWORD_VERSION(3, 2))
4030 {
4031 gl_info->gl_ops.gl.p_glGetIntegerv(GL_CONTEXT_PROFILE_MASK, &context_profile);
4032 checkGLcall("Querying context profile");
4033 }
4034 if (context_profile & GL_CONTEXT_CORE_PROFILE_BIT)
4035 TRACE("Got a core profile context.\n");
4036 else
4038
4039 TRACE("GL extensions reported:\n");
4041 {
4042 const char *gl_extensions = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_EXTENSIONS);
4043
4044 if (!gl_extensions)
4045 {
4046 ERR("Received a NULL GL_EXTENSIONS.\n");
4047 return FALSE;
4048 }
4050 }
4051 else
4052 {
4054 }
4055
4056 hdc = wglGetCurrentDC();
4057 /* Not all GL drivers might offer WGL extensions e.g. VirtualBox. */
4058 if (GL_EXTCALL(wglGetExtensionsStringARB))
4059 WGL_Extensions = (const char *)GL_EXTCALL(wglGetExtensionsStringARB(hdc));
4060 if (!WGL_Extensions)
4061 WARN("WGL extensions not supported.\n");
4062 else
4064
4065 for (i = 0; i < ARRAY_SIZE(core_extensions); ++i)
4066 {
4067 if (!gl_info->supported[core_extensions[i].extension]
4068 && gl_version >= core_extensions[i].min_gl_version)
4069 {
4070 for (j = 0; j < ARRAY_SIZE(gl_extension_map); ++j)
4071 if (gl_extension_map[j].extension == core_extensions[i].extension)
4072 break;
4073
4075 {
4076 TRACE("GL CORE: %s support.\n", gl_extension_map[j].extension_string);
4077 gl_info->supported[core_extensions[i].extension] = TRUE;
4078 }
4079 else
4080 {
4081 FIXME("GL extension %u not in the GL extensions map.\n", core_extensions[i].extension);
4082 }
4083 }
4084 }
4085
4086 if (gl_info->supported[EXT_BLEND_MINMAX] || gl_info->supported[EXT_BLEND_SUBTRACT])
4088
4089 if (gl_version >= MAKEDWORD_VERSION(2, 0))
4091 if (gl_version >= MAKEDWORD_VERSION(3, 2))
4093
4094 /* All the points are actually point sprites in core contexts, the APIs from
4095 * ARB_point_sprite are not supported anymore. */
4096 if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
4097 gl_info->supported[ARB_POINT_SPRITE] = FALSE;
4098
4099 if (gl_info->supported[APPLE_FENCE])
4100 {
4101 /* GL_NV_fence and GL_APPLE_fence provide the same functionality basically.
4102 * The apple extension interacts with some other apple exts. Disable the NV
4103 * extension if the apple one is support to prevent confusion in other parts
4104 * of the code. */
4105 gl_info->supported[NV_FENCE] = FALSE;
4106 }
4107 if (gl_info->supported[APPLE_FLOAT_PIXELS])
4108 {
4109 /* GL_APPLE_float_pixels == GL_ARB_texture_float + GL_ARB_half_float_pixel
4110 *
4111 * The enums are the same:
4112 * GL_RGBA16F_ARB = GL_RGBA_FLOAT16_APPLE = 0x881a
4113 * GL_RGB16F_ARB = GL_RGB_FLOAT16_APPLE = 0x881b
4114 * GL_RGBA32F_ARB = GL_RGBA_FLOAT32_APPLE = 0x8814
4115 * GL_RGB32F_ARB = GL_RGB_FLOAT32_APPLE = 0x8815
4116 * GL_HALF_FLOAT_ARB = GL_HALF_APPLE = 0x140b
4117 */
4118 if (!gl_info->supported[ARB_TEXTURE_FLOAT])
4119 {
4120 TRACE(" IMPLIED: GL_ARB_texture_float support (by GL_APPLE_float_pixels).\n");
4121 gl_info->supported[ARB_TEXTURE_FLOAT] = TRUE;
4122 }
4123 if (!gl_info->supported[ARB_HALF_FLOAT_PIXEL])
4124 {
4125 TRACE(" IMPLIED: GL_ARB_half_float_pixel support (by GL_APPLE_float_pixels).\n");
4127 }
4128 }
4129 if (gl_info->supported[ARB_MAP_BUFFER_RANGE])
4130 {
4131 /* GL_ARB_map_buffer_range and GL_APPLE_flush_buffer_range provide the same
4132 * functionality. Prefer the ARB extension */
4134 }
4135 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
4136 {
4137 TRACE(" IMPLIED: NVIDIA (NV) Texture Gen Reflection support.\n");
4139 }
4141 {
4142 TRACE(" IMPLIED: ARB_vertex_array_bgra support (by EXT_vertex_array_bgra).\n");
4144 }
4146 {
4147 TRACE(" IMPLIED: EXT_texture_compression_rgtc support (by ARB_texture_compression_rgtc).\n");
4149 }
4151 {
4152 TRACE(" IMPLIED: ARB_texture_compression_rgtc support (by EXT_texture_compression_rgtc).\n");
4154 }
4156 {
4157 TRACE("ARB_texture_rg not supported, disabling ARB_texture_compression_rgtc.\n");
4159 }
4160 if (gl_info->supported[NV_TEXTURE_SHADER2])
4161 {
4162 if (gl_info->supported[NV_REGISTER_COMBINERS])
4163 {
4164 /* Also disable ATI_FRAGMENT_SHADER if register combiners and texture_shader2
4165 * are supported. The nv extensions provide the same functionality as the
4166 * ATI one, and a bit more(signed pixelformats). */
4168 }
4169 }
4171 {
4172 /* If we have full NP2 texture support, disable
4173 * GL_ARB_texture_rectangle because we will never use it.
4174 * This saves a few redundant glDisable calls. */
4176 }
4177 if (gl_info->supported[ATI_FRAGMENT_SHADER])
4178 {
4179 /* Disable NV_register_combiners and fragment shader if this is supported.
4180 * generally the NV extensions are preferred over the ATI ones, and this
4181 * extension is disabled if register_combiners and texture_shader2 are both
4182 * supported. So we reach this place only if we have incomplete NV dxlevel 8
4183 * fragment processing support. */
4186 gl_info->supported[NV_TEXTURE_SHADER] = FALSE;
4188 }
4189 if (gl_info->supported[NV_HALF_FLOAT])
4190 {
4191 /* GL_ARB_half_float_vertex is a subset of GL_NV_half_float. */
4193 }
4195 {
4196 /* Current wined3d sRGB infrastructure requires EXT_texture_sRGB_decode
4197 * for GL_ARB_framebuffer_sRGB support (without EXT_texture_sRGB_decode
4198 * we never render to sRGB surfaces). */
4199 TRACE("EXT_texture_sRGB_decode is not supported, disabling ARB_framebuffer_sRGB.\n");
4201 }
4202 if (gl_info->supported[ARB_OCCLUSION_QUERY])
4203 {
4204 GLint counter_bits;
4205
4206 GL_EXTCALL(glGetQueryiv(GL_SAMPLES_PASSED, GL_QUERY_COUNTER_BITS, &counter_bits));
4207 TRACE("Occlusion query counter has %d bits.\n", counter_bits);
4208 if (!counter_bits)
4210 }
4211 if (gl_info->supported[ARB_TIMER_QUERY])
4212 {
4213 GLint counter_bits;
4214
4215 GL_EXTCALL(glGetQueryiv(GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &counter_bits));
4216 TRACE("Timestamp query counter has %d bits.\n", counter_bits);
4217 if (!counter_bits)
4218 gl_info->supported[ARB_TIMER_QUERY] = FALSE;
4219 }
4220 if (gl_version >= MAKEDWORD_VERSION(3, 0))
4221 {
4222 GLint counter_bits;
4223
4225
4226 GL_EXTCALL(glGetQueryiv(GL_PRIMITIVES_GENERATED, GL_QUERY_COUNTER_BITS, &counter_bits));
4227 TRACE("Primitives query counter has %d bits.\n", counter_bits);
4228 if (!counter_bits)
4230
4232 TRACE("Transform feedback primitives query counter has %d bits.\n", counter_bits);
4233 if (!counter_bits)
4235 }
4236 if (gl_info->supported[ARB_VIEWPORT_ARRAY])
4237 {
4238 GLint subpixel_bits;
4239
4240 gl_info->gl_ops.gl.p_glGetIntegerv(GL_VIEWPORT_SUBPIXEL_BITS, &subpixel_bits);
4241 TRACE("Viewport supports %d subpixel bits.\n", subpixel_bits);
4242 if (subpixel_bits < 8 && gl_info->supported[ARB_CLIP_CONTROL])
4243 {
4244 TRACE("Disabling ARB_clip_control because viewport subpixel bits < 8.\n");
4245 gl_info->supported[ARB_CLIP_CONTROL] = FALSE;
4246 }
4247 }
4248 if (gl_info->supported[ARB_CLIP_CONTROL] && !gl_info->supported[ARB_VIEWPORT_ARRAY])
4249 {
4250 /* When using ARB_clip_control we need the float viewport parameters
4251 * introduced by ARB_viewport_array to take care of the shifted pixel
4252 * coordinates. */
4253 TRACE("Disabling ARB_clip_control because ARB_viewport_array is not supported.\n");
4254 gl_info->supported[ARB_CLIP_CONTROL] = FALSE;
4255 }
4257 {
4258 /* The stencil value needs to be placed in the green channel. */
4259 TRACE("Disabling ARB_stencil_texturing because ARB_texture_swizzle is not supported.\n");
4261 }
4263 {
4264 TRACE(" IMPLIED: ATI_texture_mirror_once support (by EXT_texture_mirror_clamp).\n");
4266 }
4268 {
4269 TRACE(" IMPLIED: ARB_texture_mirror_clamp_to_edge support (by ATI_texture_mirror_once).\n");
4271 }
4272 if (gl_info->supported[ARB_TEXTURE_STORAGE] && gl_info->supported[APPLE_YCBCR_422])
4273 {
4274 /* AFAIK APPLE_ycbcr_422 is only available in legacy contexts so we shouldn't ever hit this. */
4275 ERR("Disabling APPLE_ycbcr_422 because of ARB_texture_storage.\n");
4276 gl_info->supported[APPLE_YCBCR_422] = FALSE;
4277 }
4278 if (gl_info->supported[ARB_DRAW_INDIRECT] && !gl_info->supported[ARB_BASE_INSTANCE])
4279 {
4280 /* If ARB_base_instance is not supported the baseInstance field
4281 * in indirect draw parameters must be 0 or behavior is undefined.
4282 */
4283 WARN("Disabling ARB_draw_indirect because ARB_base_instance is not supported.\n");
4284 gl_info->supported[ARB_DRAW_INDIRECT] = FALSE;
4285 }
4289 {
4290 WARN("Disabling ARB_texture_multisample because immutable storage is not supported.\n");
4292 }
4293
4295
4296 if (gl_info->supported[ARB_VERTEX_PROGRAM] && test_arb_vs_offset_limit(gl_info))
4298
4299 if (gl_info->supported[ARB_SHADING_LANGUAGE_100])
4300 {
4301 const char *str = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_SHADING_LANGUAGE_VERSION_ARB);
4302 unsigned int major, minor;
4303
4304 TRACE("GLSL version string: %s.\n", debugstr_a(str));
4305
4306 /* The format of the GLSL version string is "major.minor[.release] [vendor info]". */
4307 sscanf(str, "%u.%u", &major, &minor);
4309 if (gl_info->glsl_version >= MAKEDWORD_VERSION(1, 30))
4310 gl_info->supported[WINED3D_GLSL_130] = TRUE;
4311 }
4312
4313 checkGLcall("extension detection");
4314
4315 adapter->shader_backend = select_shader_backend(gl_info);
4316 adapter->vertex_pipe = select_vertex_implementation(gl_info, adapter->shader_backend);
4317 adapter->fragment_pipe = select_fragment_implementation(gl_info, adapter->shader_backend);
4318
4319 adapter->shader_backend->shader_get_caps(gl_info, &shader_caps);
4321 adapter->d3d_info.limits.vs_version = shader_caps.vs_version;
4322 adapter->d3d_info.limits.hs_version = shader_caps.hs_version;
4323 adapter->d3d_info.limits.ds_version = shader_caps.ds_version;
4324 adapter->d3d_info.limits.gs_version = shader_caps.gs_version;
4325 adapter->d3d_info.limits.ps_version = shader_caps.ps_version;
4326 adapter->d3d_info.limits.cs_version = shader_caps.cs_version;
4327 adapter->d3d_info.limits.vs_uniform_count = shader_caps.vs_uniform_count;
4328 adapter->d3d_info.limits.ps_uniform_count = shader_caps.ps_uniform_count;
4329 adapter->d3d_info.limits.varying_count = shader_caps.varying_count;
4330 adapter->d3d_info.shader_double_precision = shader_caps.wined3d_caps & WINED3D_SHADER_CAP_DOUBLE_PRECISION;
4331
4332 adapter->vertex_pipe->vp_get_caps(gl_info, &vertex_caps);
4333 adapter->d3d_info.xyzrhw = vertex_caps.xyzrhw;
4334 adapter->d3d_info.ffp_generic_attributes = vertex_caps.ffp_generic_attributes;
4335 adapter->d3d_info.limits.ffp_vertex_blend_matrices = vertex_caps.max_vertex_blend_matrices;
4336 adapter->d3d_info.limits.active_light_count = vertex_caps.max_active_lights;
4337 adapter->d3d_info.emulated_flatshading = vertex_caps.emulated_flatshading;
4338
4339 adapter->fragment_pipe->get_caps(gl_info, &fragment_caps);
4340 adapter->d3d_info.limits.ffp_blend_stages = fragment_caps.MaxTextureBlendStages;
4341 adapter->d3d_info.limits.ffp_textures = fragment_caps.MaxSimultaneousTextures;
4343 adapter->d3d_info.wined3d_creation_flags = wined3d_creation_flags;
4344 TRACE("Max texture stages: %u.\n", adapter->d3d_info.limits.ffp_blend_stages);
4345
4346 adapter->d3d_info.valid_rt_mask = 0;
4347 for (i = 0; i < gl_info->limits.buffers; ++i)
4348 adapter->d3d_info.valid_rt_mask |= (1u << i);
4349
4350 adapter->d3d_info.valid_dual_rt_mask = 0;
4351 for (i = 0; i < gl_info->limits.dual_buffers; ++i)
4352 adapter->d3d_info.valid_dual_rt_mask |= (1u << i);
4353
4354 if (!adapter->d3d_info.shader_color_key)
4355 {
4356 /* We do not want to deal with re-creating immutable texture storage for color keying emulation. */
4357 WARN("Disabling ARB_texture_storage because fragment pipe doesn't support color keying.\n");
4359 }
4360
4361 if (gl_info->supported[ARB_FRAMEBUFFER_OBJECT])
4362 {
4363 gl_info->fbo_ops.glIsRenderbuffer = gl_info->gl_ops.ext.p_glIsRenderbuffer;
4364 gl_info->fbo_ops.glBindRenderbuffer = gl_info->gl_ops.ext.p_glBindRenderbuffer;
4365 gl_info->fbo_ops.glDeleteRenderbuffers = gl_info->gl_ops.ext.p_glDeleteRenderbuffers;
4366 gl_info->fbo_ops.glGenRenderbuffers = gl_info->gl_ops.ext.p_glGenRenderbuffers;
4367 gl_info->fbo_ops.glRenderbufferStorage = gl_info->gl_ops.ext.p_glRenderbufferStorage;
4368 gl_info->fbo_ops.glRenderbufferStorageMultisample = gl_info->gl_ops.ext.p_glRenderbufferStorageMultisample;
4369 gl_info->fbo_ops.glGetRenderbufferParameteriv = gl_info->gl_ops.ext.p_glGetRenderbufferParameteriv;
4370 gl_info->fbo_ops.glIsFramebuffer = gl_info->gl_ops.ext.p_glIsFramebuffer;
4371 gl_info->fbo_ops.glBindFramebuffer = gl_info->gl_ops.ext.p_glBindFramebuffer;
4372 gl_info->fbo_ops.glDeleteFramebuffers = gl_info->gl_ops.ext.p_glDeleteFramebuffers;
4373 gl_info->fbo_ops.glGenFramebuffers = gl_info->gl_ops.ext.p_glGenFramebuffers;
4374 gl_info->fbo_ops.glCheckFramebufferStatus = gl_info->gl_ops.ext.p_glCheckFramebufferStatus;
4375 gl_info->fbo_ops.glFramebufferTexture1D = gl_info->gl_ops.ext.p_glFramebufferTexture1D;
4376 gl_info->fbo_ops.glFramebufferTexture2D = gl_info->gl_ops.ext.p_glFramebufferTexture2D;
4377 gl_info->fbo_ops.glFramebufferTexture3D = gl_info->gl_ops.ext.p_glFramebufferTexture3D;
4378 gl_info->fbo_ops.glFramebufferTextureLayer = gl_info->gl_ops.ext.p_glFramebufferTextureLayer;
4379 gl_info->fbo_ops.glFramebufferRenderbuffer = gl_info->gl_ops.ext.p_glFramebufferRenderbuffer;
4380 gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv
4381 = gl_info->gl_ops.ext.p_glGetFramebufferAttachmentParameteriv;
4382 gl_info->fbo_ops.glBlitFramebuffer = gl_info->gl_ops.ext.p_glBlitFramebuffer;
4383 gl_info->fbo_ops.glGenerateMipmap = gl_info->gl_ops.ext.p_glGenerateMipmap;
4384 gl_info->fbo_ops.glFramebufferTexture = gl_info->gl_ops.ext.p_glFramebufferTexture;
4385 }
4386 else
4387 {
4388 if (gl_info->supported[EXT_FRAMEBUFFER_OBJECT])
4389 {
4390 gl_info->fbo_ops.glIsRenderbuffer = gl_info->gl_ops.ext.p_glIsRenderbufferEXT;
4391 gl_info->fbo_ops.glBindRenderbuffer = gl_info->gl_ops.ext.p_glBindRenderbufferEXT;
4392 gl_info->fbo_ops.glDeleteRenderbuffers = gl_info->gl_ops.ext.p_glDeleteRenderbuffersEXT;
4393 gl_info->fbo_ops.glGenRenderbuffers = gl_info->gl_ops.ext.p_glGenRenderbuffersEXT;
4394 gl_info->fbo_ops.glRenderbufferStorage = gl_info->gl_ops.ext.p_glRenderbufferStorageEXT;
4395 gl_info->fbo_ops.glGetRenderbufferParameteriv = gl_info->gl_ops.ext.p_glGetRenderbufferParameterivEXT;
4396 gl_info->fbo_ops.glIsFramebuffer = gl_info->gl_ops.ext.p_glIsFramebufferEXT;
4397 gl_info->fbo_ops.glBindFramebuffer = gl_info->gl_ops.ext.p_glBindFramebufferEXT;
4398 gl_info->fbo_ops.glDeleteFramebuffers = gl_info->gl_ops.ext.p_glDeleteFramebuffersEXT;
4399 gl_info->fbo_ops.glGenFramebuffers = gl_info->gl_ops.ext.p_glGenFramebuffersEXT;
4400 gl_info->fbo_ops.glCheckFramebufferStatus = gl_info->gl_ops.ext.p_glCheckFramebufferStatusEXT;
4401 gl_info->fbo_ops.glFramebufferTexture1D = gl_info->gl_ops.ext.p_glFramebufferTexture1DEXT;
4402 gl_info->fbo_ops.glFramebufferTexture2D = gl_info->gl_ops.ext.p_glFramebufferTexture2DEXT;
4403 gl_info->fbo_ops.glFramebufferTexture3D = gl_info->gl_ops.ext.p_glFramebufferTexture3DEXT;
4404 gl_info->fbo_ops.glFramebufferRenderbuffer = gl_info->gl_ops.ext.p_glFramebufferRenderbufferEXT;
4405 gl_info->fbo_ops.glGetFramebufferAttachmentParameteriv
4406 = gl_info->gl_ops.ext.p_glGetFramebufferAttachmentParameterivEXT;
4407 gl_info->fbo_ops.glGenerateMipmap = gl_info->gl_ops.ext.p_glGenerateMipmapEXT;
4408 }
4410 {
4411 WARN_(d3d_perf)("Framebuffer objects not supported, falling back to backbuffer offscreen rendering mode.\n");
4413 }
4414
4415 if (gl_info->supported[ARB_GEOMETRY_SHADER4])
4416 {
4417 gl_info->fbo_ops.glFramebufferTexture = gl_info->gl_ops.ext.p_glFramebufferTextureARB;
4418 gl_info->fbo_ops.glFramebufferTextureLayer = gl_info->gl_ops.ext.p_glFramebufferTextureLayerARB;
4419 }
4420 if (gl_info->supported[EXT_FRAMEBUFFER_BLIT])
4421 {
4422 gl_info->fbo_ops.glBlitFramebuffer = gl_info->gl_ops.ext.p_glBlitFramebufferEXT;
4423 }
4425 {
4426 gl_info->fbo_ops.glRenderbufferStorageMultisample
4427 = gl_info->gl_ops.ext.p_glRenderbufferStorageMultisampleEXT;
4428 }
4429 }
4430
4439
4440 if (!gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
4441 {
4442 GLuint vao;
4443
4444 GL_EXTCALL(glGenVertexArrays(1, &vao));
4445 GL_EXTCALL(glBindVertexArray(vao));
4446 checkGLcall("creating VAO");
4447 }
4448
4449 gl_vendor = wined3d_guess_gl_vendor(gl_info, gl_vendor_str, gl_renderer_str, gl_version_str);
4450 TRACE("Guessed GL vendor %#x.\n", gl_vendor);
4451
4452 if (!(gpu_description = query_gpu_description(gl_info, &vram_bytes)))
4453 {
4456
4457 vendor = wined3d_guess_card_vendor(gl_vendor_str, gl_renderer_str);
4458 TRACE("Guessed vendor PCI ID 0x%04x.\n", vendor);
4459
4461 gl_renderer_str, &gl_vendor, &vendor);
4462 TRACE("Guessed device PCI ID 0x%04x.\n", device);
4463
4465 {
4466 ERR("Card %04x:%04x not found in driver DB.\n", vendor, device);
4467 return FALSE;
4468 }
4469 }
4470 fixup_extensions(gl_info, caps_gl_ctx, gl_renderer_str, gl_vendor,
4472 init_driver_info(driver_info, gpu_description, vram_bytes);
4473
4474 gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(gl_info)
4475 | adapter->fragment_pipe->get_emul_mask(gl_info);
4476 if (gl_ext_emul_mask & GL_EXT_EMUL_ARB_MULTITEXTURE)
4478 if (gl_ext_emul_mask & GL_EXT_EMUL_EXT_FOG_COORD)
4480
4481 return TRUE;
4482}
#define GL_VERSION
Definition: gl.h:689
#define GL_REPEAT
Definition: gl.h:679
#define GL_CLAMP_TO_EDGE
Definition: gl.h:1481
void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext)
Definition: gl_compat.c:355
#define GL_MIRRORED_REPEAT_ARB
Definition: glext.h:1359
#define GL_CONTEXT_PROFILE_MASK
Definition: glext.h:831
#define GL_CLAMP_TO_BORDER_ARB
Definition: glext.h:1257
#define GL_TIMESTAMP
Definition: glext.h:2037
#define GL_PRIMITIVES_GENERATED
Definition: glext.h:550
#define GL_VIEWPORT_SUBPIXEL_BITS
Definition: glext.h:2211
#define GL_SAMPLES_PASSED
Definition: glext.h:356
#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN
Definition: glext.h:551
#define GL_SHADING_LANGUAGE_VERSION_ARB
Definition: glext.h:1579
#define GL_CONTEXT_CORE_PROFILE_BIT
Definition: glext.h:810
#define GL_QUERY_COUNTER_BITS
Definition: glext.h:332
_Check_return_ _CRTIMP int __cdecl sscanf(_In_z_ const char *_Src, _In_z_ _Scanf_format_string_ const char *_Format,...)
#define minor(rdev)
Definition: propsheet.cpp:929
#define major(rdev)
Definition: propsheet.cpp:928
const WCHAR * str
DWORD MaxTextureBlendStages
unsigned int cs_version
DWORD vs_uniform_count
DWORD ps_uniform_count
unsigned int hs_version
unsigned int gs_version
unsigned int ps_version
unsigned int ds_version
GLint wrap_lookup[WINED3D_TADDRESS_MIRROR_ONCE - WINED3D_TADDRESS_WRAP+1]
unsigned int multisample_textures
HDC WINAPI wglGetCurrentDC(void)
Definition: wgl.c:579
#define GL_MIRROR_CLAMP_TO_EDGE
Definition: wgl.h:2564
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)
Definition: directx.c:2519
static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info)
Definition: directx.c:3476
static const struct wined3d_extension_map gl_extension_map[]
Definition: directx.c:103
static void load_gl_funcs(struct wined3d_gl_info *gl_info)
Definition: directx.c:2696
wined3d_gl_vendor
Definition: directx.c:72
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)
Definition: directx.c:2599
static const struct gpu_description * query_gpu_description(const struct wined3d_gl_info *gl_info, UINT64 *vram_bytes)
Definition: directx.c:1566
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)
Definition: directx.c:1785
static BOOL test_arb_vs_offset_limit(const struct wined3d_gl_info *gl_info)
Definition: directx.c:486
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)
Definition: directx.c:1748
static void parse_extension_string(struct wined3d_gl_info *gl_info, const char *extensions, const struct wined3d_extension_map *map, UINT entry_count)
Definition: directx.c:2638
static const struct fragment_pipeline * select_fragment_implementation(const struct wined3d_gl_info *gl_info, const struct wined3d_shader_backend_ops *shader_backend_ops)
Definition: directx.c:2607
static void enumerate_gl_extensions(struct wined3d_gl_info *gl_info, const struct wined3d_extension_map *map, unsigned int map_entries_count)
Definition: directx.c:2672
static const struct wined3d_shader_backend_ops * select_shader_backend(const struct wined3d_gl_info *gl_info)
Definition: directx.c:2623
static const struct wined3d_extension_map wgl_extension_map[]
Definition: directx.c:279
static DWORD wined3d_parse_gl_version(const char *gl_version)
Definition: directx.c:1765
static void init_driver_info(struct wined3d_driver_info *driver_info, const struct gpu_description *gpu_desc, UINT64 vram_bytes)
Definition: directx.c:1623
@ WINED3D_TADDRESS_BORDER
Definition: wined3d.h:642
@ WINED3D_TADDRESS_MIRROR_ONCE
Definition: wined3d.h:643
@ WINED3D_TADDRESS_WRAP
Definition: wined3d.h:639
@ WINED3D_TADDRESS_MIRROR
Definition: wined3d.h:640
@ WINED3D_TADDRESS_CLAMP
Definition: wined3d.h:641
wined3d_gl_extension
Definition: wined3d_gl.h:36
@ ARB_GPU_SHADER5
Definition: wined3d_gl.h:76
@ EXT_BLEND_EQUATION_SEPARATE
Definition: wined3d_gl.h:151
@ ARB_EXPLICIT_ATTRIB_LOCATION
Definition: wined3d_gl.h:67
@ ARB_SHADING_LANGUAGE_PACKING
Definition: wined3d_gl.h:102
@ ARB_DEBUG_OUTPUT
Definition: wined3d_gl.h:56
@ ARB_TEXTURE_QUERY_LEVELS
Definition: wined3d_gl.h:124
@ ARB_TEXTURE_FILTER_ANISOTROPIC
Definition: wined3d_gl.h:117
@ NV_POINT_SPRITE
Definition: wined3d_gl.h:193
@ ARB_TEXTURE_BUFFER_OBJECT
Definition: wined3d_gl.h:108
@ ARB_TEXTURE_CUBE_MAP
Definition: wined3d_gl.h:113
@ ARB_INTERNALFORMAT_QUERY
Definition: wined3d_gl.h:80
@ ARB_CULL_DISTANCE
Definition: wined3d_gl.h:55
@ ARB_DERIVATIVE_CONTROL
Definition: wined3d_gl.h:60
@ ARB_SEAMLESS_CUBE_MAP
Definition: wined3d_gl.h:93
@ ARB_PIPELINE_STATISTICS_QUERY
Definition: wined3d_gl.h:87
@ EXT_BLEND_MINMAX
Definition: wined3d_gl.h:153
@ ARB_SHADER_BIT_ENCODING
Definition: wined3d_gl.h:95
@ WINED3D_GL_EXT_NONE
Definition: wined3d_gl.h:37
@ ARB_POINT_PARAMETERS
Definition: wined3d_gl.h:89
@ ARB_CLEAR_TEXTURE
Definition: wined3d_gl.h:48
@ ARB_SHADER_IMAGE_SIZE
Definition: wined3d_gl.h:97
@ ARB_DEPTH_TEXTURE
Definition: wined3d_gl.h:59
@ EXT_TEXTURE_SHARED_EXPONENT
Definition: wined3d_gl.h:180
@ ARB_DRAW_ELEMENTS_BASE_VERTEX
Definition: wined3d_gl.h:62
@ ARB_COMPUTE_SHADER
Definition: wined3d_gl.h:51
@ ARB_PROVOKING_VERTEX
Definition: wined3d_gl.h:91
@ WINED3D_GL_PRIMITIVE_QUERY
Definition: wined3d_gl.h:215
@ NV_TEXGEN_REFLECTION
Definition: wined3d_gl.h:196
@ ARB_FRAGMENT_LAYER_VIEWPORT
Definition: wined3d_gl.h:69
@ EXT_FOG_COORD
Definition: wined3d_gl.h:157
@ WINED3D_GL_BLEND_EQUATION
Definition: wined3d_gl.h:212
@ APPLE_FENCE
Definition: wined3d_gl.h:40
@ ARB_TEXTURE_VIEW
Definition: wined3d_gl.h:131
@ APPLE_FLUSH_BUFFER_RANGE
Definition: wined3d_gl.h:42
@ ARB_CONSERVATIVE_DEPTH
Definition: wined3d_gl.h:52
@ ARB_SHADER_STORAGE_BUFFER_OBJECT
Definition: wined3d_gl.h:98
@ EXT_STENCIL_WRAP
Definition: wined3d_gl.h:170
@ ARB_TEXTURE_COMPRESSION_RGTC
Definition: wined3d_gl.h:112
@ ARB_TEXTURE_MIRRORED_REPEAT
Definition: wined3d_gl.h:120
@ EXT_TEXTURE_SRGB_DECODE
Definition: wined3d_gl.h:183
@ ARB_SAMPLER_OBJECTS
Definition: wined3d_gl.h:92
@ ARB_VERTEX_BUFFER_OBJECT
Definition: wined3d_gl.h:138
@ EXT_TEXTURE_INTEGER
Definition: wined3d_gl.h:177
@ EXT_VERTEX_ARRAY_BGRA
Definition: wined3d_gl.h:184
@ ARB_ES2_COMPATIBILITY
Definition: wined3d_gl.h:65
@ ARB_TEXTURE_FLOAT
Definition: wined3d_gl.h:118
@ ARB_FRAMEBUFFER_OBJECT
Definition: wined3d_gl.h:73
@ EXT_TEXTURE3D
Definition: wined3d_gl.h:171
@ ARB_TEXTURE_BORDER_CLAMP
Definition: wined3d_gl.h:107
@ WINED3D_GL_VERSION_3_2
Definition: wined3d_gl.h:217
@ ARB_DRAW_INDIRECT
Definition: wined3d_gl.h:63
@ ARB_TEXTURE_RG
Definition: wined3d_gl.h:126
@ ARB_TEXTURE_MULTISAMPLE
Definition: wined3d_gl.h:122
@ ARB_TEXTURE_RGB10_A2UI
Definition: wined3d_gl.h:127
@ ARB_INTERNALFORMAT_QUERY2
Definition: wined3d_gl.h:81
@ ARB_BASE_INSTANCE
Definition: wined3d_gl.h:45
@ ARB_HALF_FLOAT_VERTEX
Definition: wined3d_gl.h:78
@ ARB_ES3_COMPATIBILITY
Definition: wined3d_gl.h:66
@ ARB_INSTANCED_ARRAYS
Definition: wined3d_gl.h:79
@ EXT_BLEND_FUNC_SEPARATE
Definition: wined3d_gl.h:152
@ EXT_PACKED_FLOAT
Definition: wined3d_gl.h:164
@ NV_REGISTER_COMBINERS2
Definition: wined3d_gl.h:195
@ ARB_MAP_BUFFER_ALIGNMENT
Definition: wined3d_gl.h:82
@ ARB_FRAMEBUFFER_SRGB
Definition: wined3d_gl.h:74
@ ARB_FRAGMENT_COORD_CONVENTIONS
Definition: wined3d_gl.h:68
@ ARB_UNIFORM_BUFFER_OBJECT
Definition: wined3d_gl.h:135
@ ARB_CLEAR_BUFFER_OBJECT
Definition: wined3d_gl.h:47
@ ARB_SYNC
Definition: wined3d_gl.h:105
@ NV_FENCE
Definition: wined3d_gl.h:186
@ EXT_TEXTURE_SRGB
Definition: wined3d_gl.h:182
@ ARB_FRAMEBUFFER_NO_ATTACHMENTS
Definition: wined3d_gl.h:72
@ ARB_SHADOW
Definition: wined3d_gl.h:103
@ ARB_SHADING_LANGUAGE_100
Definition: wined3d_gl.h:100
@ APPLE_FLOAT_PIXELS
Definition: wined3d_gl.h:41
@ EXT_TEXTURE_COMPRESSION_RGTC
Definition: wined3d_gl.h:173
@ WINED3D_GLSL_130
Definition: wined3d_gl.h:218
@ EXT_TEXTURE_MIRROR_CLAMP
Definition: wined3d_gl.h:179
@ EXT_BLEND_COLOR
Definition: wined3d_gl.h:150
@ ARB_BLEND_FUNC_EXTENDED
Definition: wined3d_gl.h:46
@ ARB_TEXTURE_STORAGE
Definition: wined3d_gl.h:128
@ ARB_SHADER_ATOMIC_COUNTERS
Definition: wined3d_gl.h:94
@ EXT_FRAMEBUFFER_MULTISAMPLE
Definition: wined3d_gl.h:159
@ ARB_TEXTURE_MIRROR_CLAMP_TO_EDGE
Definition: wined3d_gl.h:121
@ ARB_SHADING_LANGUAGE_420PACK
Definition: wined3d_gl.h:101
@ ARB_TESSELLATION_SHADER
Definition: wined3d_gl.h:106
@ ARB_GEOMETRY_SHADER4
Definition: wined3d_gl.h:75
@ EXT_BLEND_SUBTRACT
Definition: wined3d_gl.h:154
@ ATI_TEXTURE_MIRROR_ONCE
Definition: wined3d_gl.h:148
@ ARB_VERTEX_TYPE_2_10_10_10_REV
Definition: wined3d_gl.h:141
@ ARB_DRAW_BUFFERS
Definition: wined3d_gl.h:61
@ ARB_HALF_FLOAT_PIXEL
Definition: wined3d_gl.h:77
@ ARB_COLOR_BUFFER_FLOAT
Definition: wined3d_gl.h:50
@ ARB_DRAW_INSTANCED
Definition: wined3d_gl.h:64
@ APPLE_YCBCR_422
Definition: wined3d_gl.h:43
@ ARB_TRANSFORM_FEEDBACK3
Definition: wined3d_gl.h:134
@ ARB_TEXTURE_GATHER
Definition: wined3d_gl.h:119
@ NV_TEXTURE_SHADER
Definition: wined3d_gl.h:198
@ WINED3D_GL_LEGACY_CONTEXT
Definition: wined3d_gl.h:213
@ EXT_FRAMEBUFFER_OBJECT
Definition: wined3d_gl.h:160
@ WINED3D_GL_VERSION_2_0
Definition: wined3d_gl.h:216
@ ARB_MAP_BUFFER_RANGE
Definition: wined3d_gl.h:83
@ EXT_FRAMEBUFFER_BLIT
Definition: wined3d_gl.h:158
@ ARB_COPY_IMAGE
Definition: wined3d_gl.h:54
@ ARB_TEXTURE_SWIZZLE
Definition: wined3d_gl.h:130
@ ARB_SHADER_IMAGE_LOAD_STORE
Definition: wined3d_gl.h:96
@ ARB_TEXTURE_COMPRESSION_BPTC
Definition: wined3d_gl.h:111
@ ARB_OCCLUSION_QUERY
Definition: wined3d_gl.h:86
@ ARB_TEXTURE_COMPRESSION
Definition: wined3d_gl.h:110
@ ARB_POINT_SPRITE
Definition: wined3d_gl.h:90
@ ARB_STENCIL_TEXTURING
Definition: wined3d_gl.h:104
@ EXT_TEXTURE_ARRAY
Definition: wined3d_gl.h:172
@ ARB_TEXTURE_BUFFER_RANGE
Definition: wined3d_gl.h:109
@ ARB_MULTITEXTURE
Definition: wined3d_gl.h:85
@ EXT_TEXTURE_SNORM
Definition: wined3d_gl.h:181
@ ARB_TRANSFORM_FEEDBACK2
Definition: wined3d_gl.h:133
@ EXT_DRAW_BUFFERS2
Definition: wined3d_gl.h:155
@ ARB_TIMER_QUERY
Definition: wined3d_gl.h:132
@ ARB_TEXTURE_STORAGE_MULTISAMPLE
Definition: wined3d_gl.h:129
@ ARB_TEXTURE_CUBE_MAP_ARRAY
Definition: wined3d_gl.h:114
@ ARB_DEPTH_BUFFER_FLOAT
Definition: wined3d_gl.h:57
@ ARB_COPY_BUFFER
Definition: wined3d_gl.h:53
#define WINED3D_FRAGMENT_CAP_COLOR_KEY
#define WINED3D_SHADER_CAP_DOUBLE_PRECISION
#define GL_EXT_EMUL_EXT_FOG_COORD
#define GL_EXT_EMUL_ARB_MULTITEXTURE
#define WINED3D_SHADER_CAP_VS_CLIPPING
#define WINED3D_QUIRK_ARB_VS_OFFSET_LIMIT

Referenced by wined3d_adapter_init().

◆ wined3d_adapter_init_limits()

static void wined3d_adapter_init_limits ( struct wined3d_gl_info gl_info)
static

Definition at line 3476 of file directx.c.

3477{
3478 unsigned int i, sampler_count;
3479 GLfloat gl_floatv[2];
3480 GLint gl_max;
3481
3482 gl_info->limits.blends = 1;
3483 gl_info->limits.buffers = 1;
3484 gl_info->limits.textures = 0;
3485 gl_info->limits.texture_coords = 0;
3486 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
3487 {
3488 gl_info->limits.uniform_blocks[i] = 0;
3489 gl_info->limits.samplers[i] = 0;
3490 }
3491 gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL] = 1;
3492 gl_info->limits.combined_samplers = gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL];
3493 gl_info->limits.graphics_samplers = gl_info->limits.combined_samplers;
3494 gl_info->limits.vertex_attribs = 16;
3495 gl_info->limits.texture_buffer_offset_alignment = 1;
3496 gl_info->limits.glsl_vs_float_constants = 0;
3497 gl_info->limits.glsl_ps_float_constants = 0;
3498 gl_info->limits.arb_vs_float_constants = 0;
3499 gl_info->limits.arb_vs_native_constants = 0;
3500 gl_info->limits.arb_vs_instructions = 0;
3501 gl_info->limits.arb_vs_temps = 0;
3502 gl_info->limits.arb_ps_float_constants = 0;
3503 gl_info->limits.arb_ps_local_constants = 0;
3504 gl_info->limits.arb_ps_instructions = 0;
3505 gl_info->limits.arb_ps_temps = 0;
3506
3507 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_CLIP_DISTANCES, &gl_max);
3508 gl_info->limits.user_clip_distances = min(MAX_CLIP_DISTANCES, gl_max);
3509 TRACE("Clip plane support - max planes %d.\n", gl_max);
3510
3512 {
3513 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_LIGHTS, &gl_max);
3514 gl_info->limits.lights = gl_max;
3515 TRACE("Light support - max lights %d.\n", gl_max);
3516 }
3517
3518 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_SIZE, &gl_max);
3519 gl_info->limits.texture_size = gl_max;
3520 TRACE("Maximum texture size support - max texture size %d.\n", gl_max);
3521
3522 gl_info->gl_ops.gl.p_glGetFloatv(gl_info->supported[WINED3D_GL_LEGACY_CONTEXT]
3524 gl_info->limits.pointsize_min = gl_floatv[0];
3525 gl_info->limits.pointsize_max = gl_floatv[1];
3526 TRACE("Maximum point size support - max point size %f.\n", gl_floatv[1]);
3527
3528 if (gl_info->supported[ARB_MAP_BUFFER_ALIGNMENT])
3529 {
3530 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MIN_MAP_BUFFER_ALIGNMENT, &gl_max);
3531 TRACE("Minimum buffer map alignment: %d.\n", gl_max);
3532 }
3533 else
3534 {
3535 WARN_(d3d_perf)("Driver doesn't guarantee a minimum buffer map alignment.\n");
3536 }
3537 if (gl_info->supported[NV_REGISTER_COMBINERS])
3538 {
3539 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_GENERAL_COMBINERS_NV, &gl_max);
3540 gl_info->limits.general_combiners = gl_max;
3541 TRACE("Max general combiners: %d.\n", gl_max);
3542 }
3544 {
3545 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_DRAW_BUFFERS_ARB, &gl_max);
3546 gl_info->limits.buffers = min(MAX_RENDER_TARGET_VIEWS, gl_max);
3547 TRACE("Max draw buffers: %u.\n", gl_max);
3548 }
3549 if (gl_info->supported[ARB_BLEND_FUNC_EXTENDED])
3550 {
3551 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, &gl_max);
3552 gl_info->limits.dual_buffers = gl_max;
3553 TRACE("Max dual source draw buffers: %u.\n", gl_max);
3554 }
3555 if (gl_info->supported[ARB_MULTITEXTURE])
3556 {
3558 {
3559 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_UNITS_ARB, &gl_max);
3560 gl_info->limits.textures = min(MAX_TEXTURES, gl_max);
3561 TRACE("Max textures: %d.\n", gl_info->limits.textures);
3562
3563 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
3564 {
3565 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_COORDS_ARB, &gl_max);
3566 gl_info->limits.texture_coords = min(MAX_TEXTURES, gl_max);
3567 }
3568 else
3569 {
3570 gl_info->limits.texture_coords = gl_info->limits.textures;
3571 }
3572 TRACE("Max texture coords: %d.\n", gl_info->limits.texture_coords);
3573 }
3574
3576 {
3577 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &gl_max);
3578 gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL] = gl_max;
3579 }
3580 else
3581 {
3582 gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL] = gl_info->limits.textures;
3583 }
3584 TRACE("Max fragment samplers: %d.\n", gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL]);
3585
3586 if (gl_info->supported[ARB_VERTEX_SHADER])
3587 {
3588 unsigned int vertex_sampler_count;
3589
3590 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB, &gl_max);
3591 vertex_sampler_count = gl_info->limits.samplers[WINED3D_SHADER_TYPE_VERTEX] = gl_max;
3592 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB, &gl_max);
3593 gl_info->limits.combined_samplers = gl_max;
3594 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VERTEX_ATTRIBS_ARB, &gl_max);
3595 gl_info->limits.vertex_attribs = gl_max;
3596
3597 /* Loading GLSL sampler uniforms is much simpler if we can assume that the sampler setup
3598 * is known at shader link time. In a vertex shader + pixel shader combination this isn't
3599 * an issue because then the sampler setup only depends on the two shaders. If a pixel
3600 * shader is used with fixed function vertex processing we're fine too because fixed function
3601 * vertex processing doesn't use any samplers. If fixed function fragment processing is
3602 * used we have to make sure that all vertex sampler setups are valid together with all
3603 * possible fixed function fragment processing setups. This is true if vsamplers + MAX_TEXTURES
3604 * <= max_samplers. This is true on all d3d9 cards that support vtf(gf 6 and gf7 cards).
3605 * dx9 radeon cards do not support vertex texture fetch. DX10 cards have 128 samplers, and
3606 * dx9 is limited to 8 fixed function texture stages and 4 vertex samplers. DX10 does not have
3607 * a fixed function pipeline anymore.
3608 *
3609 * So this is just a check to check that our assumption holds true. If not, write a warning
3610 * and reduce the number of vertex samplers or probably disable vertex texture fetch. */
3611 if (vertex_sampler_count && gl_info->limits.combined_samplers < 12
3612 && MAX_TEXTURES + vertex_sampler_count > gl_info->limits.combined_samplers)
3613 {
3614 FIXME("OpenGL implementation supports %u vertex samplers and %u total samplers.\n",
3615 vertex_sampler_count, gl_info->limits.combined_samplers);
3616 FIXME("Expected vertex samplers + MAX_TEXTURES(=8) > combined_samplers.\n");
3617 if (gl_info->limits.combined_samplers > MAX_TEXTURES)
3618 vertex_sampler_count = gl_info->limits.combined_samplers - MAX_TEXTURES;
3619 else
3620 vertex_sampler_count = 0;
3621 gl_info->limits.samplers[WINED3D_SHADER_TYPE_VERTEX] = vertex_sampler_count;
3622 }
3623 }
3624 else
3625 {
3626 gl_info->limits.combined_samplers = gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL];
3627 }
3628 TRACE("Max vertex samplers: %u.\n", gl_info->limits.samplers[WINED3D_SHADER_TYPE_VERTEX]);
3629 TRACE("Max combined samplers: %u.\n", gl_info->limits.combined_samplers);
3630 TRACE("Max vertex attributes: %u.\n", gl_info->limits.vertex_attribs);
3631 }
3632 else
3633 {
3634 gl_info->limits.textures = 1;
3635 gl_info->limits.texture_coords = 1;
3636 }
3637
3638 if (gl_info->supported[ARB_VERTEX_BLEND])
3639 {
3640 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VERTEX_UNITS_ARB, &gl_max);
3641 gl_info->limits.blends = gl_max;
3642 TRACE("Max blends: %u.\n", gl_info->limits.blends);
3643 }
3644 if (gl_info->supported[EXT_TEXTURE3D])
3645 {
3646 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE_EXT, &gl_max);
3647 gl_info->limits.texture3d_size = gl_max;
3648 TRACE("Max texture3D size: %d.\n", gl_info->limits.texture3d_size);
3649 }
3651 {
3652 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &gl_max);
3653 gl_info->limits.anisotropy = gl_max;
3654 TRACE("Max anisotropy: %d.\n", gl_info->limits.anisotropy);
3655 }
3656 if (gl_info->supported[ARB_FRAGMENT_PROGRAM])
3657 {
3659 gl_info->limits.arb_ps_float_constants = gl_max;
3660 TRACE("Max ARB_FRAGMENT_PROGRAM float constants: %d.\n", gl_info->limits.arb_ps_float_constants);
3662 gl_info->limits.arb_ps_native_constants = gl_max;
3663 TRACE("Max ARB_FRAGMENT_PROGRAM native float constants: %d.\n",
3664 gl_info->limits.arb_ps_native_constants);
3666 gl_info->limits.arb_ps_temps = gl_max;
3667 TRACE("Max ARB_FRAGMENT_PROGRAM native temporaries: %d.\n", gl_info->limits.arb_ps_temps);
3669 gl_info->limits.arb_ps_instructions = gl_max;
3670 TRACE("Max ARB_FRAGMENT_PROGRAM native instructions: %d.\n", gl_info->limits.arb_ps_instructions);
3672 gl_info->limits.arb_ps_local_constants = gl_max;
3673 TRACE("Max ARB_FRAGMENT_PROGRAM local parameters: %d.\n", gl_info->limits.arb_ps_instructions);
3674 }
3675 if (gl_info->supported[ARB_VERTEX_PROGRAM])
3676 {
3678 gl_info->limits.arb_vs_float_constants = gl_max;
3679 TRACE("Max ARB_VERTEX_PROGRAM float constants: %d.\n", gl_info->limits.arb_vs_float_constants);
3681 gl_info->limits.arb_vs_native_constants = gl_max;
3682 TRACE("Max ARB_VERTEX_PROGRAM native float constants: %d.\n",
3683 gl_info->limits.arb_vs_native_constants);
3685 gl_info->limits.arb_vs_temps = gl_max;
3686 TRACE("Max ARB_VERTEX_PROGRAM native temporaries: %d.\n", gl_info->limits.arb_vs_temps);
3688 gl_info->limits.arb_vs_instructions = gl_max;
3689 TRACE("Max ARB_VERTEX_PROGRAM native instructions: %d.\n", gl_info->limits.arb_vs_instructions);
3690 }
3691 if (gl_info->supported[ARB_VERTEX_SHADER])
3692 {
3693 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB, &gl_max);
3694 gl_info->limits.glsl_vs_float_constants = gl_max / 4;
3695 TRACE("Max ARB_VERTEX_SHADER float constants: %u.\n", gl_info->limits.glsl_vs_float_constants);
3696
3698 {
3699 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, &gl_max);
3700 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_VERTEX] = min(gl_max, WINED3D_MAX_CBS);
3701 TRACE("Max vertex uniform blocks: %u (%d).\n",
3702 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_VERTEX], gl_max);
3703 }
3704 }
3705 if (gl_info->supported[ARB_TESSELLATION_SHADER])
3706 {
3707 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS, &gl_max);
3708 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_HULL] = min(gl_max, WINED3D_MAX_CBS);
3709 TRACE("Max hull uniform blocks: %u (%d).\n",
3710 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_HULL], gl_max);
3711 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, &gl_max);
3712 gl_info->limits.samplers[WINED3D_SHADER_TYPE_HULL] = gl_max;
3713 TRACE("Max hull samplers: %u.\n", gl_info->limits.samplers[WINED3D_SHADER_TYPE_HULL]);
3714
3715 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS, &gl_max);
3716 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_DOMAIN] = min(gl_max, WINED3D_MAX_CBS);
3717 TRACE("Max domain uniform blocks: %u (%d).\n",
3718 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_DOMAIN], gl_max);
3719 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, &gl_max);
3720 gl_info->limits.samplers[WINED3D_SHADER_TYPE_DOMAIN] = gl_max;
3721 TRACE("Max domain samplers: %u.\n", gl_info->limits.samplers[WINED3D_SHADER_TYPE_DOMAIN]);
3722 }
3724 {
3725 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_BLOCKS, &gl_max);
3726 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_GEOMETRY] = min(gl_max, WINED3D_MAX_CBS);
3727 TRACE("Max geometry uniform blocks: %u (%d).\n",
3728 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_GEOMETRY], gl_max);
3729 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, &gl_max);
3730 gl_info->limits.samplers[WINED3D_SHADER_TYPE_GEOMETRY] = gl_max;
3731 TRACE("Max geometry samplers: %u.\n", gl_info->limits.samplers[WINED3D_SHADER_TYPE_GEOMETRY]);
3732 }
3733 if (gl_info->supported[ARB_FRAGMENT_SHADER])
3734 {
3735 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max);
3736 gl_info->limits.glsl_ps_float_constants = gl_max / 4;
3737 TRACE("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants);
3738 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max);
3739 gl_info->limits.glsl_varyings = gl_max;
3740 TRACE("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_max, gl_max / 4);
3741
3743 {
3744 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, &gl_max);
3745 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_PIXEL] = min(gl_max, WINED3D_MAX_CBS);
3746 TRACE("Max fragment uniform blocks: %u (%d).\n",
3747 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_PIXEL], gl_max);
3748 }
3749 }
3750 if (gl_info->supported[ARB_COMPUTE_SHADER])
3751 {
3752 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_COMPUTE_UNIFORM_BLOCKS, &gl_max);
3753 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_COMPUTE] = min(gl_max, WINED3D_MAX_CBS);
3754 TRACE("Max compute uniform blocks: %u (%d).\n",
3755 gl_info->limits.uniform_blocks[WINED3D_SHADER_TYPE_COMPUTE], gl_max);
3756 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS, &gl_max);
3757 gl_info->limits.samplers[WINED3D_SHADER_TYPE_COMPUTE] = gl_max;
3758 TRACE("Max compute samplers: %u.\n", gl_info->limits.samplers[WINED3D_SHADER_TYPE_COMPUTE]);
3759 }
3761 {
3762 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &gl_max);
3763 TRACE("Max combined uniform blocks: %d.\n", gl_max);
3764 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &gl_max);
3765 TRACE("Max uniform buffer bindings: %d.\n", gl_max);
3766 }
3767 if (gl_info->supported[ARB_TEXTURE_BUFFER_RANGE])
3768 {
3769 gl_info->gl_ops.gl.p_glGetIntegerv(GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT, &gl_max);
3770 gl_info->limits.texture_buffer_offset_alignment = gl_max;
3771 TRACE("Minimum required texture buffer offset alignment %d.\n", gl_max);
3772 }
3774 {
3775 GLint max_fragment_buffers, max_combined_buffers, max_bindings;
3776 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS, &max_fragment_buffers);
3777 TRACE("Max fragment atomic counter buffers: %d.\n", max_fragment_buffers);
3778 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS, &max_combined_buffers);
3779 TRACE("Max combined atomic counter buffers: %d.\n", max_combined_buffers);
3780 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &max_bindings);
3781 TRACE("Max atomic counter buffer bindings: %d.\n", max_bindings);
3782 if (max_fragment_buffers < MAX_UNORDERED_ACCESS_VIEWS
3783 || max_combined_buffers < MAX_UNORDERED_ACCESS_VIEWS
3784 || max_bindings < MAX_UNORDERED_ACCESS_VIEWS)
3785 {
3786 WARN("Disabling ARB_shader_atomic_counters.\n");
3788 }
3789 }
3790 if (gl_info->supported[ARB_TRANSFORM_FEEDBACK3])
3791 {
3792 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VERTEX_STREAMS, &gl_max);
3793 TRACE("Max vertex streams: %d.\n", gl_max);
3794 }
3795
3796 if (gl_info->supported[NV_LIGHT_MAX_EXPONENT])
3797 gl_info->gl_ops.gl.p_glGetFloatv(GL_MAX_SHININESS_NV, &gl_info->limits.shininess);
3798 else
3799 gl_info->limits.shininess = 128.0f;
3800
3802 {
3803 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_SAMPLES, &gl_max);
3804 gl_info->limits.samples = gl_max;
3805 }
3806
3808 {
3809 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAMEBUFFER_WIDTH, &gl_max);
3810 gl_info->limits.framebuffer_width = gl_max;
3811 gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAMEBUFFER_HEIGHT, &gl_max);
3812 gl_info->limits.framebuffer_height = gl_max;
3813 }
3814 else
3815 {
3816 gl_info->limits.framebuffer_width = gl_info->limits.texture_size;
3817 gl_info->limits.framebuffer_height = gl_info->limits.texture_size;
3818 }
3819
3820 gl_info->limits.samplers[WINED3D_SHADER_TYPE_PIXEL] =
3822 sampler_count = 0;
3823 for (i = 0; i < WINED3D_SHADER_TYPE_GRAPHICS_COUNT; ++i)
3824 sampler_count += gl_info->limits.samplers[i];
3825 if (gl_info->supported[WINED3D_GL_VERSION_3_2] && gl_info->limits.combined_samplers < sampler_count)
3826 {
3827 /* The minimum value for GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS in OpenGL
3828 * 3.2 is 48 (16 per stage). When tessellation shaders are supported
3829 * the minimum value is increased to 80. */
3830 WARN("Graphics pipeline sampler count %u is greater than combined sampler count %u.\n",
3831 sampler_count, gl_info->limits.combined_samplers);
3832 for (i = 0; i < WINED3D_SHADER_TYPE_GRAPHICS_COUNT; ++i)
3833 gl_info->limits.samplers[i] = min(gl_info->limits.samplers[i], 16);
3834 }
3835
3836 /* A majority of OpenGL implementations allow us to statically partition
3837 * the set of texture bindings into six separate sets. */
3838 gl_info->limits.graphics_samplers = gl_info->limits.combined_samplers;
3839 sampler_count = 0;
3840 for (i = 0; i < WINED3D_SHADER_TYPE_COUNT; ++i)
3841 sampler_count += gl_info->limits.samplers[i];
3842 if (gl_info->limits.combined_samplers >= sampler_count)
3843 gl_info->limits.graphics_samplers -= gl_info->limits.samplers[WINED3D_SHADER_TYPE_COMPUTE];
3844}
#define GL_MAX_TEXTURE_SIZE
Definition: gl.h:510
#define GL_ALIASED_POINT_SIZE_RANGE
Definition: gl.h:1509
#define GL_MAX_TEXTURE_UNITS_ARB
Definition: gl.h:2000
#define GL_POINT_SIZE_RANGE
Definition: gl.h:253
#define GL_MAX_LIGHTS
Definition: gl.h:508
#define GL_MAX_3D_TEXTURE_SIZE_EXT
Definition: glext.h:2475
#define GL_MAX_UNIFORM_BUFFER_BINDINGS
Definition: glext.h:1854
#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB
Definition: glext.h:1410
#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS
Definition: glext.h:2117
#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS
Definition: glext.h:2314
#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB
Definition: glext.h:1414
#define GL_MAX_CLIP_DISTANCES
Definition: glext.h:514
#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS
Definition: glext.h:817
#define GL_MAX_SHININESS_NV
Definition: glext.h:3387
#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB
Definition: glext.h:1428
#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS
Definition: glext.h:2111
#define GL_MAX_VERTEX_UNIFORM_BLOCKS
Definition: glext.h:1850
#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB
Definition: glext.h:1427
#define GL_MAX_GENERAL_COMBINERS_NV
Definition: glext.h:3440
#define GL_MAX_VERTEX_ATTRIBS_ARB
Definition: glext.h:1402
#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS
Definition: glext.h:2313
#define GL_MAX_SAMPLES
Definition: glext.h:1748
#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB
Definition: glext.h:1564
#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS
Definition: glext.h:2112
#define GL_MAX_TEXTURE_COORDS_ARB
Definition: glext.h:1479
#define GL_MAX_VERTEX_UNITS_ARB
Definition: glext.h:1268
#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS
Definition: glext.h:1851
#define GL_MAX_TEXTURE_IMAGE_UNITS
Definition: glext.h:418
#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS
Definition: glext.h:2006
#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB
Definition: glext.h:1574
#define GL_MAX_COMBINED_UNIFORM_BLOCKS
Definition: glext.h:1853
#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS
Definition: glext.h:2322
#define GL_MIN_MAP_BUFFER_ALIGNMENT
Definition: glext.h:2293
#define GL_MAX_VARYING_FLOATS_ARB
Definition: glext.h:1565
#define GL_MAX_VERTEX_STREAMS
Definition: glext.h:2146
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB
Definition: glext.h:1567
#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB
Definition: glext.h:1418
#define GL_MAX_DRAW_BUFFERS_ARB
Definition: glext.h:1594
#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS
Definition: glext.h:2118
#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS
Definition: glext.h:1852
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB
Definition: glext.h:1566
#define min(a, b)
Definition: monoChain.cc:55
#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT
Definition: wgl.h:4220
#define GL_MAX_COMPUTE_UNIFORM_BLOCKS
Definition: wgl.h:2251
#define GL_MAX_FRAMEBUFFER_WIDTH
Definition: wgl.h:2310
#define GL_MAX_TEXTURE_MAX_ANISOTROPY
Definition: wgl.h:2471
#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS
Definition: wgl.h:2250
#define GL_MAX_FRAMEBUFFER_HEIGHT
Definition: wgl.h:2307
@ ARB_VERTEX_BLEND
Definition: wined3d_gl.h:137
@ NV_LIGHT_MAX_EXPONENT
Definition: wined3d_gl.h:192
#define WINED3D_MAX_CBS
#define MAX_UNORDERED_ACCESS_VIEWS
#define MAX_GL_FRAGMENT_SAMPLERS
#define MAX_TEXTURES
#define MAX_RENDER_TARGET_VIEWS
@ WINED3D_SHADER_TYPE_HULL
@ WINED3D_SHADER_TYPE_PIXEL
@ WINED3D_SHADER_TYPE_GEOMETRY
@ WINED3D_SHADER_TYPE_GRAPHICS_COUNT
@ WINED3D_SHADER_TYPE_DOMAIN
@ WINED3D_SHADER_TYPE_COMPUTE
@ WINED3D_SHADER_TYPE_VERTEX
@ WINED3D_SHADER_TYPE_COUNT
#define MAX_CLIP_DISTANCES

Referenced by wined3d_adapter_init_gl_caps().

◆ wined3d_adapter_init_nogl()

static BOOL wined3d_adapter_init_nogl ( struct wined3d_adapter adapter,
UINT  ordinal 
)
static

Definition at line 6784 of file directx.c.

6785{
6786 DISPLAY_DEVICEW display_device;
6787
6788 memset(adapter, 0, sizeof(*adapter));
6789 adapter->ordinal = ordinal;
6790
6791 adapter->driver_info.name = "Display";
6792 adapter->driver_info.description = "WineD3D DirectDraw Emulation";
6795 else
6796 adapter->vram_bytes = 128 * 1024 * 1024;
6797
6799 return FALSE;
6800
6801 adapter->vertex_pipe = &none_vertex_pipe;
6802 adapter->fragment_pipe = &none_fragment_pipe;
6803 adapter->shader_backend = &none_shader_backend;
6804
6805 display_device.cb = sizeof(display_device);
6806 EnumDisplayDevicesW(NULL, ordinal, &display_device, 0);
6807 TRACE("DeviceName: %s\n", debugstr_w(display_device.DeviceName));
6808 strcpyW(adapter->DeviceName, display_device.DeviceName);
6809
6810 return TRUE;
6811}
const struct wined3d_vertex_pipe_ops none_vertex_pipe
Definition: state.c:5952
const struct fragment_pipeline none_fragment_pipe
Definition: state.c:5977

Referenced by wined3d_init().

◆ wined3d_calculate_format_pitch()

UINT CDECL wined3d_calculate_format_pitch ( const struct wined3d wined3d,
UINT  adapter_idx,
enum wined3d_format_id  format_id,
UINT  width 
)

Definition at line 5517 of file directx.c.

5519{
5520 const struct wined3d_gl_info *gl_info;
5521 unsigned int row_pitch, slice_pitch;
5522
5523 TRACE("wined3d %p, adapter_idx %u, format_id %s, width %u.\n",
5524 wined3d, adapter_idx, debug_d3dformat(format_id), width);
5525
5526 if (adapter_idx >= wined3d->adapter_count)
5527 return ~0u;
5528
5529 gl_info = &wined3d->adapters[adapter_idx].gl_info;
5531 1, width, 1, &row_pitch, &slice_pitch);
5532
5533 return row_pitch;
5534}
const struct wined3d_format * wined3d_get_format(const struct wined3d_gl_info *gl_info, enum wined3d_format_id format_id, unsigned int resource_usage)
Definition: utils.c:3831
void wined3d_format_calculate_pitch(const struct wined3d_format *format, unsigned int alignment, unsigned int width, unsigned int height, unsigned int *row_pitch, unsigned int *slice_pitch)
Definition: utils.c:3876
GLint GLint GLsizei width
Definition: gl.h:1546
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 * u
Definition: glfuncs.h:240
UINT adapter_count
struct wined3d_adapter adapters[1]

Referenced by ddraw7_GetAvailableVidMem(), and ddraw_surface_create().

◆ wined3d_caps_gl_ctx_create()

static BOOL wined3d_caps_gl_ctx_create ( struct wined3d_adapter adapter,
struct wined3d_caps_gl_ctx ctx 
)
static

Definition at line 366 of file directx.c.

367{
369 int iPixelFormat;
370
371 TRACE("getting context...\n");
372
373 ctx->restore_dc = wglGetCurrentDC();
374 ctx->restore_gl_ctx = wglGetCurrentContext();
375
376 /* We need a fake window as a hdc retrieved using GetDC(0) can't be used for much GL purposes. */
377 ctx->wnd = CreateWindowA(WINED3D_OPENGL_WINDOW_CLASS_NAME, "WineD3D fake window",
378 WS_OVERLAPPEDWINDOW, 10, 10, 10, 10, NULL, NULL, NULL, NULL);
379 if (!ctx->wnd)
380 {
381 ERR("Failed to create a window.\n");
382 goto fail;
383 }
384
385 ctx->dc = GetDC(ctx->wnd);
386 if (!ctx->dc)
387 {
388 ERR("Failed to get a DC.\n");
389 goto fail;
390 }
391
392 /* PixelFormat selection */
393 ZeroMemory(&pfd, sizeof(pfd));
394 pfd.nSize = sizeof(pfd);
395 pfd.nVersion = 1;
396 pfd.dwFlags = PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER | PFD_DRAW_TO_WINDOW; /* PFD_GENERIC_ACCELERATED */
398 pfd.cColorBits = 32;
400
401 if (!(iPixelFormat = ChoosePixelFormat(ctx->dc, &pfd)))
402 {
403 /* If this happens something is very wrong as ChoosePixelFormat barely fails. */
404 ERR("Failed to find a suitable pixel format.\n");
405 goto fail;
406 }
407 DescribePixelFormat(ctx->dc, iPixelFormat, sizeof(pfd), &pfd);
409
410 /* Create a GL context. */
411 if (!(ctx->gl_ctx = wglCreateContext(ctx->dc)))
412 {
413 WARN("Failed to create default context for capabilities initialization.\n");
414 goto fail;
415 }
416
417 /* Make it the current GL context. */
418 if (!wglMakeCurrent(ctx->dc, ctx->gl_ctx))
419 {
420 ERR("Failed to make caps GL context current.\n");
421 goto fail;
422 }
423
424 ctx->gl_info = &adapter->gl_info;
425 return TRUE;
426
427fail:
428 if (ctx->gl_ctx) wglDeleteContext(ctx->gl_ctx);
429 ctx->gl_ctx = NULL;
430 if (ctx->dc) ReleaseDC(ctx->wnd, ctx->dc);
431 ctx->dc = NULL;
432 if (ctx->wnd) DestroyWindow(ctx->wnd);
433 ctx->wnd = NULL;
434 if (ctx->restore_gl_ctx && !wglMakeCurrent(ctx->restore_dc, ctx->restore_gl_ctx))
435 ERR("Failed to restore previous GL context.\n");
436
437 return FALSE;
438}
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
BOOL WINAPI wglDeleteContext(HGLRC hglrc)
Definition: wgl.c:514
HGLRC WINAPI wglGetCurrentContext(void)
Definition: wgl.c:574
HGLRC WINAPI wglCreateContext(HDC hdc)
Definition: wgl.c:383
BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc)
Definition: wgl.c:650
#define ZeroMemory
Definition: winbase.h:1712
#define WINED3D_OPENGL_WINDOW_CLASS_NAME
int WINAPI ChoosePixelFormat(_In_ HDC hdc, _In_ const PIXELFORMATDESCRIPTOR *ppfd)
BOOL WINAPI SetPixelFormat(_In_ HDC, _In_ int, _In_ const PIXELFORMATDESCRIPTOR *)
#define PFD_SUPPORT_OPENGL
Definition: wingdi.h:306
#define PFD_MAIN_PLANE
Definition: wingdi.h:298
#define CreateWindowA(a, b, c, d, e, f, g, h, i, j, k)
Definition: winuser.h:4315
BOOL WINAPI DestroyWindow(_In_ HWND)

Referenced by wined3d_adapter_init().

◆ wined3d_caps_gl_ctx_create_attribs()

static BOOL wined3d_caps_gl_ctx_create_attribs ( struct wined3d_caps_gl_ctx caps_gl_ctx,
struct wined3d_gl_info gl_info 
)
static

Definition at line 336 of file directx.c.

338{
339 HGLRC new_ctx;
340
341 if (!(gl_info->p_wglCreateContextAttribsARB = (void *)wglGetProcAddress("wglCreateContextAttribsARB")))
342 return TRUE;
343
344 if (!(new_ctx = context_create_wgl_attribs(gl_info, caps_gl_ctx->dc, NULL)))
345 {
346 gl_info->p_wglCreateContextAttribsARB = NULL;
347 return FALSE;
348 }
349
350 if (!wglMakeCurrent(caps_gl_ctx->dc, new_ctx))
351 {
352 ERR("Failed to make new context current, last error %#x.\n", GetLastError());
353 if (!wglDeleteContext(new_ctx))
354 ERR("Failed to delete new context, last error %#x.\n", GetLastError());
355 gl_info->p_wglCreateContextAttribsARB = NULL;
356 return TRUE;
357 }
358
359 if (!wglDeleteContext(caps_gl_ctx->gl_ctx))
360 ERR("Failed to delete old context, last error %#x.\n", GetLastError());
361 caps_gl_ctx->gl_ctx = new_ctx;
362
363 return TRUE;
364}
HGLRC context_create_wgl_attribs(const struct wined3d_gl_info *gl_info, HDC hdc, HGLRC share_ctx)
Definition: context.c:1857
static HGLRC(WINAPI *pwglCreateContextAttribsARB)(HDC hDC
PROC WINAPI wglGetProcAddress(LPCSTR name)
Definition: wgl.c:629

Referenced by wined3d_adapter_init().

◆ wined3d_caps_gl_ctx_destroy()

static void wined3d_caps_gl_ctx_destroy ( const struct wined3d_caps_gl_ctx ctx)
static

Definition at line 305 of file directx.c.

306{
307 const struct wined3d_gl_info *gl_info = ctx->gl_info;
308
309 TRACE("Destroying caps GL context.\n");
310
311 /* Both glDeleteProgram and glDeleteBuffers silently ignore 0 IDs but
312 * this function might be called before the relevant function pointers
313 * in gl_info are initialized. */
314 if (ctx->test_program_id || ctx->test_vbo)
315 {
316 GL_EXTCALL(glDeleteProgram(ctx->test_program_id));
317 GL_EXTCALL(glDeleteBuffers(1, &ctx->test_vbo));
318 }
319
320 if (!wglMakeCurrent(NULL, NULL))
321 ERR("Failed to disable caps GL context.\n");
322
323 if (!wglDeleteContext(ctx->gl_ctx))
324 {
326 ERR("wglDeleteContext(%p) failed, last error %#x.\n", ctx->gl_ctx, err);
327 }
328
329 wined3d_release_dc(ctx->wnd, ctx->dc);
330 DestroyWindow(ctx->wnd);
331
332 if (ctx->restore_gl_ctx && !wglMakeCurrent(ctx->restore_dc, ctx->restore_gl_ctx))
333 ERR("Failed to restore previous GL context.\n");
334}
void wined3d_release_dc(HWND window, HDC dc)
Definition: utils.c:6444
#define err(...)

Referenced by wined3d_adapter_init().

◆ wined3d_check_depth_stencil_match()

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 
)

Definition at line 5091 of file directx.c.

5094{
5095 const struct wined3d_format *rt_format;
5096 const struct wined3d_format *ds_format;
5097 const struct wined3d_adapter *adapter;
5098
5099 TRACE("wined3d %p, adapter_idx %u, device_type %s,\n"
5100 "adapter_format %s, render_target_format %s, depth_stencil_format %s.\n",
5101 wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(adapter_format_id),
5102 debug_d3dformat(render_target_format_id), debug_d3dformat(depth_stencil_format_id));
5103
5104 if (adapter_idx >= wined3d->adapter_count)
5106
5107 adapter = &wined3d->adapters[adapter_idx];
5108 rt_format = wined3d_get_format(&adapter->gl_info, render_target_format_id, WINED3DUSAGE_RENDERTARGET);
5109 ds_format = wined3d_get_format(&adapter->gl_info, depth_stencil_format_id, WINED3DUSAGE_DEPTHSTENCIL);
5111 {
5114 {
5115 TRACE("Formats match.\n");
5116 return WINED3D_OK;
5117 }
5118 }
5119 else
5120 {
5121 const struct wined3d_pixel_format *cfgs;
5122 unsigned int cfg_count;
5123 unsigned int i;
5124
5125 cfgs = adapter->cfgs;
5126 cfg_count = adapter->cfg_count;
5127 for (i = 0; i < cfg_count; ++i)
5128 {
5129 if (wined3d_check_pixel_format_color(&adapter->gl_info, &cfgs[i], rt_format)
5130 && wined3d_check_pixel_format_depth(&adapter->gl_info, &cfgs[i], ds_format))
5131 {
5132 TRACE("Formats match.\n");
5133 return WINED3D_OK;
5134 }
5135 }
5136 }
5137
5138 TRACE("Unsupported format pair: %s and %s.\n",
5139 debug_d3dformat(render_target_format_id),
5140 debug_d3dformat(depth_stencil_format_id));
5141
5143}
device_type
const char * debug_d3ddevicetype(enum wined3d_device_type device_type)
Definition: utils.c:4153
#define WINED3D_OK
Definition: wined3d.h:37
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:46
#define WINED3DUSAGE_RENDERTARGET
Definition: wined3d.h:899
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:48
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900
@ WINED3D_GL_RES_TYPE_TEX_2D

Referenced by d3d8_CheckDepthStencilMatch(), and d3d9_CheckDepthStencilMatch().

◆ wined3d_check_device_format()

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 
)

Definition at line 5334 of file directx.c.

5337{
5338 const struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
5339 const struct wined3d_gl_info *gl_info = &adapter->gl_info;
5340 const struct wined3d_format *adapter_format, *format;
5341 enum wined3d_gl_resource_type gl_type, gl_type_end;
5342 BOOL mipmap_gen_supported = TRUE;
5343 DWORD format_flags = 0;
5344 DWORD allowed_usage;
5345
5346 TRACE("wined3d %p, adapter_idx %u, device_type %s, adapter_format %s, usage %s, %s, "
5347 "resource_type %s, check_format %s.\n",
5348 wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(adapter_format_id),
5350 debug_d3dformat(check_format_id));
5351
5352 if (adapter_idx >= wined3d->adapter_count)
5354
5355 adapter_format = wined3d_get_format(gl_info, adapter_format_id, WINED3DUSAGE_RENDERTARGET);
5356 format = wined3d_get_format(gl_info, check_format_id, usage);
5357
5358 switch (resource_type)
5359 {
5360 case WINED3D_RTYPE_NONE:
5361 allowed_usage = WINED3DUSAGE_DEPTHSTENCIL
5364 gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D;
5365 break;
5366
5368 allowed_usage = WINED3DUSAGE_DYNAMIC
5377 gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_1D;
5378 break;
5379
5381 allowed_usage = WINED3DUSAGE_DEPTHSTENCIL
5385 allowed_usage |= WINED3DUSAGE_QUERY_SRGBWRITE;
5386 if (!(usage & WINED3DUSAGE_TEXTURE))
5387 {
5389 {
5390 TRACE("[FAILED] - Not supported for plain surfaces.\n");
5392 }
5393
5394 gl_type = gl_type_end = WINED3D_GL_RES_TYPE_RB;
5395 break;
5396 }
5397 allowed_usage |= WINED3DUSAGE_DYNAMIC
5408 gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_2D;
5410 {
5412 gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_CUBE;
5413 }
5414 else if ((usage & WINED3DUSAGE_DEPTHSTENCIL)
5416 && !gl_info->supported[ARB_SHADOW])
5417 {
5418 TRACE("[FAILED] - No shadow sampler support.\n");
5420 }
5421 break;
5422
5424 allowed_usage = WINED3DUSAGE_DYNAMIC
5433 gl_type = gl_type_end = WINED3D_GL_RES_TYPE_TEX_3D;
5434 break;
5435
5437 allowed_usage = WINED3DUSAGE_DYNAMIC
5439 gl_type = gl_type_end = WINED3D_GL_RES_TYPE_BUFFER;
5440 break;
5441
5442 default:
5443 FIXME("Unhandled resource type %s.\n", debug_d3dresourcetype(resource_type));
5445 }
5446
5447 if ((usage & allowed_usage) != usage)
5448 {
5449 TRACE("Requested usage %#x, but resource type %s only allows %#x.\n",
5450 usage, debug_d3dresourcetype(resource_type), allowed_usage);
5452 }
5453
5455 format_flags |= WINED3DFMT_FLAG_TEXTURE;
5457 format_flags |= WINED3DFMT_FLAG_FILTERING;
5461 format_flags |= WINED3DFMT_FLAG_SRGB_READ;
5463 format_flags |= WINED3DFMT_FLAG_SRGB_WRITE;
5465 format_flags |= WINED3DFMT_FLAG_VTF;
5467 format_flags |= WINED3DFMT_FLAG_BUMPMAP;
5468
5469 if ((format_flags & WINED3DFMT_FLAG_TEXTURE) && (wined3d->flags & WINED3D_NO3D))
5470 {
5471 TRACE("Requested texturing support, but wined3d was created with WINED3D_NO3D.\n");
5473 }
5474
5475 for (; gl_type <= gl_type_end; ++gl_type)
5476 {
5477 if ((format->flags[gl_type] & format_flags) != format_flags)
5478 {
5479 TRACE("Requested format flags %#x, but format %s only has %#x.\n",
5480 format_flags, debug_d3dformat(check_format_id), format->flags[gl_type]);
5482 }
5483
5485 && !CheckRenderTargetCapability(adapter, adapter_format, format, gl_type))
5486 {
5487 TRACE("Requested WINED3DUSAGE_RENDERTARGET, but format %s is not supported for render targets.\n",
5488 debug_d3dformat(check_format_id));
5490 }
5491
5492 /* 3D depth / stencil textures are never supported. */
5494 continue;
5495
5497 && !CheckDepthStencilCapability(adapter, adapter_format, format, gl_type))
5498 {
5499 TRACE("Requested WINED3DUSAGE_DEPTHSTENCIL, but format %s is not supported for depth / stencil buffers.\n",
5500 debug_d3dformat(check_format_id));
5502 }
5503
5504 if (!(format->flags[gl_type] & WINED3DFMT_FLAG_GEN_MIPMAP))
5505 mipmap_gen_supported = FALSE;
5506 }
5507
5508 if ((usage & WINED3DUSAGE_QUERY_GENMIPMAP) && !mipmap_gen_supported)
5509 {
5510 TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n");
5511 return WINED3DOK_NOMIPGEN;
5512 }
5513
5514 return WINED3D_OK;
5515}
const char * debug_d3dresourcetype(enum wined3d_resource_type resource_type)
Definition: utils.c:4329
const char * debug_d3dusage(DWORD usage)
Definition: utils.c:4217
const char * debug_d3dusagequery(DWORD usage)
Definition: utils.c:4249
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
static BOOL wined3d_check_surface_capability(const struct wined3d_format *format, BOOL no3d)
Definition: directx.c:5274
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)
Definition: directx.c:5233
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)
Definition: directx.c:5190
#define WINED3DUSAGE_QUERY_LEGACYBUMPMAP
Definition: wined3d.h:924
#define WINED3D_NO3D
Definition: wined3d.h:1316
#define WINED3DUSAGE_LEGACY_CUBEMAP
Definition: wined3d.h:917
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
@ WINED3D_RTYPE_TEXTURE_1D
Definition: wined3d.h:699
@ WINED3D_RTYPE_NONE
Definition: wined3d.h:697
@ WINED3D_RTYPE_BUFFER
Definition: wined3d.h:698
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:701
#define WINED3DUSAGE_QUERY_SRGBREAD
Definition: wined3d.h:927
#define WINED3DUSAGE_QUERY_FILTER
Definition: wined3d.h:925
#define WINED3DUSAGE_QUERY_WRAPANDMIP
Definition: wined3d.h:930
#define WINED3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING
Definition: wined3d.h:926
#define WINED3DUSAGE_QUERY_VERTEXTEXTURE
Definition: wined3d.h:929
#define WINED3DUSAGE_QUERY_GENMIPMAP
Definition: wined3d.h:923
#define WINED3DUSAGE_DYNAMIC
Definition: wined3d.h:907
#define WINED3DUSAGE_QUERY_SRGBWRITE
Definition: wined3d.h:928
#define WINED3DUSAGE_TEXTURE
Definition: wined3d.h:918
#define WINED3DOK_NOMIPGEN
Definition: wined3d.h:41
#define WINED3DUSAGE_SOFTWAREPROCESSING
Definition: wined3d.h:902
#define WINED3DFMT_FLAG_BUMPMAP
#define WINED3DFMT_FLAG_SHADOW
#define WINED3DFMT_FLAG_SRGB_WRITE
#define WINED3DFMT_FLAG_VTF
#define WINED3DFMT_FLAG_SRGB_READ
wined3d_gl_resource_type
@ WINED3D_GL_RES_TYPE_TEX_3D
@ WINED3D_GL_RES_TYPE_TEX_CUBE
@ WINED3D_GL_RES_TYPE_BUFFER
@ WINED3D_GL_RES_TYPE_RB
@ WINED3D_GL_RES_TYPE_TEX_1D
#define WINED3DFMT_FLAG_TEXTURE
#define WINED3DFMT_FLAG_FILTERING
#define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING
#define WINED3DFMT_FLAG_GEN_MIPMAP

Referenced by d3d7_EnumZBufferFormats(), d3d8_CheckDeviceFormat(), d3d9_CheckDeviceFormat(), d3d_device2_EnumTextureFormats(), d3d_device7_EnumTextureFormats(), ddraw7_GetFourCCCodes(), ddraw_surface_create(), and wined3d_check_device_type().

◆ wined3d_check_device_format_conversion()

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 
)

Definition at line 5536 of file directx.c.

5538{
5539 FIXME("wined3d %p, adapter_idx %u, device_type %s, src_format %s, dst_format %s stub!\n",
5540 wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(src_format),
5542
5543 return WINED3D_OK;
5544}
static const char * dst_format
Definition: dib.c:1133

Referenced by d3d9_CheckDeviceFormatConversion(), and wined3d_check_device_type().

◆ wined3d_check_device_multisample_type()

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 
)

Definition at line 5145 of file directx.c.

5148{
5149 const struct wined3d_gl_info *gl_info = &wined3d->adapters[adapter_idx].gl_info;
5150 const struct wined3d_format *format = wined3d_get_format(gl_info, surface_format_id, 0);
5152
5153 TRACE("wined3d %p, adapter_idx %u, device_type %s, surface_format %s, "
5154 "windowed %#x, multisample_type %#x, quality_levels %p.\n",
5155 wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(surface_format_id),
5156 windowed, multisample_type, quality_levels);
5157
5158 if (adapter_idx >= wined3d->adapter_count)
5160 if (surface_format_id == WINED3DFMT_UNKNOWN)
5162 if (multisample_type < WINED3D_MULTISAMPLE_NONE)
5164 if (multisample_type > WINED3D_MULTISAMPLE_16_SAMPLES)
5165 {
5166 FIXME("multisample_type %u not handled yet.\n", multisample_type);
5168 }
5169
5170 if (multisample_type && !(format->multisample_types & 1u << (multisample_type - 1)))
5172
5173 if (SUCCEEDED(hr) || (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE && format->multisample_types))
5174 {
5175 if (quality_levels)
5176 {
5177 if (multisample_type == WINED3D_MULTISAMPLE_NON_MASKABLE)
5178 *quality_levels = wined3d_popcount(format->multisample_types);
5179 else
5180 *quality_levels = 1;
5181 }
5182 return WINED3D_OK;
5183 }
5184
5185 TRACE("Returning not supported.\n");
5186 return hr;
5187}
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
@ WINED3D_MULTISAMPLE_NON_MASKABLE
Definition: wined3d.h:555
@ WINED3D_MULTISAMPLE_16_SAMPLES
Definition: wined3d.h:570
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:554
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:107
static unsigned int wined3d_popcount(unsigned int x)

Referenced by d3d8_CheckDeviceMultiSampleType(), and d3d9_CheckDeviceMultiSampleType().

◆ wined3d_check_device_type()

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 
)

Definition at line 5546 of file directx.c.

5549{
5550 BOOL present_conversion = wined3d->flags & WINED3D_PRESENT_CONVERSION;
5551
5552 TRACE("wined3d %p, adapter_idx %u, device_type %s, display_format %s, backbuffer_format %s, windowed %#x.\n",
5553 wined3d, adapter_idx, debug_d3ddevicetype(device_type), debug_d3dformat(display_format),
5554 debug_d3dformat(backbuffer_format), windowed);
5555
5556 if (adapter_idx >= wined3d->adapter_count)
5558
5559 /* The task of this function is to check whether a certain display / backbuffer format
5560 * combination is available on the given adapter. In fullscreen mode microsoft specified
5561 * that the display format shouldn't provide alpha and that ignoring alpha the backbuffer
5562 * and display format should match exactly.
5563 * In windowed mode format conversion can occur and this depends on the driver. */
5564
5565 /* There are only 4 display formats. */
5566 if (!(display_format == WINED3DFMT_B5G6R5_UNORM
5567 || display_format == WINED3DFMT_B5G5R5X1_UNORM
5568 || display_format == WINED3DFMT_B8G8R8X8_UNORM
5569 || display_format == WINED3DFMT_B10G10R10A2_UNORM))
5570 {
5571 TRACE("Format %s is not supported as display format.\n", debug_d3dformat(display_format));
5573 }
5574
5575 if (!windowed)
5576 {
5577 /* If the requested display format is not available, don't continue. */
5578 if (!wined3d_get_adapter_mode_count(wined3d, adapter_idx,
5579 display_format, WINED3D_SCANLINE_ORDERING_UNKNOWN))
5580 {
5581 TRACE("No available modes for display format %s.\n", debug_d3dformat(display_format));
5583 }
5584
5585 present_conversion = FALSE;
5586 }
5587 else if (display_format == WINED3DFMT_B10G10R10A2_UNORM)
5588 {
5589 /* WINED3DFMT_B10G10R10A2_UNORM is only allowed in fullscreen mode. */
5590 TRACE("Unsupported format combination %s / %s in windowed mode.\n",
5591 debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
5593 }
5594
5595 if (present_conversion)
5596 {
5597 /* Use the display format as back buffer format if the latter is
5598 * WINED3DFMT_UNKNOWN. */
5599 if (backbuffer_format == WINED3DFMT_UNKNOWN)
5600 backbuffer_format = display_format;
5601
5603 device_type, backbuffer_format, display_format)))
5604 {
5605 TRACE("Format conversion from %s to %s not supported.\n",
5606 debug_d3dformat(backbuffer_format), debug_d3dformat(display_format));
5608 }
5609 }
5610 else
5611 {
5612 /* When format conversion from the back buffer format to the display
5613 * format is not allowed, only a limited number of combinations are
5614 * valid. */
5615
5616 if (display_format == WINED3DFMT_B5G6R5_UNORM && backbuffer_format != WINED3DFMT_B5G6R5_UNORM)
5617 {
5618 TRACE("Unsupported format combination %s / %s.\n",
5619 debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
5621 }
5622
5623 if (display_format == WINED3DFMT_B5G5R5X1_UNORM
5624 && !(backbuffer_format == WINED3DFMT_B5G5R5X1_UNORM || backbuffer_format == WINED3DFMT_B5G5R5A1_UNORM))
5625 {
5626 TRACE("Unsupported format combination %s / %s.\n",
5627 debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
5629 }
5630
5631 if (display_format == WINED3DFMT_B8G8R8X8_UNORM
5632 && !(backbuffer_format == WINED3DFMT_B8G8R8X8_UNORM || backbuffer_format == WINED3DFMT_B8G8R8A8_UNORM))
5633 {
5634 TRACE("Unsupported format combination %s / %s.\n",
5635 debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
5637 }
5638
5639 if (display_format == WINED3DFMT_B10G10R10A2_UNORM
5640 && backbuffer_format != WINED3DFMT_B10G10R10A2_UNORM)
5641 {
5642 TRACE("Unsupported format combination %s / %s.\n",
5643 debug_d3dformat(display_format), debug_d3dformat(backbuffer_format));
5645 }
5646 }
5647
5648 /* Validate that the back buffer format is usable for render targets. */
5649 if (FAILED(wined3d_check_device_format(wined3d, adapter_idx, device_type, display_format,
5651 {
5652 TRACE("Format %s not allowed for render targets.\n", debug_d3dformat(backbuffer_format));
5654 }
5655
5656 return WINED3D_OK;
5657}
#define FAILED(hr)
Definition: intsafe.h:51
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)
Definition: directx.c:5536
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)
Definition: directx.c:5334
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)
Definition: directx.c:4536
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:223
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:224
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:109
@ WINED3DFMT_B10G10R10A2_UNORM
Definition: wined3d.h:115
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:221
#define WINED3D_PRESENT_CONVERSION
Definition: wined3d.h:1318
@ WINED3D_SCANLINE_ORDERING_UNKNOWN
Definition: wined3d.h:832

Referenced by d3d8_CheckDeviceType(), and d3d9_CheckDeviceType().

◆ wined3d_check_pixel_format_color()

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

Definition at line 5041 of file directx.c.

5043{
5044 /* Float formats need FBOs. If FBOs are used this function isn't called */
5046 return FALSE;
5047
5048 /* Probably a RGBA_float or color index mode. */
5049 if (cfg->iPixelType != WGL_TYPE_RGBA_ARB)
5050 return FALSE;
5051
5052 if (cfg->redSize < format->red_size
5053 || cfg->greenSize < format->green_size
5054 || cfg->blueSize < format->blue_size
5055 || cfg->alphaSize < format->alpha_size)
5056 return FALSE;
5057
5058 return TRUE;
5059}
#define WINED3DFMT_FLAG_FLOAT

Referenced by CheckDepthStencilCapability(), CheckRenderTargetCapability(), and wined3d_check_depth_stencil_match().

◆ wined3d_check_pixel_format_depth()

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 
)
static

Definition at line 5061 of file directx.c.

5063{
5064 BOOL lockable = FALSE;
5065
5066 /* Float formats need FBOs. If FBOs are used this function isn't called */
5068 return FALSE;
5069
5071 lockable = TRUE;
5072
5073 /* On some modern cards like the Geforce8/9, GLX doesn't offer some
5074 * depth/stencil formats which D3D9 reports. We can safely report
5075 * "compatible" formats (e.g. D24 can be used for D16) as long as we
5076 * aren't dealing with a lockable format. This also helps D3D <= 7 as they
5077 * expect D16 which isn't offered without this on Geforce8 cards. */
5078 if (!(cfg->depthSize == format->depth_size || (!lockable && cfg->depthSize > format->depth_size)))
5079 return FALSE;
5080
5081 /* Some cards like Intel i915 ones only offer D24S8 but lots of games also
5082 * need a format without stencil. We can allow a mismatch if the format
5083 * doesn't have any stencil bits. If it does have stencil bits the size
5084 * must match, or stencil wrapping would break. */
5085 if (format->stencil_size && cfg->stencilSize != format->stencil_size)
5086 return FALSE;
5087
5088 return TRUE;
5089}
@ WINED3DFMT_D32_FLOAT
Definition: wined3d.h:176
@ WINED3DFMT_D16_LOCKABLE
Definition: wined3d.h:127

Referenced by CheckDepthStencilCapability(), and wined3d_check_depth_stencil_match().

◆ wined3d_check_surface_capability()

static BOOL wined3d_check_surface_capability ( const struct wined3d_format format,
BOOL  no3d 
)
static

Definition at line 5274 of file directx.c.

5275{
5276 if (no3d)
5277 {
5278 switch (format->id)
5279 {
5281 TRACE("[FAILED] - Not enumerated on Windows.\n");
5282 return FALSE;
5299 case WINED3DFMT_P8_UINT:
5300 TRACE("[OK]\n");
5301 return TRUE;
5302 default:
5303 TRACE("[FAILED] - Not available on GDI surfaces.\n");
5304 return FALSE;
5305 }
5306 }
5307
5308 if (format->glInternal)
5309 {
5310 TRACE("[OK]\n");
5311 return TRUE;
5312 }
5313
5316 {
5317 TRACE("[OK]\n");
5318 return TRUE;
5319 }
5320
5321 /* Reject other formats */
5322 TRACE("[FAILED]\n");
5323 return FALSE;
5324}
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:111
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:110
@ WINED3DFMT_R16G16_UNORM
Definition: wined3d.h:171
@ WINED3DFMT_R10G10B10A2_UNORM
Definition: wined3d.h:158
@ WINED3DFMT_B2G3R3A8_UNORM
Definition: wined3d.h:112
@ WINED3DFMT_R8G8B8X8_UNORM
Definition: wined3d.h:114
@ WINED3DFMT_B8G8R8_UNORM
Definition: wined3d.h:108
@ WINED3DFMT_R8G8B8A8_UNORM
Definition: wined3d.h:164
@ WINED3DFMT_R16G16B16A16_UNORM
Definition: wined3d.h:145
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:117
@ WINED3DFMT_A8_UNORM
Definition: wined3d.h:201
@ WINED3DFMT_B4G4R4X4_UNORM
Definition: wined3d.h:113
#define WINED3DFMT_FLAG_EXTENSION

Referenced by wined3d_check_device_format().

◆ wined3d_decref()

ULONG CDECL wined3d_decref ( struct wined3d wined3d)

Definition at line 465 of file directx.c.

466{
468
469 TRACE("%p decreasing refcount to %u.\n", wined3d, refcount);
470
471 if (!refcount)
472 {
473 unsigned int i;
474
475 for (i = 0; i < wined3d->adapter_count; ++i)
476 {
478 }
480 }
481
482 return refcount;
483}
#define InterlockedDecrement
Definition: armddk.h:52
uint32_t ULONG
Definition: typedefs.h:59
static void wined3d_adapter_cleanup(struct wined3d_adapter *adapter)
Definition: directx.c:450

Referenced by d3d8_Release(), d3d9_Release(), ddraw_destroy(), ddraw_init(), device_init(), DirectDrawEnumerateExA(), and wined3d_device_decref().

◆ wined3d_device_create()

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 
)

Definition at line 6244 of file directx.c.

6247{
6248 struct wined3d_device *object;
6249 HRESULT hr;
6250
6251 TRACE("wined3d %p, adapter_idx %u, device_type %#x, focus_window %p, flags %#x, surface_alignment %u, device_parent %p, device %p.\n",
6253
6254 /* Validate the adapter number. If no adapters are available(no GL), ignore the adapter
6255 * number and create a device without a 3D adapter for 2D only operation. */
6256 if (wined3d->adapter_count && adapter_idx >= wined3d->adapter_count)
6258
6259 if (!(object = heap_alloc_zero(sizeof(*object))))
6260 return E_OUTOFMEMORY;
6261
6262 hr = device_init(object, wined3d, adapter_idx, device_type,
6264 if (FAILED(hr))
6265 {
6266 WARN("Failed to initialize device, hr %#x.\n", hr);
6267 heap_free(object);
6268 return hr;
6269 }
6270
6271 TRACE("Created device %p.\n", object);
6272 *device = object;
6273
6274 device_parent->ops->wined3d_device_created(device_parent, *device);
6275
6276 return WINED3D_OK;
6277}
HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter, D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN
Definition: device.c:3279
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
struct wined3d_device_parent * device_parent
unsigned char surface_alignment

Referenced by ddraw_init(), and device_init().

◆ wined3d_enum_adapter_modes()

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 
)

Definition at line 4589 of file directx.c.

4592{
4593 const struct wined3d_adapter *adapter;
4594 const struct wined3d_format *format;
4595 UINT format_bits;
4596 DEVMODEW m;
4597 UINT i = 0;
4598 int j = 0;
4599
4600 TRACE("wined3d %p, adapter_idx %u, format %s, scanline_ordering %#x, mode_idx %u, mode %p.\n",
4601 wined3d, adapter_idx, debug_d3dformat(format_id), scanline_ordering, mode_idx, mode);
4602
4603 if (!mode || adapter_idx >= wined3d->adapter_count)
4605
4606 adapter = &wined3d->adapters[adapter_idx];
4608 format_bits = format->byte_count * CHAR_BIT;
4609
4610 memset(&m, 0, sizeof(m));
4611 m.dmSize = sizeof(m);
4612
4613 while (i <= mode_idx)
4614 {
4615 if (!EnumDisplaySettingsExW(adapter->DeviceName, j++, &m, 0))
4616 {
4617 WARN("Invalid mode_idx %u.\n", mode_idx);
4619 }
4620
4621 if (m.dmFields & DM_DISPLAYFLAGS)
4622 {
4623 if (scanline_ordering == WINED3D_SCANLINE_ORDERING_PROGRESSIVE
4624 && (m.u2.dmDisplayFlags & DM_INTERLACED))
4625 continue;
4626
4627 if (scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED
4628 && !(m.u2.dmDisplayFlags & DM_INTERLACED))
4629 continue;
4630 }
4631
4633 {
4634 /* This is for d3d8, do not enumerate P8 here. */
4635 if (m.dmBitsPerPel == 32 || m.dmBitsPerPel == 16) ++i;
4636 }
4637 else if (m.dmBitsPerPel == format_bits)
4638 {
4639 ++i;
4640 }
4641 }
4642
4643 mode->width = m.dmPelsWidth;
4644 mode->height = m.dmPelsHeight;
4645 mode->refresh_rate = DEFAULT_REFRESH_RATE;
4646 if (m.dmFields & DM_DISPLAYFREQUENCY)
4647 mode->refresh_rate = m.dmDisplayFrequency;
4648
4650 mode->format_id = pixelformat_for_depth(m.dmBitsPerPel);
4651 else
4652 mode->format_id = format_id;
4653
4654 if (!(m.dmFields & DM_DISPLAYFLAGS))
4655 mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
4656 else if (m.u2.dmDisplayFlags & DM_INTERLACED)
4657 mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_INTERLACED;
4658 else
4659 mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_PROGRESSIVE;
4660
4661 TRACE("%ux%u@%u %u bpp, %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
4662 m.dmBitsPerPel, debug_d3dformat(mode->format_id), mode->scanline_ordering);
4663
4664 return WINED3D_OK;
4665}
enum wined3d_format_id pixelformat_for_depth(DWORD depth)
Definition: utils.c:5388
#define CHAR_BIT
Definition: urlcache.c:62
GLenum mode
Definition: glext.h:6217
const GLfloat * m
Definition: glext.h:10848
BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode, DWORD dwFlags)
Definition: display.c:330
#define DEFAULT_REFRESH_RATE
Definition: directx.c:36
@ WINED3D_SCANLINE_ORDERING_INTERLACED
Definition: wined3d.h:834
@ WINED3D_SCANLINE_ORDERING_PROGRESSIVE
Definition: wined3d.h:833
#define DM_DISPLAYFREQUENCY
Definition: wingdi.h:1272
#define DM_INTERLACED
Definition: wingdi.h:1228
#define DM_DISPLAYFLAGS
Definition: wingdi.h:1271

Referenced by d3d8_EnumAdapterModes(), d3d9_EnumAdapterModes(), d3d9_EnumAdapterModesEx(), ddraw7_EnumDisplayModes(), and wined3d_find_closest_matching_adapter_mode().

◆ wined3d_find_closest_matching_adapter_mode()

HRESULT CDECL wined3d_find_closest_matching_adapter_mode ( const struct wined3d wined3d,
unsigned int  adapter_idx,
struct wined3d_display_mode mode 
)

Definition at line 4667 of file directx.c.

4669{
4670 unsigned int i, j, mode_count, matching_mode_count, closest;
4671 struct wined3d_display_mode **matching_modes;
4672 struct wined3d_display_mode *modes;
4673 HRESULT hr;
4674
4675 TRACE("wined3d %p, adapter_idx %u, mode %p.\n", wined3d, adapter_idx, mode);
4676
4677 if (!(mode_count = wined3d_get_adapter_mode_count(wined3d, adapter_idx,
4679 {
4680 WARN("Adapter has 0 matching modes.\n");
4681 return E_FAIL;
4682 }
4683
4684 if (!(modes = heap_calloc(mode_count, sizeof(*modes))))
4685 return E_OUTOFMEMORY;
4686 if (!(matching_modes = heap_calloc(mode_count, sizeof(*matching_modes))))
4687 {
4688 heap_free(modes);
4689 return E_OUTOFMEMORY;
4690 }
4691
4692 for (i = 0; i < mode_count; ++i)
4693 {
4694 if (FAILED(hr = wined3d_enum_adapter_modes(wined3d, adapter_idx,
4695 mode->format_id, WINED3D_SCANLINE_ORDERING_UNKNOWN, i, &modes[i])))
4696 {
4697 heap_free(matching_modes);
4698 heap_free(modes);
4699 return hr;
4700 }
4701 matching_modes[i] = &modes[i];
4702 }
4703
4704 matching_mode_count = mode_count;
4705
4706 if (mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN)
4707 {
4708 for (i = 0, j = 0; i < matching_mode_count; ++i)
4709 {
4710 if (matching_modes[i]->scanline_ordering == mode->scanline_ordering)
4711 matching_modes[j++] = matching_modes[i];
4712 }
4713 if (j > 0)
4714 matching_mode_count = j;
4715 }
4716
4717 if (mode->refresh_rate)
4718 {
4719 for (i = 0, j = 0; i < matching_mode_count; ++i)
4720 {
4721 if (matching_modes[i]->refresh_rate == mode->refresh_rate)
4722 matching_modes[j++] = matching_modes[i];
4723 }
4724 if (j > 0)
4725 matching_mode_count = j;
4726 }
4727
4728 if (!mode->width || !mode->height)
4729 {
4730 struct wined3d_display_mode current_mode;
4732 &current_mode, NULL)))
4733 {
4734 heap_free(matching_modes);
4735 heap_free(modes);
4736 return hr;
4737 }
4738 mode->width = current_mode.width;
4739 mode->height = current_mode.height;
4740 }
4741
4742 closest = ~0u;
4743 for (i = 0, j = 0; i < matching_mode_count; ++i)
4744 {
4745 unsigned int d = abs(mode->width - matching_modes[i]->width)
4746 + abs(mode->height - matching_modes[i]->height);
4747
4748 if (closest > d)
4749 {
4750 closest = d;
4751 j = i;
4752 }
4753 }
4754
4755 *mode = *matching_modes[j];
4756
4757 heap_free(matching_modes);
4758 heap_free(modes);
4759
4760 TRACE("Returning %ux%u@%u %s %#x.\n", mode->width, mode->height,
4761 mode->refresh_rate, debug_d3dformat(mode->format_id),
4762 mode->scanline_ordering);
4763
4764 return WINED3D_OK;
4765}
#define E_FAIL
Definition: ddrawi.h:102
#define abs(i)
Definition: fconv.c:206
enum wined3d_scanline_ordering scanline_ordering
Definition: wined3d.h:1585
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)
Definition: directx.c:4589
HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: directx.c:4767

Referenced by wined3d_swapchain_set_display_mode().

◆ wined3d_get_adapter_count()

UINT CDECL wined3d_get_adapter_count ( const struct wined3d wined3d)

Definition at line 4484 of file directx.c.

4485{
4486 TRACE("wined3d %p, reporting %u adapters.\n",
4488
4489 return wined3d->adapter_count;
4490}

Referenced by d3d8_GetAdapterCount(), and d3d9_GetAdapterCount().

◆ wined3d_get_adapter_display_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 
)

Definition at line 4767 of file directx.c.

4769{
4770 const struct wined3d_adapter *adapter;
4771 DEVMODEW m;
4772
4773 TRACE("wined3d %p, adapter_idx %u, display_mode %p, rotation %p.\n",
4774 wined3d, adapter_idx, mode, rotation);
4775
4776 if (!mode || adapter_idx >= wined3d->adapter_count)
4778
4779 adapter = &wined3d->adapters[adapter_idx];
4780
4781 memset(&m, 0, sizeof(m));
4782 m.dmSize = sizeof(m);
4783
4785 mode->width = m.dmPelsWidth;
4786 mode->height = m.dmPelsHeight;
4787 mode->refresh_rate = DEFAULT_REFRESH_RATE;
4788 if (m.dmFields & DM_DISPLAYFREQUENCY)
4789 mode->refresh_rate = m.dmDisplayFrequency;
4790 mode->format_id = pixelformat_for_depth(m.dmBitsPerPel);
4791
4792 /* Lie about the format. X11 can't change the color depth, and some apps
4793 * are pretty angry if they SetDisplayMode from 24 to 16 bpp and find out
4794 * that GetDisplayMode still returns 24 bpp. This should probably be
4795 * handled in winex11 instead. */
4796 if (adapter->screen_format && adapter->screen_format != mode->format_id)
4797 {
4798 WARN("Overriding format %s with stored format %s.\n",
4799 debug_d3dformat(mode->format_id),
4800 debug_d3dformat(adapter->screen_format));
4801 mode->format_id = adapter->screen_format;
4802 }
4803
4804 if (!(m.dmFields & DM_DISPLAYFLAGS))
4805 mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_UNKNOWN;
4806 else if (m.u2.dmDisplayFlags & DM_INTERLACED)
4807 mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_INTERLACED;
4808 else
4809 mode->scanline_ordering = WINED3D_SCANLINE_ORDERING_PROGRESSIVE;
4810
4811 if (rotation)
4812 {
4813 switch (m.u1.s2.dmDisplayOrientation)
4814 {
4815 case DMDO_DEFAULT:
4816 *rotation = WINED3D_DISPLAY_ROTATION_0;
4817 break;
4818 case DMDO_90:
4819 *rotation = WINED3D_DISPLAY_ROTATION_90;
4820 break;
4821 case DMDO_180:
4822 *rotation = WINED3D_DISPLAY_ROTATION_180;
4823 break;
4824 case DMDO_270:
4825 *rotation = WINED3D_DISPLAY_ROTATION_270;
4826 break;
4827 default:
4828 FIXME("Unhandled display rotation %#x.\n", m.u1.s2.dmDisplayOrientation);
4830 break;
4831 }
4832 }
4833
4834 TRACE("Returning %ux%u@%u %s %#x.\n", mode->width, mode->height,
4835 mode->refresh_rate, debug_d3dformat(mode->format_id),
4836 mode->scanline_ordering);
4837 return WINED3D_OK;
4838}
@ WINED3D_DISPLAY_ROTATION_270
Definition: wined3d.h:843
@ WINED3D_DISPLAY_ROTATION_0
Definition: wined3d.h:840
@ WINED3D_DISPLAY_ROTATION_180
Definition: wined3d.h:842
@ WINED3D_DISPLAY_ROTATION_UNSPECIFIED
Definition: wined3d.h:839
@ WINED3D_DISPLAY_ROTATION_90
Definition: wined3d.h:841
#define DMDO_DEFAULT
Definition: wingdi.h:1217
#define DMDO_180
Definition: wingdi.h:1219
#define DMDO_270
Definition: wingdi.h:1220
#define DMDO_90
Definition: wingdi.h:1218
#define ENUM_CURRENT_SETTINGS
Definition: winuser.h:179

Referenced by d3d7_EnumZBufferFormats(), d3d8_GetAdapterDisplayMode(), d3d9_GetAdapterDisplayMode(), d3d9_GetAdapterDisplayModeEx(), d3d_device2_EnumTextureFormats(), d3d_device7_EnumTextureFormats(), ddraw7_GetAvailableVidMem(), ddraw7_GetDisplayMode(), ddraw7_GetFourCCCodes(), ddraw7_GetMonitorFrequency(), ddraw_create_swapchain(), ddraw_set_cooperative_level(), ddraw_surface_create(), swapchain_init(), wined3d_device_set_cursor_properties(), wined3d_find_closest_matching_adapter_mode(), wined3d_get_adapter_raster_status(), wined3d_get_output_desc(), wined3d_swapchain_get_display_mode(), wined3d_swapchain_resize_target(), and wined3d_swapchain_set_fullscreen().

◆ wined3d_get_adapter_identifier()

HRESULT CDECL wined3d_get_adapter_identifier ( const struct wined3d wined3d,
UINT  adapter_idx,
DWORD  flags,
struct wined3d_adapter_identifier identifier 
)

Definition at line 4939 of file directx.c.

4941{
4942 const struct wined3d_adapter *adapter;
4943 size_t len;
4944
4945 TRACE("wined3d %p, adapter_idx %u, flags %#x, identifier %p.\n",
4946 wined3d, adapter_idx, flags, identifier);
4947
4948 if (adapter_idx >= wined3d->adapter_count)
4950
4951 adapter = &wined3d->adapters[adapter_idx];
4952
4953 if (identifier->driver_size)
4954 {
4955 const char *name = adapter->driver_info.name;
4956 len = min(strlen(name), identifier->driver_size - 1);
4957 memcpy(identifier->driver, name, len);
4958 memset(&identifier->driver[len], 0, identifier->driver_size - len);
4959 }
4960
4961 if (identifier->description_size)
4962 {
4963 const char *description = adapter->driver_info.description;
4964 len = min(strlen(description), identifier->description_size - 1);
4965 memcpy(identifier->description, description, len);
4966 memset(&identifier->description[len], 0, identifier->description_size - len);
4967 }
4968
4969 /* Note that d3d8 doesn't supply a device name. */
4970 if (identifier->device_name_size)
4971 {
4972 if (!WideCharToMultiByte(CP_ACP, 0, adapter->DeviceName, -1, identifier->device_name,
4973 identifier->device_name_size, NULL, NULL))
4974 {
4975 ERR("Failed to convert device name, last error %#x.\n", GetLastError());
4977 }
4978 }
4979
4980 identifier->driver_version.u.HighPart = adapter->driver_info.version_high;
4981 identifier->driver_version.u.LowPart = adapter->driver_info.version_low;
4982 identifier->vendor_id = adapter->driver_info.vendor;
4983 identifier->device_id = adapter->driver_info.device;
4984 identifier->subsystem_id = 0;
4985 identifier->revision = 0;
4986 memcpy(&identifier->device_identifier, &IID_D3DDEVICE_D3DUID, sizeof(identifier->device_identifier));
4987 identifier->whql_level = (flags & WINED3DENUM_NO_WHQL_LEVEL) ? 0 : 1;
4988 memcpy(&identifier->adapter_luid, &adapter->luid, sizeof(identifier->adapter_luid));
4989 identifier->video_memory = min(~(SIZE_T)0, adapter->vram_bytes);
4990
4991 return WINED3D_OK;
4992}
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
Definition: name.c:39
LARGE_INTEGER driver_version
Definition: wined3d.h:1719
ULONG_PTR SIZE_T
Definition: typedefs.h:80
struct _LARGE_INTEGER::@2295 u
static const GUID IID_D3DDEVICE_D3DUID
Definition: directx.c:94
#define WINED3DENUM_NO_WHQL_LEVEL
Definition: wined3d.h:858

Referenced by d3d8_GetAdapterIdentifier(), d3d9_GetAdapterIdentifier(), d3d9_GetAdapterLUID(), ddraw7_GetAvailableVidMem(), ddraw7_GetDeviceIdentifier(), and ddraw_enumerate_secondary_devices().

◆ wined3d_get_adapter_mode_count()

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 
)

Definition at line 4536 of file directx.c.

4538{
4539 const struct wined3d_adapter *adapter;
4540 const struct wined3d_format *format;
4541 unsigned int i = 0;
4542 unsigned int j = 0;
4543 UINT format_bits;
4544 DEVMODEW mode;
4545
4546 TRACE("wined3d %p, adapter_idx %u, format %s, scanline_ordering %#x.\n",
4547 wined3d, adapter_idx, debug_d3dformat(format_id), scanline_ordering);
4548
4549 if (adapter_idx >= wined3d->adapter_count)
4550 return 0;
4551
4552 adapter = &wined3d->adapters[adapter_idx];
4554 format_bits = format->byte_count * CHAR_BIT;
4555
4556 memset(&mode, 0, sizeof(mode));
4557 mode.dmSize = sizeof(mode);
4558
4559 while (EnumDisplaySettingsExW(adapter->DeviceName, j++, &mode, 0))
4560 {
4561 if (mode.dmFields & DM_DISPLAYFLAGS)
4562 {
4563 if (scanline_ordering == WINED3D_SCANLINE_ORDERING_PROGRESSIVE
4564 && (mode.u2.dmDisplayFlags & DM_INTERLACED))
4565 continue;
4566
4567 if (scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED
4568 && !(mode.u2.dmDisplayFlags & DM_INTERLACED))
4569 continue;
4570 }
4571
4573 {
4574 /* This is for d3d8, do not enumerate P8 here. */
4575 if (mode.dmBitsPerPel == 32 || mode.dmBitsPerPel == 16) ++i;
4576 }
4577 else if (mode.dmBitsPerPel == format_bits)
4578 {
4579 ++i;
4580 }
4581 }
4582
4583 TRACE("Returning %u matching modes (out of %u total) for adapter %u.\n", i, j, adapter_idx);
4584
4585 return i;
4586}

Referenced by d3d8_GetAdapterModeCount(), d3d9_GetAdapterModeCount(), d3d9_GetAdapterModeCountEx(), wined3d_check_device_type(), and wined3d_find_closest_matching_adapter_mode().

◆ wined3d_get_adapter_raster_status()

HRESULT CDECL wined3d_get_adapter_raster_status ( const struct wined3d wined3d,
UINT  adapter_idx,
struct wined3d_raster_status raster_status 
)

Definition at line 4994 of file directx.c.

4996{
4997 LONGLONG freq_per_frame, freq_per_line;
4998 LARGE_INTEGER counter, freq_per_sec;
5000 static UINT once;
5001
5002 if (!once++)
5003 FIXME("wined3d %p, adapter_idx %u, raster_status %p semi-stub!\n",
5004 wined3d, adapter_idx, raster_status);
5005 else
5006 WARN("wined3d %p, adapter_idx %u, raster_status %p semi-stub!\n",
5007 wined3d, adapter_idx, raster_status);
5008
5009 /* Obtaining the raster status is a widely implemented but optional
5010 * feature. When this method returns OK StarCraft 2 expects the
5011 * raster_status->InVBlank value to actually change over time.
5012 * And Endless Alice Crysis doesn't care even if this method fails.
5013 * Thus this method returns OK and fakes raster_status by
5014 * QueryPerformanceCounter. */
5015
5020 if (mode.refresh_rate == DEFAULT_REFRESH_RATE)
5021 mode.refresh_rate = 60;
5022
5023 freq_per_frame = freq_per_sec.QuadPart / mode.refresh_rate;
5024 /* Assume 20 scan lines in the vertical blank. */
5025 freq_per_line = freq_per_frame / (mode.height + 20);
5026 raster_status->scan_line = (counter.QuadPart % freq_per_frame) / freq_per_line;
5027 if (raster_status->scan_line < mode.height)
5028 raster_status->in_vblank = FALSE;
5029 else
5030 {
5031 raster_status->scan_line = 0;
5032 raster_status->in_vblank = TRUE;
5033 }
5034
5035 TRACE("Returning fake value, in_vblank %u, scan_line %u.\n",
5036 raster_status->in_vblank, raster_status->scan_line);
5037
5038 return WINED3D_OK;
5039}
BOOL WINAPI QueryPerformanceFrequency(OUT PLARGE_INTEGER lpFrequency)
Definition: perfcnt.c:45
BOOL WINAPI QueryPerformanceCounter(OUT PLARGE_INTEGER lpPerformanceCount)
Definition: perfcnt.c:23
int64_t LONGLONG
Definition: typedefs.h:68
LONGLONG QuadPart
Definition: typedefs.h:114

Referenced by ddraw7_GetScanLine(), ddraw7_GetVerticalBlankStatus(), and wined3d_swapchain_get_raster_status().

◆ wined3d_get_device_caps()

HRESULT CDECL wined3d_get_device_caps ( const struct wined3d wined3d,
UINT  adapter_idx,
enum wined3d_device_type  device_type,
WINED3DCAPS caps 
)

Definition at line 5659 of file directx.c.

5661{
5662 const struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx];
5663 const struct wined3d_d3d_info *d3d_info = &adapter->d3d_info;
5664 const struct wined3d_gl_info *gl_info = &adapter->gl_info;
5665 struct wined3d_vertex_caps vertex_caps;
5666 DWORD ckey_caps, blit_caps, fx_caps;
5668 struct shader_caps shader_caps;
5669
5670 TRACE("wined3d %p, adapter_idx %u, device_type %s, caps %p.\n",
5671 wined3d, adapter_idx, debug_d3ddevicetype(device_type), caps);
5672
5673 if (adapter_idx >= wined3d->adapter_count)
5675
5677 caps->AdapterOrdinal = adapter_idx;
5678
5679 caps->Caps = 0;
5685
5689
5692
5695
5710
5719 /* TODO:
5720 WINED3DPMISCCAPS_NULLREFERENCE
5721 WINED3DPMISCCAPS_FOGANDSPECULARALPHA
5722 WINED3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS
5723 WINED3DPMISCCAPS_FOGVERTEXCLAMPED */
5724
5729 if (gl_info->supported[EXT_DRAW_BUFFERS2])
5731 if (gl_info->supported[ARB_FRAMEBUFFER_SRGB])
5733
5746
5748 {
5752 }
5753
5762
5763 /* WINED3DPBLENDCAPS_BOTHINVSRCALPHA and WINED3DPBLENDCAPS_BOTHSRCALPHA
5764 * are legacy settings for srcblend only. */
5778
5789
5790 if (gl_info->supported[ARB_BLEND_FUNC_EXTENDED])
5792
5793 if (gl_info->supported[EXT_BLEND_COLOR])
5794 {
5797 }
5798
5799
5808
5817
5825
5827 {
5831 }
5832
5833 if (gl_info->supported[EXT_TEXTURE3D])
5834 {
5838 {
5840 }
5841 }
5842
5843 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
5844 {
5848 {
5850 }
5851 }
5852
5865
5867 {
5870 }
5871
5872 if (gl_info->supported[ARB_TEXTURE_CUBE_MAP])
5873 {
5886
5888 {
5891 }
5892 }
5893 else
5894 {
5895 caps->CubeTextureFilterCaps = 0;
5896 }
5897
5898 if (gl_info->supported[EXT_TEXTURE3D])
5899 {
5912 }
5913 else
5914 {
5915 caps->VolumeTextureFilterCaps = 0;
5916 }
5917
5921
5922 if (gl_info->supported[ARB_TEXTURE_BORDER_CLAMP])
5923 {
5925 }
5927 {
5929 }
5931 {
5933 }
5934
5935 if (gl_info->supported[EXT_TEXTURE3D])
5936 {
5940 if (gl_info->supported[ARB_TEXTURE_BORDER_CLAMP])
5941 {
5943 }
5945 {
5947 }
5949 {
5951 }
5952 }
5953 else
5954 {
5955 caps->VolumeTextureAddressCaps = 0;
5956 }
5957
5963 /* WINED3DLINECAPS_ANTIALIAS is not supported on Windows, and dx and gl seem to have a different
5964 * idea how generating the smoothing alpha values works; the result is different
5965 */
5966
5967 caps->MaxTextureWidth = gl_info->limits.texture_size;
5968 caps->MaxTextureHeight = gl_info->limits.texture_size;
5969
5970 if (gl_info->supported[EXT_TEXTURE3D])
5971 caps->MaxVolumeExtent = gl_info->limits.texture3d_size;
5972 else
5973 caps->MaxVolumeExtent = 0;
5974
5975 caps->MaxTextureRepeat = 32768;
5976 caps->MaxTextureAspectRatio = gl_info->limits.texture_size;
5977 caps->MaxVertexW = 1.0f;
5978
5979 caps->GuardBandLeft = 0.0f;
5980 caps->GuardBandTop = 0.0f;
5981 caps->GuardBandRight = 0.0f;
5982 caps->GuardBandBottom = 0.0f;
5983
5984 caps->ExtentsAdjust = 0.0f;
5985
5992 if (gl_info->supported[EXT_STENCIL_WRAP])
5993 {
5996 }
5998 || gl_info->supported[ATI_SEPARATE_STENCIL])
5999 {
6001 }
6002
6003 caps->MaxAnisotropy = gl_info->limits.anisotropy;
6004 caps->MaxPointSize = gl_info->limits.pointsize_max;
6005
6006 caps->MaxPrimitiveCount = 0x555555; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
6007 caps->MaxVertexIndex = 0xffffff; /* Taken from an AMD Radeon HD 5700 (Evergreen) GPU. */
6008 caps->MaxStreams = MAX_STREAMS;
6009 caps->MaxStreamStride = 1024;
6010
6011 /* d3d9.dll sets D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES here because StretchRects is implemented in d3d9 */
6015 caps->MasterAdapterOrdinal = 0;
6016 caps->AdapterOrdinalInGroup = 0;
6017 caps->NumberOfAdaptersInGroup = 1;
6018
6019 caps->NumSimultaneousRTs = gl_info->limits.buffers;
6020
6025 caps->VertexTextureFilterCaps = 0;
6026
6027 adapter->shader_backend->shader_get_caps(&adapter->gl_info, &shader_caps);
6028 adapter->fragment_pipe->get_caps(&adapter->gl_info, &fragment_caps);
6029 adapter->vertex_pipe->vp_get_caps(&adapter->gl_info, &vertex_caps);
6030
6031 /* Add shader misc caps. Only some of them belong to the shader parts of the pipeline */
6033
6036
6039
6043
6044 caps->MaxUserClipPlanes = vertex_caps.max_user_clip_planes;
6045 caps->MaxActiveLights = vertex_caps.max_active_lights;
6046 caps->MaxVertexBlendMatrices = vertex_caps.max_vertex_blend_matrices;
6048 caps->MaxVertexBlendMatrixIndex = vertex_caps.max_vertex_blend_matrix_index;
6049 else
6050 caps->MaxVertexBlendMatrixIndex = 255;
6051 caps->VertexProcessingCaps = vertex_caps.vertex_processing_caps;
6052 caps->FVFCaps = vertex_caps.fvf_caps;
6053 caps->RasterCaps |= vertex_caps.raster_caps;
6054
6055 /* The following caps are shader specific, but they are things we cannot detect, or which
6056 * are the same among all shader models. So to avoid code duplication set the shader version
6057 * specific, but otherwise constant caps here
6058 */
6059 if (caps->VertexShaderVersion >= 3)
6060 {
6061 /* Where possible set the caps based on OpenGL extensions and if they
6062 * aren't set (in case of software rendering) use the VS 3.0 from
6063 * MSDN or else if there's OpenGL spec use a hardcoded value minimum
6064 * VS3.0 value. */
6066 /* VS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
6067 caps->VS20Caps.dynamic_flow_control_depth = WINED3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH;
6068 caps->VS20Caps.temp_count = max(32, adapter->gl_info.limits.arb_vs_temps);
6069 /* level of nesting in loops / if-statements; VS 3.0 requires MAX (4) */
6070 caps->VS20Caps.static_flow_control_depth = WINED3DVS20_MAX_STATICFLOWCONTROLDEPTH;
6071
6072 caps->MaxVShaderInstructionsExecuted = 65535; /* VS 3.0 needs at least 65535, some cards even use 2^32-1 */
6073 caps->MaxVertexShader30InstructionSlots = max(512, adapter->gl_info.limits.arb_vs_instructions);
6075 }
6076 else if (caps->VertexShaderVersion == 2)
6077 {
6078 caps->VS20Caps.caps = 0;
6079 caps->VS20Caps.dynamic_flow_control_depth = WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH;
6080 caps->VS20Caps.temp_count = max(12, adapter->gl_info.limits.arb_vs_temps);
6081 caps->VS20Caps.static_flow_control_depth = 1;
6082
6083 caps->MaxVShaderInstructionsExecuted = 65535;
6085 }
6086 else
6087 { /* VS 1.x */
6088 caps->VS20Caps.caps = 0;
6089 caps->VS20Caps.dynamic_flow_control_depth = 0;
6090 caps->VS20Caps.temp_count = 0;
6091 caps->VS20Caps.static_flow_control_depth = 0;
6092
6095 }
6096
6097 if (caps->PixelShaderVersion >= 3)
6098 {
6099 /* Where possible set the caps based on OpenGL extensions and if they
6100 * aren't set (in case of software rendering) use the PS 3.0 from
6101 * MSDN or else if there's OpenGL spec use a hardcoded value minimum
6102 * PS 3.0 value. */
6103
6104 /* Caps is more or less undocumented on MSDN but it appears to be
6105 * used for PS20Caps based on results from R9600/FX5900/Geforce6800
6106 * cards from Windows */
6112 /* PS 3.0 requires MAX_DYNAMICFLOWCONTROLDEPTH (24) */
6113 caps->PS20Caps.dynamic_flow_control_depth = WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH;
6114 caps->PS20Caps.temp_count = max(32, adapter->gl_info.limits.arb_ps_temps);
6115 /* PS 3.0 requires MAX_STATICFLOWCONTROLDEPTH (4) */
6116 caps->PS20Caps.static_flow_control_depth = WINED3DPS20_MAX_STATICFLOWCONTROLDEPTH;
6117 /* PS 3.0 requires MAX_NUMINSTRUCTIONSLOTS (512) */
6118 caps->PS20Caps.instruction_slot_count = WINED3DPS20_MAX_NUMINSTRUCTIONSLOTS;
6119
6120 caps->MaxPShaderInstructionsExecuted = 65535;
6122 adapter->gl_info.limits.arb_ps_instructions);
6123 }
6124 else if(caps->PixelShaderVersion == 2)
6125 {
6126 /* Below we assume PS2.0 specs, not extended 2.0a(GeforceFX)/2.0b(Radeon R3xx) ones */
6127 caps->PS20Caps.caps = 0;
6128 caps->PS20Caps.dynamic_flow_control_depth = 0; /* WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH = 0 */
6129 caps->PS20Caps.temp_count = max(12, adapter->gl_info.limits.arb_ps_temps);
6130 caps->PS20Caps.static_flow_control_depth = WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH; /* Minimum: 1 */
6131 /* Minimum number (64 ALU + 32 Texture), a GeforceFX uses 512 */
6132 caps->PS20Caps.instruction_slot_count = WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS;
6133
6134 caps->MaxPShaderInstructionsExecuted = 512; /* Minimum value, a GeforceFX uses 1024 */
6136 }
6137 else /* PS 1.x */
6138 {
6139 caps->PS20Caps.caps = 0;
6140 caps->PS20Caps.dynamic_flow_control_depth = 0;
6141 caps->PS20Caps.temp_count = 0;
6142 caps->PS20Caps.static_flow_control_depth = 0;
6143 caps->PS20Caps.instruction_slot_count = 0;
6144
6147 }
6148
6149 if (caps->VertexShaderVersion >= 2)
6150 {
6151 /* OpenGL supports all the formats below, perhaps not always
6152 * without conversion, but it supports them.
6153 * Further GLSL doesn't seem to have an official unsigned type so
6154 * don't advertise it yet as I'm not sure how we handle it.
6155 * We might need to add some clamping in the shader engine to
6156 * support it.
6157 * TODO: WINED3DDTCAPS_USHORT2N, WINED3DDTCAPS_USHORT4N, WINED3DDTCAPS_UDEC3, WINED3DDTCAPS_DEC3N */
6162 if (gl_info->supported[ARB_HALF_FLOAT_VERTEX])
6163 {
6166 }
6167 }
6168 else
6169 {
6170 caps->DeclTypes = 0;
6171 }
6172
6173 /* Set DirectDraw helper Caps */
6174 ckey_caps = WINEDDCKEYCAPS_DESTBLT |
6176 fx_caps = WINEDDFXCAPS_BLTALPHA |
6188 blit_caps = WINEDDCAPS_BLT |
6197
6198 /* Fill the ddraw caps structure */
6199 caps->ddraw_caps.caps = WINEDDCAPS_GDI |
6201 blit_caps;
6202 caps->ddraw_caps.caps2 = WINEDDCAPS2_CERTIFIED |
6207 caps->ddraw_caps.color_key_caps = ckey_caps;
6208 caps->ddraw_caps.fx_caps = fx_caps;
6209 caps->ddraw_caps.svb_caps = blit_caps;
6210 caps->ddraw_caps.svb_color_key_caps = ckey_caps;
6211 caps->ddraw_caps.svb_fx_caps = fx_caps;
6212 caps->ddraw_caps.vsb_caps = blit_caps;
6213 caps->ddraw_caps.vsb_color_key_caps = ckey_caps;
6214 caps->ddraw_caps.vsb_fx_caps = fx_caps;
6215 caps->ddraw_caps.ssb_caps = blit_caps;
6216 caps->ddraw_caps.ssb_color_key_caps = ckey_caps;
6217 caps->ddraw_caps.ssb_fx_caps = fx_caps;
6218
6219 caps->ddraw_caps.dds_caps = WINEDDSCAPS_ALPHA |
6229
6230 if (!(wined3d->flags & WINED3D_NO3D))
6231 {
6232 caps->ddraw_caps.dds_caps |= WINEDDSCAPS_3DDEVICE |
6236 caps->ddraw_caps.caps |= WINEDDCAPS_3D;
6237 }
6238
6240
6241 return WINED3D_OK;
6242}
DWORD MaxVertexShader30InstructionSlots
Definition: wined3d.h:1968
DWORD DevCaps
Definition: wined3d.h:1895
DWORD MaxVertexShaderConst
Definition: wined3d.h:1946
DWORD MaxPrimitiveCount
Definition: wined3d.h:1940
DWORD MaxTextureAspectRatio
Definition: wined3d.h:1915
DWORD ShadeCaps
Definition: wined3d.h:1902
DWORD PrimitiveMiscCaps
Definition: wined3d.h:1896
struct wined3d_pixel_shader_caps PS20Caps
Definition: wined3d.h:1964
DWORD CursorCaps
Definition: wined3d.h:1894
struct wined3d_ddraw_caps ddraw_caps
Definition: wined3d.h:1973
DWORD MaxStreamStride
Definition: wined3d.h:1943
DWORD MaxVertexBlendMatrixIndex
Definition: wined3d.h:1936
float GuardBandRight
Definition: wined3d.h:1921
DWORD TextureFilterCaps
Definition: wined3d.h:1904
DWORD DeclTypes
Definition: wined3d.h:1960
DWORD VolumeTextureFilterCaps
Definition: wined3d.h:1906
DWORD MaxTextureHeight
Definition: wined3d.h:1912
UINT MasterAdapterOrdinal
Definition: wined3d.h:1957
DWORD MaxAnisotropy
Definition: wined3d.h:1916
float MaxNpatchTessellationLevel
Definition: wined3d.h:1954
UINT AdapterOrdinalInGroup
Definition: wined3d.h:1958
DWORD StretchRectFilterCaps
Definition: wined3d.h:1962
UINT NumberOfAdaptersInGroup
Definition: wined3d.h:1959
DWORD MaxTextureWidth
Definition: wined3d.h:1911
float MaxVertexW
Definition: wined3d.h:1917
DWORD CubeTextureFilterCaps
Definition: wined3d.h:1905
DWORD AlphaCmpCaps
Definition: wined3d.h:1901
DWORD NumSimultaneousRTs
Definition: wined3d.h:1961
float PixelShader1xMaxValue
Definition: wined3d.h:1949
DWORD TextureAddressCaps
Definition: wined3d.h:1907
DWORD MaxVolumeExtent
Definition: wined3d.h:1913
float GuardBandBottom
Definition: wined3d.h:1922
DWORD DevCaps2
Definition: wined3d.h:1952
struct wined3d_vertex_shader_caps VS20Caps
Definition: wined3d.h:1963
DWORD Caps
Definition: wined3d.h:1889
DWORD LineCaps
Definition: wined3d.h:1909
DWORD MaxVShaderInstructionsExecuted
Definition: wined3d.h:1966
DWORD MaxTextureRepeat
Definition: wined3d.h:1914
DWORD PixelShaderVersion
Definition: wined3d.h:1948
DWORD StencilCaps
Definition: wined3d.h:1925
DWORD MaxUserClipPlanes
Definition: wined3d.h:1934
UINT AdapterOrdinal
Definition: wined3d.h:1887
DWORD VertexProcessingCaps
Definition: wined3d.h:1932
float MaxPointSize
Definition: wined3d.h:1938
DWORD VolumeTextureAddressCaps
Definition: wined3d.h:1908
DWORD TextureCaps
Definition: wined3d.h:1903
DWORD MaxTextureBlendStages
Definition: wined3d.h:1929
DWORD DestBlendCaps
Definition: wined3d.h:1900
float ExtentsAdjust
Definition: wined3d.h:1924
float GuardBandLeft
Definition: wined3d.h:1919
DWORD TextureOpCaps
Definition: wined3d.h:1928
DWORD Caps3
Definition: wined3d.h:1891
DWORD MaxStreams
Definition: wined3d.h:1942
DWORD MaxVertexBlendMatrices
Definition: wined3d.h:1935
DWORD ZCmpCaps
Definition: wined3d.h:1898
BOOL shader_double_precision
Definition: wined3d.h:1975
enum wined3d_device_type DeviceType
Definition: wined3d.h:1886
DWORD MaxSimultaneousTextures
Definition: wined3d.h:1930
DWORD VertexTextureFilterCaps
Definition: wined3d.h:1965
DWORD VertexShaderVersion
Definition: wined3d.h:1945
DWORD PresentationIntervals
Definition: wined3d.h:1892
float GuardBandTop
Definition: wined3d.h:1920
DWORD FVFCaps
Definition: wined3d.h:1927
DWORD RasterCaps
Definition: wined3d.h:1897
DWORD SrcBlendCaps
Definition: wined3d.h:1899
DWORD Caps2
Definition: wined3d.h:1890
DWORD MaxVertexIndex
Definition: wined3d.h:1941
DWORD MaxPixelShader30InstructionSlots
Definition: wined3d.h:1969
DWORD MaxActiveLights
Definition: wined3d.h:1933
DWORD MaxPShaderInstructionsExecuted
Definition: wined3d.h:1967
#define WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH
Definition: wined3d.h:1113
#define WINED3DSTENCILCAPS_ZERO
Definition: wined3d.h:1136
#define WINED3DPMISCCAPS_MASKZ
Definition: wined3d.h:1093
#define WINED3DPTEXTURECAPS_MIPCUBEMAP
Definition: wined3d.h:1255
#define WINED3DPMISCCAPS_CULLCW
Definition: wined3d.h:1096
#define WINED3DPSHADECAPS_FOGGOURAUD
Definition: wined3d.h:1237
#define WINED3DPMISCCAPS_POSTBLENDSRGBCONVERT
Definition: wined3d.h:1111
#define WINED3DSTENCILCAPS_KEEP
Definition: wined3d.h:1135
#define WINEDDCAPS_BLTSTRETCH
Definition: wined3d.h:1504
#define WINED3DPRASTERCAPS_ANISOTROPY
Definition: wined3d.h:1207
#define WINED3DPTADDRESSCAPS_WRAP
Definition: wined3d.h:1128
#define WINED3DPRASTERCAPS_FOGVERTEX
Definition: wined3d.h:1197
#define WINEDDSCAPS_PRIMARYSURFACE
Definition: wined3d.h:1424
#define WINED3DPTEXTURECAPS_NONPOW2CONDITIONAL
Definition: wined3d.h:1248
#define WINED3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH
Definition: wined3d.h:1172
#define WINED3DPBLENDCAPS_INVSRCALPHA
Definition: wined3d.h:1074
#define WINED3DPRASTERCAPS_FOGTABLE
Definition: wined3d.h:1198
#define WINEDDCAPS_COLORKEY
Definition: wined3d.h:1517
#define WINED3DPCMPCAPS_LESSEQUAL
Definition: wined3d.h:1087
#define WINED3DPBLENDCAPS_INVDESTCOLOR
Definition: wined3d.h:1078
#define WINED3DDEVCAPS_TEXTURESYSTEMMEMORY
Definition: wined3d.h:1298
#define WINED3DDEVCAPS_TEXTUREVIDEOMEMORY
Definition: wined3d.h:1299
#define WINED3DDEVCAPS_DRAWPRIMITIVES2
Definition: wined3d.h:1303
#define WINED3DPCMPCAPS_NEVER
Definition: wined3d.h:1084
#define WINED3DCAPS2_DYNAMICTEXTURES
Definition: wined3d.h:1187
#define WINED3DPRASTERCAPS_WFOG
Definition: wined3d.h:1210
#define WINED3DDEVCAPS_PUREDEVICE
Definition: wined3d.h:1309
#define WINED3DPSHADECAPS_COLORFLATRGB
Definition: wined3d.h:1219
#define WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING
Definition: wined3d.h:1109
#define WINED3DSTENCILCAPS_DECR
Definition: wined3d.h:1142
#define WINEDDCKEYCAPS_DESTBLT
Definition: wined3d.h:1446
#define WINEDDSCAPS_ZBUFFER
Definition: wined3d.h:1432
#define WINED3DPTFILTERCAPS_LINEARMIPNEAREST
Definition: wined3d.h:1264
#define WINED3DVS20CAPS_PREDICATION
Definition: wined3d.h:1179
#define WINEDDFXCAPS_BLTROTATION90
Definition: wined3d.h:1473
#define WINEDDSCAPS_VIDEOMEMORY
Definition: wined3d.h:1429
#define WINED3DPMISCCAPS_INDEPENDENTWRITEMASKS
Definition: wined3d.h:1104
#define WINED3DPS20_MAX_NUMINSTRUCTIONSLOTS
Definition: wined3d.h:1119
#define WINED3DPS20_MAX_STATICFLOWCONTROLDEPTH
Definition: wined3d.h:1117
#define WINED3DPTFILTERCAPS_MAGFLINEAR
Definition: wined3d.h:1272
#define WINED3DPRESENT_INTERVAL_ONE
Definition: wined3d.h:944
#define WINED3DPTEXTURECAPS_CUBEMAP_POW2
Definition: wined3d.h:1256
#define WINED3DPTADDRESSCAPS_INDEPENDENTUV
Definition: wined3d.h:1132
#define WINED3DPTFILTERCAPS_MIPNEAREST
Definition: wined3d.h:1262
#define WINED3DPTEXTURECAPS_MIPVOLUMEMAP
Definition: wined3d.h:1254
#define WINED3DLINECAPS_BLEND
Definition: wined3d.h:1061
#define WINED3DCAPS2_CANRENDERWINDOWED
Definition: wined3d.h:1183
#define WINED3DPBLENDCAPS_ZERO
Definition: wined3d.h:1069
#define WINED3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD
Definition: wined3d.h:1030
#define WINED3DPTADDRESSCAPS_CLAMP
Definition: wined3d.h:1130
#define WINEDDFXCAPS_BLTSTRETCHX
Definition: wined3d.h:1478
#define WINED3DPBLENDCAPS_SRCALPHASAT
Definition: wined3d.h:1079
#define WINEDDFXCAPS_BLTSHRINKYN
Definition: wined3d.h:1477
#define WINED3DCAPS2_CANGENMIPMAP
Definition: wined3d.h:1188
#define WINED3DDEVCAPS_TLVERTEXSYSTEMMEMORY
Definition: wined3d.h:1296
#define WINED3DCAPS2_FULLSCREENGAMMA
Definition: wined3d.h:1182
#define WINED3DPRASTERCAPS_MIPMAPLODBIAS
Definition: wined3d.h:1203
#define WINED3DPSHADECAPS_ALPHAGOURAUDBLEND
Definition: wined3d.h:1232
#define WINED3DSTENCILCAPS_REPLACE
Definition: wined3d.h:1137
#define WINEDDSCAPS_OFFSCREENPLAIN
Definition: wined3d.h:1421
#define WINED3DSTENCILCAPS_INCRSAT
Definition: wined3d.h:1138
#define WINED3DPTFILTERCAPS_MINFANISOTROPIC
Definition: wined3d.h:1268
#define WINED3DPTEXTURECAPS_VOLUMEMAP
Definition: wined3d.h:1252
#define WINED3DPRASTERCAPS_ZTEST
Definition: wined3d.h:1194
#define WINED3DPTFILTERCAPS_MIPFLINEAR
Definition: wined3d.h:1270
#define WINED3DPTEXTURECAPS_ALPHA
Definition: wined3d.h:1242
#define WINED3DPMISCCAPS_CULLNONE
Definition: wined3d.h:1095
#define WINED3DPS20CAPS_PREDICATION
Definition: wined3d.h:1124
#define WINED3DPTEXTURECAPS_POW2
Definition: wined3d.h:1241
#define WINED3DPMISCCAPS_SEPARATEALPHABLEND
Definition: wined3d.h:1107
#define WINED3DDEVCAPS_DRAWPRIMTLVERTEX
Definition: wined3d.h:1300
#define WINEDDCAPS_3D
Definition: wined3d.h:1495
#define WINED3DPS20_MIN_STATICFLOWCONTROLDEPTH
Definition: wined3d.h:1118
#define WINEDDFXCAPS_BLTSTRETCHYN
Definition: wined3d.h:1481
#define WINEDDCAPS_GDI
Definition: wined3d.h:1505
#define WINED3DLINECAPS_ZTEST
Definition: wined3d.h:1060
#define WINED3DPTEXTURECAPS_BORDER
Definition: wined3d.h:1244
#define WINED3DPMISCCAPS_CULLCCW
Definition: wined3d.h:1097
#define WINED3DDTCAPS_SHORT4N
Definition: wined3d.h:1047
#define WINED3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH
Definition: wined3d.h:1173
#define WINEDDSCAPS_PALETTE
Definition: wined3d.h:1423
#define WINEDDCAPS_BLTDEPTHFILL
Definition: wined3d.h:1523
#define WINEDDCAPS_CANCLIP
Definition: wined3d.h:1524
#define WINED3DLINECAPS_FOG
Definition: wined3d.h:1063
#define WINED3DPSHADECAPS_SPECULARFLATRGB
Definition: wined3d.h:1225
#define WINEDDSCAPS_VISIBLE
Definition: wined3d.h:1430
#define WINED3DPRASTERCAPS_ZFOG
Definition: wined3d.h:1211
#define WINED3DSTENCILCAPS_DECRSAT
Definition: wined3d.h:1139
#define WINED3DDTCAPS_FLOAT16_2
Definition: wined3d.h:1052
#define WINED3DPTADDRESSCAPS_MIRRORONCE
Definition: wined3d.h:1133
#define WINEDDCAPS_COLORKEYHWASSIST
Definition: wined3d.h:1519
#define WINED3DPBLENDCAPS_SRCCOLOR
Definition: wined3d.h:1071
#define WINED3DDEVCAPS_FLOATTLVERTEX
Definition: wined3d.h:1290
#define WINEDDCAPS_BLTCOLORFILL
Definition: wined3d.h:1521
#define WINED3DPRASTERCAPS_SUBPIXEL
Definition: wined3d.h:1195
#define WINED3DDEVCAPS_EXECUTESYSTEMMEMORY
Definition: wined3d.h:1294
#define WINED3DPTEXTURECAPS_TRANSPARENCY
Definition: wined3d.h:1243
#define WINED3DPRASTERCAPS_STIPPLE
Definition: wined3d.h:1199
#define WINED3DPS20CAPS_ARBITRARYSWIZZLE
Definition: wined3d.h:1122
#define WINED3DPCMPCAPS_LESS
Definition: wined3d.h:1085
#define WINED3DPSHADECAPS_SPECULARGOURAUDRGB
Definition: wined3d.h:1227
#define WINED3DPSHADECAPS_COLORGOURAUDRGB
Definition: wined3d.h:1221
#define WINED3DPTFILTERCAPS_LINEARMIPLINEAR
Definition: wined3d.h:1265
#define WINEDDSCAPS_TEXTURE
Definition: wined3d.h:1427
#define WINEDDCAPS2_CERTIFIED
Definition: wined3d.h:1528
#define WINED3DPTEXTURECAPS_MIPMAP
Definition: wined3d.h:1253
#define WINED3DPBLENDCAPS_DESTCOLOR
Definition: wined3d.h:1077
#define WINEDDCAPS2_NOPAGELOCKREQUIRED
Definition: wined3d.h:1539
#define WINED3DDEVCAPS_HWRASTERIZATION
Definition: wined3d.h:1308
#define WINEDDFXCAPS_BLTSHRINKXN
Definition: wined3d.h:1475
#define WINED3DPRASTERCAPS_PAT
Definition: wined3d.h:1193
#define WINEDDFXCAPS_BLTMIRRORUPDOWN
Definition: wined3d.h:1471
#define WINED3DPTADDRESSCAPS_BORDER
Definition: wined3d.h:1131
#define WINEDDFXCAPS_BLTSTRETCHXN
Definition: wined3d.h:1479
#define WINED3DPSHADECAPS_ALPHAFLATBLEND
Definition: wined3d.h:1230
#define WINED3DPBLENDCAPS_ONE
Definition: wined3d.h:1070
#define WINED3DDTCAPS_FLOAT16_4
Definition: wined3d.h:1053
#define WINEDDSCAPS_ALPHA
Definition: wined3d.h:1416
#define WINED3DCAPS3_COPY_TO_VIDMEM
Definition: wined3d.h:1032
#define WINED3DPRASTERCAPS_ZBIAS
Definition: wined3d.h:1204
#define WINED3DPTADDRESSCAPS_MIRROR
Definition: wined3d.h:1129
#define WINED3DPTFILTERCAPS_NEAREST
Definition: wined3d.h:1260
#define WINEDDCAPS_PALETTE
Definition: wined3d.h:1510
#define WINED3DPRASTERCAPS_DEPTHBIAS
Definition: wined3d.h:1215
#define WINEDDCAPS_CANBLTSYSMEM
Definition: wined3d.h:1526
#define WINEDDSCAPS_FLIP
Definition: wined3d.h:1419
#define WINED3DPTFILTERCAPS_MAGFPOINT
Definition: wined3d.h:1271
#define WINEDDCAPS_CANCLIPSTRETCHED
Definition: wined3d.h:1525
#define WINED3DMIN30SHADERINSTRUCTIONS
Definition: wined3d.h:1067
#define WINED3DDEVCAPS_CANRENDERAFTERFLIP
Definition: wined3d.h:1301
#define WINED3DPRASTERCAPS_SLOPESCALEDEPTHBIAS
Definition: wined3d.h:1214
#define WINED3DPTFILTERCAPS_LINEAR
Definition: wined3d.h:1261
#define WINED3DPS20CAPS_GRADIENTINSTRUCTIONS
Definition: wined3d.h:1123
#define WINED3DPRASTERCAPS_DITHER
Definition: wined3d.h:1190
#define WINED3DPTFILTERCAPS_MAGFANISOTROPIC
Definition: wined3d.h:1273
#define WINEDDSCAPS_FRONTBUFFER
Definition: wined3d.h:1420
#define WINED3DPTEXTURECAPS_PERSPECTIVE
Definition: wined3d.h:1240
#define WINED3DCURSORCAPS_COLOR
Definition: wined3d.h:1287
#define WINEDDFXCAPS_BLTSHRINKX
Definition: wined3d.h:1474
#define WINED3DDTCAPS_UBYTE4N
Definition: wined3d.h:1045
#define WINED3DPBLENDCAPS_BOTHINVSRCALPHA
Definition: wined3d.h:1081
#define WINED3DPS20CAPS_NOTEXINSTRUCTIONLIMIT
Definition: wined3d.h:1126
#define WINED3DCURSORCAPS_LOWRES
Definition: wined3d.h:1288
#define WINED3DPMISCCAPS_BLENDOP
Definition: wined3d.h:1102
#define WINED3DPS20_MIN_NUMINSTRUCTIONSLOTS
Definition: wined3d.h:1120
#define WINED3DSTENCILCAPS_INVERT
Definition: wined3d.h:1140
#define WINED3DPTFILTERCAPS_MIPLINEAR
Definition: wined3d.h:1263
#define WINEDDCAPS2_CANRENDERWINDOWED
Definition: wined3d.h:1545
#define WINED3DPMISCCAPS_CLIPPLANESCALEDPOINTS
Definition: wined3d.h:1099
#define WINED3DPTEXTURECAPS_PROJECTED
Definition: wined3d.h:1249
#define WINED3DPCMPCAPS_GREATEREQUAL
Definition: wined3d.h:1090
#define WINED3DDTCAPS_SHORT2N
Definition: wined3d.h:1046
#define WINED3DPTFILTERCAPS_MINFPOINT
Definition: wined3d.h:1266
#define WINED3DPTEXTURECAPS_VOLUMEMAP_POW2
Definition: wined3d.h:1257
#define WINED3DPBLENDCAPS_INVSRCCOLOR
Definition: wined3d.h:1072
#define WINEDDCAPS2_PRIMARYGAMMA
Definition: wined3d.h:1544
#define WINED3DPCMPCAPS_EQUAL
Definition: wined3d.h:1086
#define WINED3DPBLENDCAPS_BLENDFACTOR
Definition: wined3d.h:1082
#define WINED3DPMISCCAPS_COLORWRITEENABLE
Definition: wined3d.h:1098
#define WINEDDFXCAPS_BLTSHRINKY
Definition: wined3d.h:1476
#define WINED3DPCMPCAPS_NOTEQUAL
Definition: wined3d.h:1089
#define WINED3DSTENCILCAPS_INCR
Definition: wined3d.h:1141
#define WINEDDSCAPS_SYSTEMMEMORY
Definition: wined3d.h:1426
#define WINED3DPTEXTURECAPS_CUBEMAP
Definition: wined3d.h:1250
#define WINED3DLINECAPS_TEXTURE
Definition: wined3d.h:1059
#define WINED3DPBLENDCAPS_SRCALPHA
Definition: wined3d.h:1073
#define WINED3DPRESENT_INTERVAL_IMMEDIATE
Definition: wined3d.h:948
#define WINED3DDEVCAPS2_STREAMOFFSET
Definition: wined3d.h:1036
#define WINED3DDEVCAPS_DRAWPRIMITIVES2EX
Definition: wined3d.h:1305
#define WINEDDFXCAPS_BLTSTRETCHY
Definition: wined3d.h:1480
#define WINED3DPBLENDCAPS_DESTALPHA
Definition: wined3d.h:1075
#define WINED3DPRASTERCAPS_SCISSORTEST
Definition: wined3d.h:1213
#define WINED3DPTFILTERCAPS_MIPFPOINT
Definition: wined3d.h:1269
#define WINED3DCAPS3_COPY_TO_SYSTEMMEM
Definition: wined3d.h:1033
#define WINED3DPS20CAPS_NODEPENDENTREADLIMIT
Definition: wined3d.h:1125
#define WINED3DPCMPCAPS_GREATER
Definition: wined3d.h:1088
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:87
@ WINED3D_DEVICE_TYPE_REF
Definition: wined3d.h:88
#define WINEDDCKEYCAPS_SRCBLT
Definition: wined3d.h:1455
#define WINEDDFXCAPS_BLTALPHA
Definition: wined3d.h:1466
#define WINED3DPBLENDCAPS_INVDESTALPHA
Definition: wined3d.h:1076
#define WINEDDCAPS2_WIDESURFACES
Definition: wined3d.h:1540
#define WINED3DPTFILTERCAPS_MINFLINEAR
Definition: wined3d.h:1267
#define WINEDDSCAPS_3DDEVICE
Definition: wined3d.h:1428
#define WINED3DPTEXTURECAPS_ALPHAPALETTE
Definition: wined3d.h:1247
#define WINED3DPBLENDCAPS_BOTHSRCALPHA
Definition: wined3d.h:1080
#define WINEDDSCAPS_MIPMAP
Definition: wined3d.h:1437
#define WINEDDSCAPS_BACKBUFFER
Definition: wined3d.h:1417
#define WINEDDCAPS_BLT
Definition: wined3d.h:1501
#define WINED3DDEVCAPS_EXECUTEVIDEOMEMORY
Definition: wined3d.h:1295
#define WINEDDFXCAPS_BLTMIRRORLEFTRIGHT
Definition: wined3d.h:1470
#define WINED3DPMISCCAPS_CLIPTLVERTS
Definition: wined3d.h:1100
#define WINED3DDTCAPS_UBYTE4
Definition: wined3d.h:1044
#define WINED3DVS20_MAX_STATICFLOWCONTROLDEPTH
Definition: wined3d.h:1176
#define WINED3DDEVCAPS_TLVERTEXVIDEOMEMORY
Definition: wined3d.h:1297
#define WINED3DDEVCAPS_HWTRANSFORMANDLIGHT
Definition: wined3d.h:1306
#define WINED3DLINECAPS_ALPHACMP
Definition: wined3d.h:1062
#define WINED3DPSHADECAPS_FOGFLAT
Definition: wined3d.h:1236
#define WINED3DPCMPCAPS_ALWAYS
Definition: wined3d.h:1091
#define WINED3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET
Definition: wined3d.h:1042
#define WINED3DSTENCILCAPS_TWOSIDED
Definition: wined3d.h:1143
@ EXT_STENCIL_TWO_SIDE
Definition: wined3d_gl.h:169
@ ATI_SEPARATE_STENCIL
Definition: wined3d_gl.h:145
#define MAX_STREAMS

Referenced by d3d8_GetDeviceCaps(), d3d9_GetDeviceCaps(), ddraw_get_d3dcaps(), ddraw_init(), device_init(), and wined3d_device_get_device_caps().

◆ wined3d_get_output_desc()

HRESULT CDECL wined3d_get_output_desc ( const struct wined3d wined3d,
unsigned int  adapter_idx,
struct wined3d_output_desc desc 
)

Definition at line 4499 of file directx.c.

4501{
4502 enum wined3d_display_rotation rotation;
4503 const struct wined3d_adapter *adapter;
4505 HMONITOR monitor;
4506 HRESULT hr;
4507
4508 TRACE("wined3d %p, adapter_idx %u, desc %p.\n", wined3d, adapter_idx, desc);
4509
4510 if (adapter_idx >= wined3d->adapter_count)
4512
4513 adapter = &wined3d->adapters[adapter_idx];
4514 if (!(monitor = MonitorFromPoint(adapter->monitor_position, MONITOR_DEFAULTTOPRIMARY)))
4516
4517 if (FAILED(hr = wined3d_get_adapter_display_mode(wined3d, adapter_idx, &mode, &rotation)))
4518 return hr;
4519
4520 memcpy(desc->device_name, adapter->DeviceName, sizeof(desc->device_name));
4521 SetRect(&desc->desktop_rect, 0, 0, mode.width, mode.height);
4522 OffsetRect(&desc->desktop_rect, adapter->monitor_position.x, adapter->monitor_position.y);
4523 /* FIXME: We should get this from EnumDisplayDevices() when the adapters
4524 * are created. */
4525 desc->attached_to_desktop = TRUE;
4526 desc->rotation = rotation;
4527 desc->monitor = monitor;
4528
4529 return WINED3D_OK;
4530}
static const WCHAR desc[]
Definition: protectdata.c:36
HMONITOR WINAPI MonitorFromPoint(POINT, DWORD)
wined3d_display_rotation
Definition: wined3d.h:838
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

Referenced by d3d8_GetAdapterMonitor(), d3d9_GetAdapterMonitor(), and ddraw_enumerate_secondary_devices().

◆ wined3d_guess_card()

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

Definition at line 2519 of file directx.c.

2521{
2522 /* A Direct3D device object contains the PCI id (vendor + device) of the
2523 * videocard which is used for rendering. Various applications use this
2524 * information to get a rough estimation of the features of the card and
2525 * some might use it for enabling 3d effects only on certain types of
2526 * videocards. In some cases games might even use it to work around bugs
2527 * which happen on certain videocards/driver combinations. The problem is
2528 * that OpenGL only exposes a rendering string containing the name of the
2529 * videocard and not the PCI id.
2530 *
2531 * Various games depend on the PCI id, so somehow we need to provide one.
2532 * A simple option is to parse the renderer string and translate this to
2533 * the right PCI id. This is a lot of work because there are more than 200
2534 * GPUs just for Nvidia. Various cards share the same renderer string, so
2535 * the amount of code might be 'small' but there are quite a number of
2536 * exceptions which would make this a pain to maintain. Another way would
2537 * be to query the PCI id from the operating system (assuming this is the
2538 * videocard which is used for rendering which is not always the case).
2539 * This would work but it is not very portable. Second it would not work
2540 * well in, let's say, a remote X situation in which the amount of 3d
2541 * features which can be used is limited.
2542 *
2543 * As said most games only use the PCI id to get an indication of the
2544 * capabilities of the card. It doesn't really matter if the given id is
2545 * the correct one if we return the id of a card with similar 3d features.
2546 *
2547 * The code below checks the OpenGL capabilities of a videocard and matches
2548 * that to a certain level of Direct3D functionality. Once a card passes
2549 * the Direct3D9 check, we know that the card (in case of Nvidia) is at
2550 * least a GeforceFX. To give a better estimate we do a basic check on the
2551 * renderer string but if that won't pass we return a default card. This
2552 * way is better than maintaining a full card database as even without a
2553 * full database we can return a card with similar features. Second the
2554 * size of the database can be made quite small because when you know what
2555 * type of 3d functionality a card has, you know to which GPU family the
2556 * GPU must belong. Because of this you only have to check a small part of
2557 * the renderer string to distinguish between different models from that
2558 * family.
2559 *
2560 * The code also selects a default amount of video memory which we will
2561 * use for an estimation of the amount of free texture memory. In case of
2562 * real D3D the amount of texture memory includes video memory and system
2563 * memory (to be specific AGP memory or in case of PCIE TurboCache /
2564 * HyperMemory). We don't know how much system memory can be addressed by
2565 * the system but we can make a reasonable estimation about the amount of
2566 * video memory. If the value is slightly wrong it doesn't matter as we
2567 * didn't include AGP-like memory which makes the amount of addressable
2568 * memory higher and second OpenGL isn't that critical it moves to system
2569 * memory behind our backs if really needed. Note that the amount of video
2570 * memory can be overruled using a registry setting. */
2571
2572 unsigned int i;
2573 enum wined3d_d3d_level d3d_level = d3d_level_from_caps(shader_caps, fragment_caps, glsl_version);
2575
2576 for (i = 0; i < ARRAY_SIZE(card_vendor_table); ++i)
2577 {
2579 continue;
2580
2581 TRACE("Applying card selector \"%s\".\n", card_vendor_table[i].description);
2583 card_vendor_table[i].gl_vendor_count, *gl_vendor, gl_renderer);
2584 if (device != PCI_DEVICE_NONE)
2585 return device;
2586
2587 TRACE("Unrecognized renderer %s, falling back to default.\n", debugstr_a(gl_renderer));
2588 return card_vendor_table[i].card_fallback[d3d_level];
2589 }
2590
2591 FIXME("No card selector available for card vendor %04x (using GL_RENDERER %s).\n",
2592 *card_vendor, debugstr_a(gl_renderer));
2593
2594 /* Default to generic Nvidia hardware based on the supported OpenGL extensions. */
2596 return card_fallback_nvidia[d3d_level];
2597}
static enum wined3d_pci_device card_fallback_nvidia[]
Definition: directx.c:2432
static const struct @273 card_vendor_table[]
wined3d_d3d_level
Definition: directx.c:81
static enum wined3d_d3d_level d3d_level_from_caps(const struct shader_caps *shader_caps, const struct fragment_caps *fragment_caps, DWORD glsl_version)
Definition: directx.c:1869
unsigned int gl_vendor_count
Definition: directx.c:2499
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)
Definition: directx.c:2469

Referenced by wined3d_adapter_init_gl_caps().

◆ wined3d_guess_card_vendor()

static enum wined3d_pci_vendor wined3d_guess_card_vendor ( const char gl_vendor_string,
const char gl_renderer 
)
static

Definition at line 1828 of file directx.c.

1829{
1830 if (strstr(gl_vendor_string, "NVIDIA")
1831 || strstr(gl_vendor_string, "Nouveau")
1832 || strstr(gl_vendor_string, "nouveau"))
1833 return HW_VENDOR_NVIDIA;
1834
1835 if (strstr(gl_vendor_string, "ATI")
1836 || strstr(gl_vendor_string, "Advanced Micro Devices, Inc.")
1837 || strstr(gl_vendor_string, "X.Org R300 Project")
1838 || strstr(gl_renderer, "AMD")
1839 || strstr(gl_renderer, "FirePro")
1840 || strstr(gl_renderer, "Radeon")
1841 || strstr(gl_renderer, "R100")
1842 || strstr(gl_renderer, "R200")
1843 || strstr(gl_renderer, "R300")
1844 || strstr(gl_renderer, "R600")
1845 || strstr(gl_renderer, "R700"))
1846 return HW_VENDOR_AMD;
1847
1848 if (strstr(gl_vendor_string, "Intel(R)")
1849 /* Intel switched from Intel(R) to Intel® recently, so just match Intel. */
1850 || strstr(gl_renderer, "Intel")
1851 || strstr(gl_renderer, "i915")
1852 || strstr(gl_vendor_string, "Intel Inc."))
1853 return HW_VENDOR_INTEL;
1854
1855 if (strstr(gl_renderer, "SVGA3D"))
1856 return HW_VENDOR_VMWARE;
1857
1858 if (strstr(gl_vendor_string, "Mesa")
1859 || strstr(gl_vendor_string, "Brian Paul")
1860 || strstr(gl_vendor_string, "Tungsten Graphics, Inc")
1861 || strstr(gl_vendor_string, "VMware, Inc."))
1862 return HW_VENDOR_SOFTWARE;
1863
1864 FIXME("Received unrecognized GL_VENDOR %s. Returning HW_VENDOR_NVIDIA.\n", debugstr_a(gl_vendor_string));
1865
1866 return HW_VENDOR_NVIDIA;
1867}
#define HW_VENDOR_VMWARE
Definition: builtin.c:4466
@ HW_VENDOR_SOFTWARE

Referenced by get_max_gl_version(), and wined3d_adapter_init_gl_caps().

◆ wined3d_guess_gl_vendor()

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

Definition at line 1785 of file directx.c.

1787{
1788 /* MacOS has various specialities in the extensions it advertises. Some have to be loaded from
1789 * the opengl 1.2+ core, while other extensions are advertised, but software emulated. So try to
1790 * detect the Apple OpenGL implementation to apply some extension fixups afterwards.
1791 *
1792 * Detecting this isn't really easy. The vendor string doesn't mention Apple. Compile-time checks
1793 * aren't sufficient either because a Linux binary may display on a macos X server via remote X11.
1794 * So try to detect the GL implementation by looking at certain Apple extensions. Some extensions
1795 * like client storage might be supported on other implementations too, but GL_APPLE_flush_render
1796 * is specific to the Mac OS X window management, and GL_APPLE_ycbcr_422 is QuickTime specific. So
1797 * the chance that other implementations support them is rather small since Win32 QuickTime uses
1798 * DirectDraw, not OpenGL. */
1799 if (gl_info->supported[APPLE_FENCE] && gl_info->supported[APPLE_YCBCR_422])
1800 return GL_VENDOR_APPLE;
1801
1802 if (strstr(gl_vendor_string, "NVIDIA"))
1803 return GL_VENDOR_NVIDIA;
1804
1805 if (strstr(gl_vendor_string, "ATI"))
1806 return GL_VENDOR_FGLRX;
1807
1808 if (strstr(gl_vendor_string, "Mesa")
1809 || strstr(gl_vendor_string, "Brian Paul")
1810 || strstr(gl_vendor_string, "X.Org")
1811 || strstr(gl_vendor_string, "Advanced Micro Devices, Inc.")
1812 || strstr(gl_vendor_string, "DRI R300 Project")
1813 || strstr(gl_vendor_string, "Tungsten Graphics, Inc")
1814 || strstr(gl_vendor_string, "VMware, Inc.")
1815 || strstr(gl_vendor_string, "Intel")
1816 || strstr(gl_renderer, "Mesa")
1817 || strstr(gl_renderer, "Gallium")
1818 || strstr(gl_renderer, "Intel")
1819 || strstr(gl_version, "Mesa"))
1820 return GL_VENDOR_MESA;
1821
1822 FIXME("Received unrecognized GL_VENDOR %s. Returning GL_VENDOR_UNKNOWN.\n",
1823 debugstr_a(gl_vendor_string));
1824
1825 return GL_VENDOR_UNKNOWN;
1826}

Referenced by wined3d_adapter_init_gl_caps().

◆ wined3d_incref()

ULONG CDECL wined3d_incref ( struct wined3d wined3d)

Definition at line 456 of file directx.c.

457{
459
460 TRACE("%p increasing refcount to %u.\n", wined3d, refcount);
461
462 return refcount;
463}
#define InterlockedIncrement
Definition: armddk.h:53

Referenced by device_init().

◆ wined3d_init()

HRESULT wined3d_init ( struct wined3d wined3d,
DWORD  flags 
)

Definition at line 6820 of file directx.c.

6821{
6822 BOOL ret;
6823
6824 wined3d->ref = 1;
6825 wined3d->flags = flags;
6826
6827 TRACE("Initializing adapters.\n");
6828
6829 if (flags & WINED3D_NO3D)
6831 else
6833 if (!ret)
6834 {
6835 WARN("Failed to initialize adapter.\n");
6836 return E_FAIL;
6837 }
6839
6840 return WINED3D_OK;
6841}
static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal, DWORD wined3d_creation_flags)
Definition: directx.c:6646
static BOOL wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordinal)
Definition: directx.c:6784

Referenced by wined3d_create().

◆ wined3d_null_wined3d_object_destroyed()

static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed ( void parent)
static

Definition at line 6813 of file directx.c.

6813{}

◆ wined3d_parse_gl_version()

static DWORD wined3d_parse_gl_version ( const char gl_version)
static

Definition at line 1765 of file directx.c.

1766{
1767 const char *ptr = gl_version;
1768 int major, minor;
1769
1770 major = atoi(ptr);
1771 if (major <= 0)
1772 ERR("Invalid OpenGL major version %d.\n", major);
1773
1774 while (isdigit(*ptr)) ++ptr;
1775 if (*ptr++ != '.')
1776 ERR("Invalid OpenGL version string %s.\n", debugstr_a(gl_version));
1777
1778 minor = atoi(ptr);
1779
1780 TRACE("Found OpenGL version %d.%d.\n", major, minor);
1781
1782 return MAKEDWORD_VERSION(major, minor);
1783}
#define isdigit(c)
Definition: acclib.h:68
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
static PVOID ptr
Definition: dispmode.c:27

Referenced by wined3d_adapter_init_gl_caps().

◆ wined3d_register_software_device()

HRESULT CDECL wined3d_register_software_device ( struct wined3d wined3d,
void init_function 
)

Definition at line 4492 of file directx.c.

4493{
4494 FIXME("wined3d %p, init_function %p stub!\n", wined3d, init_function);
4495
4496 return WINED3D_OK;
4497}

Referenced by d3d8_RegisterSoftwareDevice(), and d3d9_RegisterSoftwareDevice().

◆ wined3d_set_adapter_display_mode()

HRESULT CDECL wined3d_set_adapter_display_mode ( struct wined3d wined3d,
UINT  adapter_idx,
const struct wined3d_display_mode mode 
)

Definition at line 4840 of file directx.c.

4842{
4843 struct wined3d_adapter *adapter;
4844 DEVMODEW new_mode, current_mode;
4845 RECT clip_rc;
4846 LONG ret;
4847 enum wined3d_format_id new_format_id;
4848
4849 TRACE("wined3d %p, adapter_idx %u, mode %p.\n", wined3d, adapter_idx, mode);
4850
4851 if (adapter_idx >= wined3d->adapter_count)
4853 adapter = &wined3d->adapters[adapter_idx];
4854
4855 memset(&new_mode, 0, sizeof(new_mode));
4856 new_mode.dmSize = sizeof(new_mode);
4857 memset(&current_mode, 0, sizeof(current_mode));
4858 current_mode.dmSize = sizeof(current_mode);
4859 if (mode)
4860 {
4861 const struct wined3d_format *format;
4862
4863 TRACE("mode %ux%u@%u %s %#x.\n", mode->width, mode->height, mode->refresh_rate,
4864 debug_d3dformat(mode->format_id), mode->scanline_ordering);
4865
4867
4869 new_mode.dmBitsPerPel = format->byte_count * CHAR_BIT;
4870 new_mode.dmPelsWidth = mode->width;
4871 new_mode.dmPelsHeight = mode->height;
4872
4873 new_mode.dmDisplayFrequency = mode->refresh_rate;
4874 if (mode->refresh_rate)
4875 new_mode.dmFields |= DM_DISPLAYFREQUENCY;
4876
4877 if (mode->scanline_ordering != WINED3D_SCANLINE_ORDERING_UNKNOWN)
4878 {
4879 new_mode.dmFields |= DM_DISPLAYFLAGS;
4880 if (mode->scanline_ordering == WINED3D_SCANLINE_ORDERING_INTERLACED)
4881 new_mode.u2.dmDisplayFlags |= DM_INTERLACED;
4882 }
4883 new_format_id = mode->format_id;
4884 }
4885 else
4886 {
4887 if (!EnumDisplaySettingsW(adapter->DeviceName, ENUM_REGISTRY_SETTINGS, &new_mode))
4888 {
4889 ERR("Failed to read mode from registry.\n");
4891 }
4892 new_format_id = pixelformat_for_depth(new_mode.dmBitsPerPel);
4893 }
4894
4895 /* Only change the mode if necessary. */
4896 if (!EnumDisplaySettingsW(adapter->DeviceName, ENUM_CURRENT_SETTINGS, &current_mode))
4897 {
4898 ERR("Failed to get current display mode.\n");
4899 }
4900 else if (current_mode.dmPelsWidth == new_mode.dmPelsWidth
4901 && current_mode.dmPelsHeight == new_mode.dmPelsHeight
4902 && current_mode.dmBitsPerPel == new_mode.dmBitsPerPel
4903 && (current_mode.dmDisplayFrequency == new_mode.dmDisplayFrequency
4904 || !(new_mode.dmFields & DM_DISPLAYFREQUENCY))
4905 && (current_mode.u2.dmDisplayFlags == new_mode.u2.dmDisplayFlags
4906 || !(new_mode.dmFields & DM_DISPLAYFLAGS)))
4907 {
4908 TRACE("Skipping redundant mode setting call.\n");
4909 adapter->screen_format = new_format_id;
4910 return WINED3D_OK;
4911 }
4912
4913 ret = ChangeDisplaySettingsExW(adapter->DeviceName, &new_mode, NULL, CDS_FULLSCREEN, NULL);
4915 {
4916 if (new_mode.dmFields & DM_DISPLAYFREQUENCY)
4917 {
4918 WARN("ChangeDisplaySettingsExW failed, trying without the refresh rate.\n");
4919 new_mode.dmFields &= ~DM_DISPLAYFREQUENCY;
4920 new_mode.dmDisplayFrequency = 0;
4921 ret = ChangeDisplaySettingsExW(adapter->DeviceName, &new_mode, NULL, CDS_FULLSCREEN, NULL);
4922 }
4925 }
4926
4927 /* Store the new values. */
4928 adapter->screen_format = new_format_id;
4929
4930 /* And finally clip mouse to our screen. */
4931 SetRect(&clip_rc, 0, 0, new_mode.dmPelsWidth, new_mode.dmPelsHeight);
4932 ClipCursor(&clip_rc);
4933
4934 return WINED3D_OK;
4935}
long LONG
Definition: pedump.c:60
DWORD dmBitsPerPel
Definition: wingdi.h:1647
DWORD dmFields
Definition: wingdi.h:1622
DWORD dmPelsWidth
Definition: wingdi.h:1648
DWORD dmDisplayFlags
Definition: wingdi.h:1651
DWORD dmPelsHeight
Definition: wingdi.h:1649
DWORD dmDisplayFrequency
Definition: wingdi.h:1654
WORD dmSize
Definition: wingdi.h:1620
LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR lpszDeviceName, LPDEVMODEW lpDevMode, HWND hwnd, DWORD dwflags, LPVOID lParam)
Definition: display.c:585
BOOL WINAPI EnumDisplaySettingsW(LPCWSTR lpszDeviceName, DWORD iModeNum, LPDEVMODEW lpDevMode)
Definition: display.c:408
wined3d_format_id
Definition: wined3d.h:106
#define DM_PELSWIDTH
Definition: wingdi.h:1269
#define DM_BITSPERPEL
Definition: wingdi.h:1268
#define DM_PELSHEIGHT
Definition: wingdi.h:1270
BOOL WINAPI ClipCursor(_In_opt_ LPCRECT)
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define CDS_FULLSCREEN
Definition: winuser.h:183
#define ENUM_REGISTRY_SETTINGS
Definition: winuser.h:180

Referenced by ddraw7_RestoreDisplayMode(), ddraw7_SetDisplayMode(), swapchain_cleanup(), swapchain_init(), wined3d_swapchain_activate(), and wined3d_swapchain_set_display_mode().

Variable Documentation

◆ amd_gl_vendor_table

const struct gl_vendor_selection amd_gl_vendor_table[]
static
Initial value:
=
{
{GL_VENDOR_APPLE, "Apple OSX AMD/ATI binary driver", cards_amd_binary, ARRAY_SIZE(cards_amd_binary)},
}
static const struct wined3d_renderer_table cards_amd_binary[]
static const struct wined3d_renderer_table cards_amd_mesa[]

◆ card_fallback

enum wined3d_pci_device* card_fallback

Definition at line 2500 of file directx.c.

◆ card_fallback_amd

◆ card_fallback_intel

enum wined3d_pci_device card_fallback_intel[]
static
Initial value:

Definition at line 2454 of file directx.c.

◆ card_fallback_nvidia

enum wined3d_pci_device card_fallback_nvidia[]
static

◆ card_vendor

◆ 

const struct { ... } card_vendor_table[]
Initial value:
=
{
}
static const struct gl_vendor_selection vmware_gl_vendor_table[]
static const struct gl_vendor_selection intel_gl_vendor_table[]
static const struct gl_vendor_selection nvidia_gl_vendor_table[]
static enum wined3d_pci_device card_fallback_amd[]
Definition: directx.c:2443
static enum wined3d_pci_device card_fallback_intel[]
Definition: directx.c:2454
static const struct gl_vendor_selection amd_gl_vendor_table[]

Referenced by wined3d_guess_card().

◆ cards_amd_binary

const struct wined3d_renderer_table cards_amd_binary[]
static

◆ cards_amd_mesa

const struct wined3d_renderer_table cards_amd_mesa[]
static

◆ cards_intel

const struct wined3d_renderer_table cards_intel[]
static

◆ cards_nvidia_binary

const struct wined3d_renderer_table cards_nvidia_binary[]
static

◆ cards_nvidia_mesa

const struct wined3d_renderer_table cards_nvidia_mesa[]
static

◆ cards_vmware

const struct wined3d_renderer_table cards_vmware[]
static
Initial value:
=
{
{"SVGA3D", CARD_VMWARE_SVGA3D},
}
@ CARD_VMWARE_SVGA3D

◆ description

const char* description

Definition at line 2497 of file directx.c.

Referenced by ABCWidths_helper(), add_id3_picture(), add_id3_text(), add_purpose_dlg_proc(), AddDisplayDevice(), cert_properties_general_dlg_proc(), CreateEnhMetaFileA(), CreateEnhMetaFileW(), debugclient_GetRunningProcessDescription(), debugclient_GetRunningProcessDescriptionWide(), debugcontrol_GetLastEventInformation(), DECLARE_INTERFACE_(), enum_callback(), EnumScript_create(), Err_Raise(), ESocket::ESocket(), ESocketClose::ESocketClose(), ESocketDll::ESocketDll(), ESocketOpen::ESocketOpen(), ESocketReceive::ESocketReceive(), ESocketSend::ESocketSend(), ESocketWinsock::ESocketWinsock(), fixup_extensions(), fnIMultiLanguage3_GetCodePageDescription(), GdipConvertToEmfPlus(), GdipConvertToEmfPlusToFile(), CTipbarAccessible::get_accDescription(), headerinfo_AddCodecInfo(), headerinfo_GetCodecInfo(), ITERATE_CreateShortcuts(), Metafile::Metafile(), OLEFontImpl_Clone(), OLEFontImpl_get_Bold(), OLEFontImpl_get_Charset(), OLEFontImpl_get_Italic(), OLEFontImpl_get_Name(), OLEFontImpl_get_Strikethrough(), OLEFontImpl_get_Underline(), OLEFontImpl_get_Weight(), OLEFontImpl_GetSizeMax(), OLEFontImpl_Load(), OLEFontImpl_put_Bold(), OLEFontImpl_put_Charset(), OLEFontImpl_put_Italic(), OLEFontImpl_put_Size(), OLEFontImpl_put_Strikethrough(), OLEFontImpl_put_Underline(), OLEFontImpl_put_Weight(), OLEFontImpl_Save(), parse_script_with_error(), parse_script_with_error_a(), PrintTestResults(), process_comment(), process_extra(), process_picture(), profile3_GetDescription(), profile3_SetDescription(), register_clsid(), RunTests(), select_card_handler(), tally_test_file(), test_clear(), test_clipping(), test_containers(), test_converttoemfplus(), test_drawimage(), test_drawpath(), test_emfonly(), test_empty(), test_fillpath(), test_fillrect(), test_flags_NtQueryDirectoryFile(), test_frameunit(), test_gditransform(), test_getdc(), test_IActiveScriptError(), test_nullframerect(), test_pagetransform(), test_properties(), test_queryconfig2(), test_worldtransform(), FxDmaEnabler::UsesDmaV3(), wined3d_get_adapter_identifier(), and wined3d_guess_card().

◆ driver_version_table

const struct driver_version_information driver_version_table[]
static

Definition at line 1222 of file directx.c.

Referenced by get_driver_version_info().

◆ gl_extension_map

const struct wined3d_extension_map gl_extension_map[]
static

Definition at line 103 of file directx.c.

Referenced by wined3d_adapter_init_gl_caps().

◆ gl_vendor_count

unsigned int gl_vendor_count

Definition at line 2499 of file directx.c.

Referenced by wined3d_guess_card().

◆ gl_vendor_selection

◆ gpu_description_table

const struct gpu_description gpu_description_table[]
static

Definition at line 1279 of file directx.c.

Referenced by get_gpu_description().

◆ IID_D3DDEVICE_D3DUID

const GUID IID_D3DDEVICE_D3DUID = { 0xaeb2cdd4, 0x6e41, 0x43ea, { 0x94,0x1c,0x83,0x61,0xcc,0x76,0x07,0x81 } }
static

Definition at line 94 of file directx.c.

Referenced by wined3d_get_adapter_identifier().

◆ intel_gl_vendor_table

const struct gl_vendor_selection intel_gl_vendor_table[]
static
Initial value:
=
{
{GL_VENDOR_APPLE, "Apple OSX Intel binary driver", cards_intel, ARRAY_SIZE(cards_intel)},
{GL_VENDOR_MESA, "Mesa Intel driver", cards_intel, ARRAY_SIZE(cards_intel)},
}
static const struct wined3d_renderer_table cards_intel[]

◆ magLookup

const GLenum magLookup
Initial value:

Definition at line 299 of file directx.c.

Referenced by wined3d_gl_mag_filter().

◆ minMipLookup

const struct min_lookup minMipLookup
Initial value:
=
{
}
#define GL_NEAREST_MIPMAP_NEAREST
Definition: gl.h:667
#define GL_NEAREST_MIPMAP_LINEAR
Definition: gl.h:668
#define GL_LINEAR_MIPMAP_LINEAR
Definition: gl.h:670
#define GL_LINEAR_MIPMAP_NEAREST
Definition: gl.h:669

Definition at line 291 of file directx.c.

Referenced by wined3d_gl_min_mip_filter().

◆ nvidia_gl_vendor_table

const struct gl_vendor_selection nvidia_gl_vendor_table[]
static
Initial value:
=
{
{GL_VENDOR_APPLE, "Apple OSX NVidia binary driver", cards_nvidia_binary, ARRAY_SIZE(cards_nvidia_binary)},
}
static const struct wined3d_renderer_table cards_nvidia_binary[]
static const struct wined3d_renderer_table cards_nvidia_mesa[]

◆ quirk_table

const struct driver_quirk quirk_table[]
static

Definition at line 1094 of file directx.c.

Referenced by fixup_extensions().

◆ vmware_gl_vendor_table

const struct gl_vendor_selection vmware_gl_vendor_table[]
static
Initial value:
=
{
}
static const struct wined3d_renderer_table cards_vmware[]

◆ wgl_extension_map

const struct wined3d_extension_map wgl_extension_map[]
static
Initial value:
=
{
{"WGL_ARB_pixel_format", WGL_ARB_PIXEL_FORMAT },
{"WGL_EXT_swap_control", WGL_EXT_SWAP_CONTROL },
{"WGL_WINE_pixel_format_passthrough", WGL_WINE_PIXEL_FORMAT_PASSTHROUGH},
{"WGL_WINE_query_renderer", WGL_WINE_QUERY_RENDERER },
}
@ WGL_EXT_SWAP_CONTROL
Definition: wined3d_gl.h:208
@ WGL_WINE_PIXEL_FORMAT_PASSTHROUGH
Definition: wined3d_gl.h:209

Definition at line 279 of file directx.c.

Referenced by wined3d_adapter_init_gl_caps().

◆ wined3d_null_parent_ops

const struct wined3d_parent_ops wined3d_null_parent_ops