winhttp: Implement WINHTTP_OPTION_CONNECTION_INFO.
[wine] / include / wine / wined3d.h
index 7b9b1ed..378a46b 100644 (file)
@@ -245,6 +245,7 @@ enum wined3d_format_id
     WINED3DFMT_NVHU                         = WINEMAKEFOURCC('N','V','H','U'),
     WINED3DFMT_NVHS                         = WINEMAKEFOURCC('N','V','H','S'),
     WINED3DFMT_INTZ                         = WINEMAKEFOURCC('I','N','T','Z'),
+    WINED3DFMT_RESZ                         = WINEMAKEFOURCC('R','E','S','Z'),
     WINED3DFMT_NULL                         = WINEMAKEFOURCC('N','U','L','L'),
     WINED3DFMT_R16                          = WINEMAKEFOURCC(' ','R','1','6'),
     WINED3DFMT_AL16                         = WINEMAKEFOURCC('A','L','1','6'),
@@ -582,187 +583,171 @@ enum wined3d_texture_transform_flags
     WINED3D_TTFF_PROJECTED                  = 256,
 };
 
-typedef enum _WINED3DTEXTUREOP
-{
-    WINED3DTOP_DISABLE                      = 1,
-    WINED3DTOP_SELECTARG1                   = 2,
-    WINED3DTOP_SELECTARG2                   = 3,
-    WINED3DTOP_MODULATE                     = 4,
-    WINED3DTOP_MODULATE2X                   = 5,
-    WINED3DTOP_MODULATE4X                   = 6,
-    WINED3DTOP_ADD                          = 7,
-    WINED3DTOP_ADDSIGNED                    = 8,
-    WINED3DTOP_ADDSIGNED2X                  = 9,
-    WINED3DTOP_SUBTRACT                     = 10,
-    WINED3DTOP_ADDSMOOTH                    = 11,
-    WINED3DTOP_BLENDDIFFUSEALPHA            = 12,
-    WINED3DTOP_BLENDTEXTUREALPHA            = 13,
-    WINED3DTOP_BLENDFACTORALPHA             = 14,
-    WINED3DTOP_BLENDTEXTUREALPHAPM          = 15,
-    WINED3DTOP_BLENDCURRENTALPHA            = 16,
-    WINED3DTOP_PREMODULATE                  = 17,
-    WINED3DTOP_MODULATEALPHA_ADDCOLOR       = 18,
-    WINED3DTOP_MODULATECOLOR_ADDALPHA       = 19,
-    WINED3DTOP_MODULATEINVALPHA_ADDCOLOR    = 20,
-    WINED3DTOP_MODULATEINVCOLOR_ADDALPHA    = 21,
-    WINED3DTOP_BUMPENVMAP                   = 22,
-    WINED3DTOP_BUMPENVMAPLUMINANCE          = 23,
-    WINED3DTOP_DOTPRODUCT3                  = 24,
-    WINED3DTOP_MULTIPLYADD                  = 25,
-    WINED3DTOP_LERP                         = 26,
-    WINED3DTOP_FORCE_DWORD                  = 0x7fffffff,
-} WINED3DTEXTUREOP;
-
-typedef enum _WINED3DTEXTUREADDRESS
-{
-    WINED3DTADDRESS_WRAP                    = 1,
-    WINED3DTADDRESS_MIRROR                  = 2,
-    WINED3DTADDRESS_CLAMP                   = 3,
-    WINED3DTADDRESS_BORDER                  = 4,
-    WINED3DTADDRESS_MIRRORONCE              = 5,
-    WINED3DTADDRESS_FORCE_DWORD             = 0x7fffffff
-} WINED3DTEXTUREADDRESS;
-
-typedef enum _WINED3DTRANSFORMSTATETYPE
-{
-    WINED3DTS_VIEW                          = 2,
-    WINED3DTS_PROJECTION                    = 3,
-    WINED3DTS_TEXTURE0                      = 16,
-    WINED3DTS_TEXTURE1                      = 17,
-    WINED3DTS_TEXTURE2                      = 18,
-    WINED3DTS_TEXTURE3                      = 19,
-    WINED3DTS_TEXTURE4                      = 20,
-    WINED3DTS_TEXTURE5                      = 21,
-    WINED3DTS_TEXTURE6                      = 22,
-    WINED3DTS_TEXTURE7                      = 23,
-    WINED3DTS_WORLD                         = 256, /*WINED3DTS_WORLDMATRIX(0)*/
-    WINED3DTS_WORLD1                        = 257,
-    WINED3DTS_WORLD2                        = 258,
-    WINED3DTS_WORLD3                        = 259,
-    WINED3DTS_FORCE_DWORD                   = 0x7fffffff
-} WINED3DTRANSFORMSTATETYPE;
-
-#define WINED3DTS_WORLDMATRIX(index)                            (WINED3DTRANSFORMSTATETYPE)(index + 256)
-
-typedef enum _WINED3DBASISTYPE
-{
-    WINED3DBASIS_BEZIER                     = 0,
-    WINED3DBASIS_BSPLINE                    = 1,
-    WINED3DBASIS_INTERPOLATE                = 2,
-    WINED3DBASIS_FORCE_DWORD                = 0x7fffffff
-} WINED3DBASISTYPE;
-
-typedef enum _WINED3DCUBEMAP_FACES
-{
-    WINED3DCUBEMAP_FACE_POSITIVE_X          = 0,
-    WINED3DCUBEMAP_FACE_NEGATIVE_X          = 1,
-    WINED3DCUBEMAP_FACE_POSITIVE_Y          = 2,
-    WINED3DCUBEMAP_FACE_NEGATIVE_Y          = 3,
-    WINED3DCUBEMAP_FACE_POSITIVE_Z          = 4,
-    WINED3DCUBEMAP_FACE_NEGATIVE_Z          = 5,
-    WINED3DCUBEMAP_FACE_FORCE_DWORD         = 0xffffffff
-} WINED3DCUBEMAP_FACES;
-
-typedef enum _WINED3DTEXTUREFILTERTYPE
-{
-    WINED3DTEXF_NONE                        = 0,
-    WINED3DTEXF_POINT                       = 1,
-    WINED3DTEXF_LINEAR                      = 2,
-    WINED3DTEXF_ANISOTROPIC                 = 3,
-    WINED3DTEXF_FLATCUBIC                   = 4,
-    WINED3DTEXF_GAUSSIANCUBIC               = 5,
-    WINED3DTEXF_PYRAMIDALQUAD               = 6,
-    WINED3DTEXF_GAUSSIANQUAD                = 7,
-    WINED3DTEXF_FORCE_DWORD                 = 0x7fffffff
-} WINED3DTEXTUREFILTERTYPE;
-
-typedef enum _WINED3DRESOURCETYPE
-{
-    WINED3DRTYPE_SURFACE                    = 1,
-    WINED3DRTYPE_VOLUME                     = 2,
-    WINED3DRTYPE_TEXTURE                    = 3,
-    WINED3DRTYPE_VOLUMETEXTURE              = 4,
-    WINED3DRTYPE_CUBETEXTURE                = 5,
-    WINED3DRTYPE_BUFFER                     = 6,
-    WINED3DRTYPE_FORCE_DWORD                = 0x7fffffff
-} WINED3DRESOURCETYPE;
-#define WINED3DRTYPECOUNT                                       WINED3DRTYPE_BUFFER
-
-typedef enum _WINED3DPOOL
-{
-    WINED3DPOOL_DEFAULT                     = 0,
-    WINED3DPOOL_MANAGED                     = 1,
-    WINED3DPOOL_SYSTEMMEM                   = 2,
-    WINED3DPOOL_SCRATCH                     = 3,
-    WINED3DPOOL_FORCE_DWORD                 = 0x7fffffff
-} WINED3DPOOL;
-
-typedef enum _WINED3DQUERYTYPE
-{
-    WINED3DQUERYTYPE_VCACHE                 = 4,
-    WINED3DQUERYTYPE_RESOURCEMANAGER        = 5,
-    WINED3DQUERYTYPE_VERTEXSTATS            = 6,
-    WINED3DQUERYTYPE_EVENT                  = 8,
-    WINED3DQUERYTYPE_OCCLUSION              = 9,
-    WINED3DQUERYTYPE_TIMESTAMP              = 10,
-    WINED3DQUERYTYPE_TIMESTAMPDISJOINT      = 11,
-    WINED3DQUERYTYPE_TIMESTAMPFREQ          = 12,
-    WINED3DQUERYTYPE_PIPELINETIMINGS        = 13,
-    WINED3DQUERYTYPE_INTERFACETIMINGS       = 14,
-    WINED3DQUERYTYPE_VERTEXTIMINGS          = 15,
-    WINED3DQUERYTYPE_PIXELTIMINGS           = 16,
-    WINED3DQUERYTYPE_BANDWIDTHTIMINGS       = 17,
-    WINED3DQUERYTYPE_CACHEUTILIZATION       = 18
-} WINED3DQUERYTYPE;
+enum wined3d_texture_op
+{
+    WINED3D_TOP_DISABLE                     = 1,
+    WINED3D_TOP_SELECT_ARG1                 = 2,
+    WINED3D_TOP_SELECT_ARG2                 = 3,
+    WINED3D_TOP_MODULATE                    = 4,
+    WINED3D_TOP_MODULATE_2X                 = 5,
+    WINED3D_TOP_MODULATE_4X                 = 6,
+    WINED3D_TOP_ADD                         = 7,
+    WINED3D_TOP_ADD_SIGNED                  = 8,
+    WINED3D_TOP_ADD_SIGNED_2X               = 9,
+    WINED3D_TOP_SUBTRACT                    = 10,
+    WINED3D_TOP_ADD_SMOOTH                  = 11,
+    WINED3D_TOP_BLEND_DIFFUSE_ALPHA         = 12,
+    WINED3D_TOP_BLEND_TEXTURE_ALPHA         = 13,
+    WINED3D_TOP_BLEND_FACTOR_ALPHA          = 14,
+    WINED3D_TOP_BLEND_TEXTURE_ALPHA_PM      = 15,
+    WINED3D_TOP_BLEND_CURRENT_ALPHA         = 16,
+    WINED3D_TOP_PREMODULATE                 = 17,
+    WINED3D_TOP_MODULATE_ALPHA_ADD_COLOR    = 18,
+    WINED3D_TOP_MODULATE_COLOR_ADD_ALPHA    = 19,
+    WINED3D_TOP_MODULATE_INVALPHA_ADD_COLOR = 20,
+    WINED3D_TOP_MODULATE_INVCOLOR_ADD_ALPHA = 21,
+    WINED3D_TOP_BUMPENVMAP                  = 22,
+    WINED3D_TOP_BUMPENVMAP_LUMINANCE        = 23,
+    WINED3D_TOP_DOTPRODUCT3                 = 24,
+    WINED3D_TOP_MULTIPLY_ADD                = 25,
+    WINED3D_TOP_LERP                        = 26,
+};
+
+enum wined3d_texture_address
+{
+    WINED3D_TADDRESS_WRAP                   = 1,
+    WINED3D_TADDRESS_MIRROR                 = 2,
+    WINED3D_TADDRESS_CLAMP                  = 3,
+    WINED3D_TADDRESS_BORDER                 = 4,
+    WINED3D_TADDRESS_MIRROR_ONCE            = 5,
+};
+
+enum wined3d_transform_state
+{
+    WINED3D_TS_VIEW                         = 2,
+    WINED3D_TS_PROJECTION                   = 3,
+    WINED3D_TS_TEXTURE0                     = 16,
+    WINED3D_TS_TEXTURE1                     = 17,
+    WINED3D_TS_TEXTURE2                     = 18,
+    WINED3D_TS_TEXTURE3                     = 19,
+    WINED3D_TS_TEXTURE4                     = 20,
+    WINED3D_TS_TEXTURE5                     = 21,
+    WINED3D_TS_TEXTURE6                     = 22,
+    WINED3D_TS_TEXTURE7                     = 23,
+    WINED3D_TS_WORLD                        = 256, /* WINED3D_TS_WORLD_MATRIX(0) */
+    WINED3D_TS_WORLD1                       = 257,
+    WINED3D_TS_WORLD2                       = 258,
+    WINED3D_TS_WORLD3                       = 259,
+};
+
+#define WINED3D_TS_WORLD_MATRIX(index)                          (enum wined3d_transform_state)(index + 256)
+
+enum wined3d_basis_type
+{
+    WINED3D_BASIS_BEZIER                    = 0,
+    WINED3D_BASIS_BSPLINE                   = 1,
+    WINED3D_BASIS_INTERPOLATE               = 2,
+};
+
+enum wined3d_cubemap_face
+{
+    WINED3D_CUBEMAP_FACE_POSITIVE_X         = 0,
+    WINED3D_CUBEMAP_FACE_NEGATIVE_X         = 1,
+    WINED3D_CUBEMAP_FACE_POSITIVE_Y         = 2,
+    WINED3D_CUBEMAP_FACE_NEGATIVE_Y         = 3,
+    WINED3D_CUBEMAP_FACE_POSITIVE_Z         = 4,
+    WINED3D_CUBEMAP_FACE_NEGATIVE_Z         = 5,
+};
+
+enum wined3d_texture_filter_type
+{
+    WINED3D_TEXF_NONE                       = 0,
+    WINED3D_TEXF_POINT                      = 1,
+    WINED3D_TEXF_LINEAR                     = 2,
+    WINED3D_TEXF_ANISOTROPIC                = 3,
+    WINED3D_TEXF_FLAT_CUBIC                 = 4,
+    WINED3D_TEXF_GAUSSIAN_CUBIC             = 5,
+    WINED3D_TEXF_PYRAMIDAL_QUAD             = 6,
+    WINED3D_TEXF_GAUSSIAN_QUAD              = 7,
+};
+
+enum wined3d_resource_type
+{
+    WINED3D_RTYPE_SURFACE                   = 1,
+    WINED3D_RTYPE_VOLUME                    = 2,
+    WINED3D_RTYPE_TEXTURE                   = 3,
+    WINED3D_RTYPE_VOLUME_TEXTURE            = 4,
+    WINED3D_RTYPE_CUBE_TEXTURE              = 5,
+    WINED3D_RTYPE_BUFFER                    = 6,
+};
+
+enum wined3d_pool
+{
+    WINED3D_POOL_DEFAULT                    = 0,
+    WINED3D_POOL_MANAGED                    = 1,
+    WINED3D_POOL_SYSTEM_MEM                 = 2,
+    WINED3D_POOL_SCRATCH                    = 3,
+};
+
+enum wined3d_query_type
+{
+    WINED3D_QUERY_TYPE_VCACHE               = 4,
+    WINED3D_QUERY_TYPE_RESOURCE_MANAGER     = 5,
+    WINED3D_QUERY_TYPE_VERTEX_STATS         = 6,
+    WINED3D_QUERY_TYPE_EVENT                = 8,
+    WINED3D_QUERY_TYPE_OCCLUSION            = 9,
+    WINED3D_QUERY_TYPE_TIMESTAMP            = 10,
+    WINED3D_QUERY_TYPE_TIMESTAMP_DISJOINT   = 11,
+    WINED3D_QUERY_TYPE_TIMESTAMP_FREQ       = 12,
+    WINED3D_QUERY_TYPE_PIPELINE_TIMINGS     = 13,
+    WINED3D_QUERY_TYPE_INTERFACE_TIMINGS    = 14,
+    WINED3D_QUERY_TYPE_VERTEX_TIMINGS       = 15,
+    WINED3D_QUERY_TYPE_PIXEL_TIMINGS        = 16,
+    WINED3D_QUERY_TYPE_BANDWIDTH_TIMINGS    = 17,
+    WINED3D_QUERY_TYPE_CACHE_UTILIZATION    = 18
+};
 
 #define WINED3DISSUE_BEGIN                                      (1 << 1)
 #define WINED3DISSUE_END                                        (1 << 0)
 #define WINED3DGETDATA_FLUSH                                    (1 << 0)
 
-typedef enum _WINED3DSTATEBLOCKTYPE
-{
-    WINED3DSBT_INIT                         = 0,
-    WINED3DSBT_ALL                          = 1,
-    WINED3DSBT_PIXELSTATE                   = 2,
-    WINED3DSBT_VERTEXSTATE                  = 3,
-    WINED3DSBT_RECORDED                     = 4, /* WineD3D private */
-    WINED3DSBT_FORCE_DWORD                  = 0xffffffff
-} WINED3DSTATEBLOCKTYPE;
-
-typedef enum _WINED3DDECLMETHOD
-{
-    WINED3DDECLMETHOD_DEFAULT               = 0,
-    WINED3DDECLMETHOD_PARTIALU              = 1,
-    WINED3DDECLMETHOD_PARTIALV              = 2,
-    WINED3DDECLMETHOD_CROSSUV               = 3,
-    WINED3DDECLMETHOD_UV                    = 4,
-    WINED3DDECLMETHOD_LOOKUP                = 5,
-    WINED3DDECLMETHOD_LOOKUPPRESAMPLED      = 6
-} WINED3DDECLMETHOD;
-
-typedef enum _WINED3DDECLUSAGE
-{
-    WINED3DDECLUSAGE_POSITION               = 0,
-    WINED3DDECLUSAGE_BLENDWEIGHT            = 1,
-    WINED3DDECLUSAGE_BLENDINDICES           = 2,
-    WINED3DDECLUSAGE_NORMAL                 = 3,
-    WINED3DDECLUSAGE_PSIZE                  = 4,
-    WINED3DDECLUSAGE_TEXCOORD               = 5,
-    WINED3DDECLUSAGE_TANGENT                = 6,
-    WINED3DDECLUSAGE_BINORMAL               = 7,
-    WINED3DDECLUSAGE_TESSFACTOR             = 8,
-    WINED3DDECLUSAGE_POSITIONT              = 9,
-    WINED3DDECLUSAGE_COLOR                  = 10,
-    WINED3DDECLUSAGE_FOG                    = 11,
-    WINED3DDECLUSAGE_DEPTH                  = 12,
-    WINED3DDECLUSAGE_SAMPLE                 = 13
-} WINED3DDECLUSAGE;
-
-typedef enum _WINED3DSURFTYPE
-{
-    SURFACE_OPENGL,                                 /* OpenGL surface: Renders using libGL, needed for 3D */
-    SURFACE_GDI,                                    /* User surface. No 3D, DirectDraw rendering with GDI */
-} WINED3DSURFTYPE;
+enum wined3d_stateblock_type
+{
+    WINED3D_SBT_INIT                        = 0,
+    WINED3D_SBT_ALL                         = 1,
+    WINED3D_SBT_PIXEL_STATE                 = 2,
+    WINED3D_SBT_VERTEX_STATE                = 3,
+    WINED3D_SBT_RECORDED                    = 4, /* WineD3D private */
+};
+
+enum wined3d_decl_method
+{
+    WINED3D_DECL_METHOD_DEFAULT             = 0,
+    WINED3D_DECL_METHOD_PARTIAL_U           = 1,
+    WINED3D_DECL_METHOD_PARTIAL_V           = 2,
+    WINED3D_DECL_METHOD_CROSS_UV            = 3,
+    WINED3D_DECL_METHOD_UV                  = 4,
+    WINED3D_DECL_METHOD_LOOKUP              = 5,
+    WINED3D_DECL_METHOD_LOOKUP_PRESAMPLED   = 6,
+};
+
+enum wined3d_decl_usage
+{
+    WINED3D_DECL_USAGE_POSITION             = 0,
+    WINED3D_DECL_USAGE_BLEND_WEIGHT         = 1,
+    WINED3D_DECL_USAGE_BLEND_INDICES        = 2,
+    WINED3D_DECL_USAGE_NORMAL               = 3,
+    WINED3D_DECL_USAGE_PSIZE                = 4,
+    WINED3D_DECL_USAGE_TEXCOORD             = 5,
+    WINED3D_DECL_USAGE_TANGENT              = 6,
+    WINED3D_DECL_USAGE_BINORMAL             = 7,
+    WINED3D_DECL_USAGE_TESS_FACTOR          = 8,
+    WINED3D_DECL_USAGE_POSITIONT            = 9,
+    WINED3D_DECL_USAGE_COLOR                = 10,
+    WINED3D_DECL_USAGE_FOG                  = 11,
+    WINED3D_DECL_USAGE_DEPTH                = 12,
+    WINED3D_DECL_USAGE_SAMPLE               = 13
+};
 
 enum wined3d_sysval_semantic
 {
@@ -777,6 +762,22 @@ enum wined3d_sysval_semantic
     WINED3D_SV_TARGET7 = 7,
 };
 
+enum wined3d_scanline_ordering
+{
+    WINED3D_SCANLINE_ORDERING_UNKNOWN       = 0,
+    WINED3D_SCANLINE_ORDERING_PROGRESSIVE   = 1,
+    WINED3D_SCANLINE_ORDERING_INTERLACED    = 2,
+};
+
+enum wined3d_display_rotation
+{
+    WINED3D_DISPLAY_ROTATION_UNSPECIFIED    = 0,
+    WINED3D_DISPLAY_ROTATION_0              = 1,
+    WINED3D_DISPLAY_ROTATION_90             = 2,
+    WINED3D_DISPLAY_ROTATION_180            = 3,
+    WINED3D_DISPLAY_ROTATION_270            = 4,
+};
+
 #define WINED3DCOLORWRITEENABLE_RED                             (1 << 0)
 #define WINED3DCOLORWRITEENABLE_GREEN                           (1 << 1)
 #define WINED3DCOLORWRITEENABLE_BLUE                            (1 << 2)
@@ -837,12 +838,12 @@ enum wined3d_sysval_semantic
 #define WINED3DUSAGE_QUERY_WRAPANDMIP                           0x00200000
 #define WINED3DUSAGE_QUERY_MASK                                 0x003f8000
 
-#define WINED3DLOCK_READONLY                                    0x0010
-#define WINED3DLOCK_NOSYSLOCK                                   0x0800
-#define WINED3DLOCK_NOOVERWRITE                                 0x1000
-#define WINED3DLOCK_DISCARD                                     0x2000
-#define WINED3DLOCK_DONOTWAIT                                   0x4000
-#define WINED3DLOCK_NO_DIRTY_UPDATE                             0x8000
+#define WINED3D_MAP_READONLY                                    0x0010
+#define WINED3D_MAP_NOSYSLOCK                                   0x0800
+#define WINED3D_MAP_NOOVERWRITE                                 0x1000
+#define WINED3D_MAP_DISCARD                                     0x2000
+#define WINED3D_MAP_DONOTWAIT                                   0x4000
+#define WINED3D_MAP_NO_DIRTY_UPDATE                             0x8000
 
 #define WINED3DPRESENT_RATE_DEFAULT                             0x00000000
 
@@ -1009,6 +1010,7 @@ enum wined3d_sysval_semantic
 #define WINED3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS                0x00040000
 #define WINED3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING             0x00080000
 #define WINED3DPMISCCAPS_FOGVERTEXCLAMPED                       0x00100000
+#define WINED3DPMISCCAPS_POSTBLENDSRGBCONVERT                   0x00200000
 
 #define WINED3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH                 24
 #define WINED3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH                 0
@@ -1213,6 +1215,9 @@ enum wined3d_sysval_semantic
 #define WINED3DDEVCAPS_NPATCHES                                 0x01000000
 
 #define WINED3D_LEGACY_DEPTH_BIAS                               0x00000001
+#define WINED3D_NO3D                                            0x00000002
+
+#define WINED3D_RESZ_CODE                                       0x7fa05000
 
 /* dwDDFX */
 /* arithmetic stretching along y axis */
@@ -1498,6 +1503,7 @@ struct wined3d_display_mode
     UINT height;
     UINT refresh_rate;
     enum wined3d_format_id format_id;
+    enum wined3d_scanline_ordering scanline_ordering;
 };
 
 struct wined3d_color
@@ -1515,6 +1521,14 @@ struct wined3d_vec3
     float z;
 };
 
+struct wined3d_vec4
+{
+    float x;
+    float y;
+    float z;
+    float w;
+};
+
 struct wined3d_matrix
 {
     union
@@ -1586,7 +1600,7 @@ struct wined3d_rect_patch_info
     UINT width;
     UINT height;
     UINT stride;
-    WINED3DBASISTYPE basis;
+    enum wined3d_basis_type basis;
     enum wined3d_degree_type degree;
 };
 
@@ -1594,7 +1608,7 @@ struct wined3d_tri_patch_info
 {
     UINT start_vertex_offset;
     UINT vertex_count;
-    WINED3DBASISTYPE basis;
+    enum wined3d_basis_type basis;
     enum wined3d_degree_type degree;
 };
 
@@ -1638,12 +1652,12 @@ struct wined3d_swapchain_desc
 
 struct wined3d_resource_desc
 {
-    WINED3DRESOURCETYPE resource_type;
+    enum wined3d_resource_type resource_type;
     enum wined3d_format_id format;
     enum wined3d_multisample_type multisample_type;
     UINT multisample_quality;
     DWORD usage;
-    WINED3DPOOL pool;
+    enum wined3d_pool pool;
     UINT width;
     UINT height;
     UINT depth;
@@ -1681,13 +1695,7 @@ struct wined3d_raster_status
     UINT scan_line;
 };
 
-struct wined3d_mapped_rect
-{
-    UINT row_pitch;
-    void *data;
-};
-
-struct wined3d_mapped_box
+struct wined3d_map_desc
 {
     UINT row_pitch;
     UINT slice_pitch;
@@ -1971,6 +1979,7 @@ struct wined3d_palette;
 struct wined3d_query;
 struct wined3d_rendertarget_view;
 struct wined3d_resource;
+struct wined3d_sampler;
 struct wined3d_shader;
 struct wined3d_stateblock;
 struct wined3d_surface;
@@ -1988,17 +1997,15 @@ struct wined3d_device_parent_ops
 {
     void (__cdecl *wined3d_device_created)(struct wined3d_device_parent *device_parent, struct wined3d_device *device);
     void (__cdecl *mode_changed)(struct wined3d_device_parent *device_parent);
-    HRESULT (__cdecl *create_surface)(struct wined3d_device_parent *device_parent, void *container_parent,
-            UINT width, UINT height, enum wined3d_format_id format_id, DWORD usage, WINED3DPOOL pool,
-            UINT level, WINED3DCUBEMAP_FACES face, struct wined3d_surface **surface);
-    HRESULT (__cdecl *create_rendertarget)(struct wined3d_device_parent *device_parent, void *container_parent,
-            UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type,
-            DWORD multisample_quality, BOOL lockable, struct wined3d_surface **surface);
-    HRESULT (__cdecl *create_depth_stencil)(struct wined3d_device_parent *device_parent,
-            UINT width, UINT height, enum wined3d_format_id format_id, enum wined3d_multisample_type multisample_type,
-            DWORD multisample_quality, BOOL discard, struct wined3d_surface **surface);
+    HRESULT (__cdecl *create_swapchain_surface)(struct wined3d_device_parent *device_parent, void *container_parent,
+            UINT width, UINT height, enum wined3d_format_id format_id, DWORD usage,
+            enum wined3d_multisample_type multisample_type, DWORD multisample_quality,
+            struct wined3d_surface **surface);
+    HRESULT (__cdecl *create_texture_surface)(struct wined3d_device_parent *device_parent, void *container_parent,
+            UINT width, UINT height, enum wined3d_format_id format_id, DWORD usage, enum wined3d_pool pool,
+            UINT sub_resource_idx, struct wined3d_surface **surface);
     HRESULT (__cdecl *create_volume)(struct wined3d_device_parent *device_parent, void *container_parent,
-            UINT width, UINT height, UINT depth, enum wined3d_format_id format_id, WINED3DPOOL pool, DWORD usage,
+            UINT width, UINT height, UINT depth, enum wined3d_format_id format_id, enum wined3d_pool pool, DWORD usage,
             struct wined3d_volume **volume);
     HRESULT (__cdecl *create_swapchain)(struct wined3d_device_parent *device_parent,
             struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain);
@@ -2014,8 +2021,7 @@ HRESULT __cdecl wined3d_check_depth_stencil_match(const struct wined3d *wined3d,
         enum wined3d_format_id render_target_format_id, enum wined3d_format_id depth_stencil_format_id);
 HRESULT __cdecl wined3d_check_device_format(const struct wined3d *wined3d, UINT adaper_idx,
         enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage,
-        WINED3DRESOURCETYPE resource_type, enum wined3d_format_id check_format_id,
-        WINED3DSURFTYPE surface_type);
+        enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id);
 HRESULT __cdecl wined3d_check_device_format_conversion(const struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_device_type device_type, enum wined3d_format_id source_format_id,
         enum wined3d_format_id target_format_id);
@@ -2025,30 +2031,36 @@ HRESULT __cdecl wined3d_check_device_multisample_type(const struct wined3d *wine
 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_id,
         enum wined3d_format_id backbuffer_format_id, BOOL windowed);
-struct wined3d * __cdecl wined3d_create(UINT dxVersion, DWORD flags, void *parent);
+struct wined3d * __cdecl wined3d_create(UINT version, DWORD flags);
 ULONG __cdecl wined3d_decref(struct wined3d *wined3d);
 HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx,
-        enum wined3d_format_id format_id, UINT mode_idx, struct wined3d_display_mode *mode);
+        enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering,
+        UINT mode_idx, struct wined3d_display_mode *mode);
 UINT __cdecl wined3d_get_adapter_count(const struct wined3d *wined3d);
 HRESULT __cdecl wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx,
-        struct wined3d_display_mode *mode);
+        struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
 HRESULT __cdecl wined3d_get_adapter_identifier(const struct wined3d *wined3d, UINT adapter_idx,
         DWORD flags, struct wined3d_adapter_identifier *identifier);
-UINT __cdecl wined3d_get_adapter_mode_count(const struct wined3d *wined3d,
-        UINT adapter_idx, enum wined3d_format_id format_id);
+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);
 HMONITOR __cdecl wined3d_get_adapter_monitor(const struct wined3d *wined3d, UINT adapter_idx);
+HRESULT __cdecl wined3d_get_adapter_raster_status(const struct wined3d *wined3d, UINT adapter_idx,
+        struct wined3d_raster_status *raster_status);
 HRESULT __cdecl wined3d_get_device_caps(const struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_device_type device_type, WINED3DCAPS *caps);
-void * __cdecl wined3d_get_parent(const struct wined3d *wined3d);
 ULONG __cdecl wined3d_incref(struct wined3d *wined3d);
 HRESULT __cdecl wined3d_register_software_device(struct wined3d *wined3d, void *init_function);
+HRESULT __cdecl wined3d_set_adapter_display_mode(struct wined3d *wined3d,
+        UINT adapter_idx, const struct wined3d_display_mode *mode);
 
 HRESULT __cdecl wined3d_buffer_create(struct wined3d_device *device, struct wined3d_buffer_desc *desc,
         const void *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
-HRESULT __cdecl wined3d_buffer_create_ib(struct wined3d_device *device, UINT length, DWORD usage, WINED3DPOOL pool,
-        void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
-HRESULT __cdecl wined3d_buffer_create_vb(struct wined3d_device *device, UINT length, DWORD usage, WINED3DPOOL pool,
-        void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_buffer **buffer);
+HRESULT __cdecl wined3d_buffer_create_ib(struct wined3d_device *device, UINT length, DWORD usage,
+        enum wined3d_pool pool, void *parent, const struct wined3d_parent_ops *parent_ops,
+        struct wined3d_buffer **buffer);
+HRESULT __cdecl wined3d_buffer_create_vb(struct wined3d_device *device, UINT length, DWORD usage,
+        enum wined3d_pool pool, void *parent, const struct wined3d_parent_ops *parent_ops,
+        struct wined3d_buffer **buffer);
 ULONG __cdecl wined3d_buffer_decref(struct wined3d_buffer *buffer);
 void * __cdecl wined3d_buffer_get_parent(const struct wined3d_buffer *buffer);
 DWORD __cdecl wined3d_buffer_get_priority(const struct wined3d_buffer *buffer);
@@ -2072,23 +2084,10 @@ HRESULT __cdecl wined3d_device_create(struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_device_type device_type, HWND focus_window, DWORD behaviour_flags, BYTE surface_alignment,
         struct wined3d_device_parent *device_parent, struct wined3d_device **device);
 ULONG __cdecl wined3d_device_decref(struct wined3d_device *device);
-HRESULT __cdecl wined3d_device_delete_patch(struct wined3d_device *device, UINT handle);
 HRESULT __cdecl wined3d_device_draw_indexed_primitive(struct wined3d_device *device, UINT start_idx, UINT index_count);
-HRESULT __cdecl wined3d_device_draw_indexed_primitive_strided(struct wined3d_device *device, UINT index_count,
-        const struct wined3d_strided_data *strided_data, UINT vertex_count, const void *index_data,
-        enum wined3d_format_id index_data_format_id);
-HRESULT __cdecl wined3d_device_draw_indexed_primitive_up(struct wined3d_device *device,
-        UINT index_count, const void *index_data, enum wined3d_format_id index_data_format_id,
-        const void *stream_data, UINT stream_stride);
+void __cdecl wined3d_device_draw_indexed_primitive_instanced(struct wined3d_device *device,
+        UINT start_idx, UINT index_count, UINT start_instance, UINT instance_count);
 HRESULT __cdecl wined3d_device_draw_primitive(struct wined3d_device *device, UINT start_vertex, UINT vertex_count);
-HRESULT __cdecl wined3d_device_draw_primitive_strided(struct wined3d_device *device,
-        UINT vertex_count, const struct wined3d_strided_data *strided_data);
-HRESULT __cdecl wined3d_device_draw_primitive_up(struct wined3d_device *device,
-        UINT vertex_count, const void *stream_data, UINT stream_stride);
-HRESULT __cdecl wined3d_device_draw_rect_patch(struct wined3d_device *device, UINT handle,
-        const float *num_segs, const struct wined3d_rect_patch_info *rect_patch_info);
-HRESULT __cdecl wined3d_device_draw_tri_patch(struct wined3d_device *device, UINT handle,
-        const float *num_segs, const struct wined3d_tri_patch_info *tri_patch_info);
 HRESULT __cdecl wined3d_device_end_scene(struct wined3d_device *device);
 HRESULT __cdecl wined3d_device_end_stateblock(struct wined3d_device *device, struct wined3d_stateblock **stateblock);
 void __cdecl wined3d_device_evict_managed_resources(struct wined3d_device *device);
@@ -2096,143 +2095,156 @@ UINT __cdecl wined3d_device_get_available_texture_mem(const struct wined3d_devic
 HRESULT __cdecl wined3d_device_get_back_buffer(const struct wined3d_device *device, UINT swapchain_idx,
         UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type, struct wined3d_surface **backbuffer);
 INT __cdecl wined3d_device_get_base_vertex_index(const struct wined3d_device *device);
-HRESULT __cdecl wined3d_device_get_clip_plane(const struct wined3d_device *device, UINT plane_idx, float *plane);
+HRESULT __cdecl wined3d_device_get_clip_plane(const struct wined3d_device *device,
+        UINT plane_idx, struct wined3d_vec4 *plane);
 HRESULT __cdecl wined3d_device_get_clip_status(const struct wined3d_device *device,
         struct wined3d_clip_status *clip_status);
-HRESULT __cdecl wined3d_device_get_creation_parameters(const struct wined3d_device *device,
+void __cdecl wined3d_device_get_creation_parameters(const struct wined3d_device *device,
         struct wined3d_device_creation_parameters *creation_parameters);
-HRESULT __cdecl wined3d_device_get_depth_stencil(const struct wined3d_device *device,
-        struct wined3d_surface **depth_stencil);
+struct wined3d_surface * __cdecl wined3d_device_get_depth_stencil(const struct wined3d_device *device);
 HRESULT __cdecl wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps);
-HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device,
-        UINT swapchain_idx, struct wined3d_display_mode *mode);
+HRESULT __cdecl wined3d_device_get_display_mode(const struct wined3d_device *device, UINT swapchain_idx,
+        struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
 HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device *device,
         UINT swapchain_idx, struct wined3d_surface *dst_surface);
 void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device,
         UINT swapchain_idx, struct wined3d_gamma_ramp *ramp);
-HRESULT __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *device,
-        struct wined3d_buffer **index_buffer);
+struct wined3d_shader * __cdecl wined3d_device_get_geometry_shader(const struct wined3d_device *device);
+struct wined3d_buffer * __cdecl wined3d_device_get_gs_cb(const struct wined3d_device *device, UINT idx);
+struct wined3d_sampler * __cdecl wined3d_device_get_gs_sampler(const struct wined3d_device *device, UINT idx);
+struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *device,
+        enum wined3d_format_id *format);
 HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device,
         UINT light_idx, struct wined3d_light *light);
 HRESULT __cdecl wined3d_device_get_light_enable(const struct wined3d_device *device, UINT light_idx, BOOL *enable);
-HRESULT __cdecl wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material);
+void __cdecl wined3d_device_get_material(const struct wined3d_device *device, struct wined3d_material *material);
 float __cdecl wined3d_device_get_npatch_mode(const struct wined3d_device *device);
 struct wined3d_shader * __cdecl wined3d_device_get_pixel_shader(const struct wined3d_device *device);
 void __cdecl wined3d_device_get_primitive_type(const struct wined3d_device *device,
         enum wined3d_primitive_type *primitive_topology);
+struct wined3d_buffer * __cdecl wined3d_device_get_ps_cb(const struct wined3d_device *device, UINT idx);
 HRESULT __cdecl wined3d_device_get_ps_consts_b(const struct wined3d_device *device,
         UINT start_register, BOOL *constants, UINT bool_count);
 HRESULT __cdecl wined3d_device_get_ps_consts_f(const struct wined3d_device *device,
         UINT start_register, float *constants, UINT vector4f_count);
 HRESULT __cdecl wined3d_device_get_ps_consts_i(const struct wined3d_device *device,
         UINT start_register, int *constants, UINT vector4i_count);
+struct wined3d_sampler * __cdecl wined3d_device_get_ps_sampler(const struct wined3d_device *device, UINT idx);
 HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *device,
         UINT swapchain_idx, struct wined3d_raster_status *raster_status);
-HRESULT __cdecl wined3d_device_get_render_state(const struct wined3d_device *device,
-        enum wined3d_render_state state, DWORD *value);
-HRESULT __cdecl wined3d_device_get_render_target(const struct wined3d_device *device,
-        UINT render_target_idx, struct wined3d_surface **render_target);
-HRESULT __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device,
-        UINT sampler_idx, enum wined3d_sampler_state state, DWORD *value);
-HRESULT __cdecl wined3d_device_get_scissor_rect(const struct wined3d_device *device, RECT *rect);
+DWORD __cdecl wined3d_device_get_render_state(const struct wined3d_device *device, enum wined3d_render_state state);
+struct wined3d_surface * __cdecl wined3d_device_get_render_target(const struct wined3d_device *device,
+        UINT render_target_idx);
+DWORD __cdecl wined3d_device_get_sampler_state(const struct wined3d_device *device,
+        UINT sampler_idx, enum wined3d_sampler_state state);
+void __cdecl wined3d_device_get_scissor_rect(const struct wined3d_device *device, RECT *rect);
 BOOL __cdecl wined3d_device_get_software_vertex_processing(const struct wined3d_device *device);
+struct wined3d_buffer * __cdecl wined3d_device_get_stream_output(struct wined3d_device *device,
+        UINT idx, UINT *offset);
 HRESULT __cdecl wined3d_device_get_stream_source(const struct wined3d_device *device,
         UINT stream_idx, struct wined3d_buffer **buffer, UINT *offset, UINT *stride);
 HRESULT __cdecl wined3d_device_get_stream_source_freq(const struct wined3d_device *device,
         UINT stream_idx, UINT *divider);
-HRESULT __cdecl wined3d_device_get_surface_from_dc(const struct wined3d_device *device,
-        HDC dc, struct wined3d_surface **surface);
-HRESULT __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device,
-        UINT swapchain_idx, struct wined3d_swapchain **swapchain);
+struct wined3d_surface * __cdecl wined3d_device_get_surface_from_dc(const struct wined3d_device *device, HDC dc);
+struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct wined3d_device *device,
+        UINT swapchain_idx);
 UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device);
-HRESULT __cdecl wined3d_device_get_texture(const struct wined3d_device *device,
-        UINT stage, struct wined3d_texture **texture);
-HRESULT __cdecl wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
-        UINT stage, enum wined3d_texture_stage_state state, DWORD *value);
-HRESULT __cdecl wined3d_device_get_transform(const struct wined3d_device *device,
-        WINED3DTRANSFORMSTATETYPE state, struct wined3d_matrix *matrix);
-HRESULT __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device,
-        struct wined3d_vertex_declaration **declaration);
+struct wined3d_texture * __cdecl wined3d_device_get_texture(const struct wined3d_device *device, UINT stage);
+DWORD __cdecl wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
+        UINT stage, enum wined3d_texture_stage_state state);
+void __cdecl wined3d_device_get_transform(const struct wined3d_device *device,
+        enum wined3d_transform_state state, struct wined3d_matrix *matrix);
+struct wined3d_vertex_declaration * __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device);
 struct wined3d_shader * __cdecl wined3d_device_get_vertex_shader(const struct wined3d_device *device);
-HRESULT __cdecl wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport);
+void __cdecl wined3d_device_get_viewport(const struct wined3d_device *device, struct wined3d_viewport *viewport);
+struct wined3d_buffer * __cdecl wined3d_device_get_vs_cb(const struct wined3d_device *device, UINT idx);
 HRESULT __cdecl wined3d_device_get_vs_consts_b(const struct wined3d_device *device,
         UINT start_register, BOOL *constants, UINT bool_count);
 HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *device,
         UINT start_register, float *constants, UINT vector4f_count);
 HRESULT __cdecl wined3d_device_get_vs_consts_i(const struct wined3d_device *device,
         UINT start_register, int *constants, UINT vector4i_count);
-HRESULT __cdecl wined3d_device_get_wined3d(const struct wined3d_device *device, struct wined3d **wined3d);
+struct wined3d_sampler * __cdecl wined3d_device_get_vs_sampler(const struct wined3d_device *device, UINT idx);
 ULONG __cdecl wined3d_device_incref(struct wined3d_device *device);
 HRESULT __cdecl wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc);
 HRESULT __cdecl wined3d_device_init_gdi(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc);
-HRESULT __cdecl wined3d_device_multiply_transform(struct wined3d_device *device,
-        WINED3DTRANSFORMSTATETYPE state, const struct wined3d_matrix *matrix);
+void __cdecl wined3d_device_multiply_transform(struct wined3d_device *device,
+        enum wined3d_transform_state state, const struct wined3d_matrix *matrix);
 HRESULT __cdecl wined3d_device_present(const struct wined3d_device *device, const RECT *src_rect,
-        const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region);
+        const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags);
 HRESULT __cdecl wined3d_device_process_vertices(struct wined3d_device *device,
         UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer,
         const struct wined3d_vertex_declaration *declaration, DWORD flags, DWORD dst_fvf);
 void __cdecl wined3d_device_release_focus_window(struct wined3d_device *device);
 HRESULT __cdecl wined3d_device_reset(struct wined3d_device *device,
-        const struct wined3d_swapchain_desc *swapchain_desc, wined3d_device_reset_cb callback);
+        const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode,
+        wined3d_device_reset_cb callback, BOOL reset_state);
 void __cdecl wined3d_device_restore_fullscreen_window(struct wined3d_device *device, HWND window);
-HRESULT __cdecl wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index);
-HRESULT __cdecl wined3d_device_set_clip_plane(struct wined3d_device *device, UINT plane_idx, const float *plane);
+void __cdecl wined3d_device_set_base_vertex_index(struct wined3d_device *device, INT base_index);
+HRESULT __cdecl wined3d_device_set_clip_plane(struct wined3d_device *device,
+        UINT plane_idx, const struct wined3d_vec4 *plane);
 HRESULT __cdecl wined3d_device_set_clip_status(struct wined3d_device *device,
         const struct wined3d_clip_status *clip_status);
 void __cdecl wined3d_device_set_cursor_position(struct wined3d_device *device,
         int x_screen_space, int y_screen_space, DWORD flags);
 HRESULT __cdecl wined3d_device_set_cursor_properties(struct wined3d_device *device,
         UINT x_hotspot, UINT y_hotspot, struct wined3d_surface *cursor_surface);
-HRESULT __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil);
+void __cdecl wined3d_device_set_depth_stencil(struct wined3d_device *device, struct wined3d_surface *depth_stencil);
 HRESULT __cdecl wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs);
-HRESULT __cdecl wined3d_device_set_display_mode(struct wined3d_device *device,
-        UINT swapchain_idx, const struct wined3d_display_mode *mode);
 void __cdecl wined3d_device_set_gamma_ramp(const struct wined3d_device *device,
         UINT swapchain_idx, DWORD flags, const struct wined3d_gamma_ramp *ramp);
-HRESULT __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
+void __cdecl wined3d_device_set_geometry_shader(struct wined3d_device *device, struct wined3d_shader *shader);
+void __cdecl wined3d_device_set_gs_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer);
+void __cdecl wined3d_device_set_gs_sampler(struct wined3d_device *device, UINT idx, struct wined3d_sampler *sampler);
+void __cdecl wined3d_device_set_index_buffer(struct wined3d_device *device,
         struct wined3d_buffer *index_buffer, enum wined3d_format_id format_id);
 HRESULT __cdecl wined3d_device_set_light(struct wined3d_device *device,
         UINT light_idx, const struct wined3d_light *light);
 HRESULT __cdecl wined3d_device_set_light_enable(struct wined3d_device *device, UINT light_idx, BOOL enable);
-HRESULT __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
+void __cdecl wined3d_device_set_material(struct wined3d_device *device, const struct wined3d_material *material);
 void __cdecl wined3d_device_set_multithreaded(struct wined3d_device *device);
 HRESULT __cdecl wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments);
-HRESULT __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
+void __cdecl wined3d_device_set_pixel_shader(struct wined3d_device *device, struct wined3d_shader *shader);
 void __cdecl wined3d_device_set_primitive_type(struct wined3d_device *device,
         enum wined3d_primitive_type primitive_topology);
+void __cdecl wined3d_device_set_ps_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer);
 HRESULT __cdecl wined3d_device_set_ps_consts_b(struct wined3d_device *device,
         UINT start_register, const BOOL *constants, UINT bool_count);
 HRESULT __cdecl wined3d_device_set_ps_consts_f(struct wined3d_device *device,
         UINT start_register, const float *constants, UINT vector4f_count);
 HRESULT __cdecl wined3d_device_set_ps_consts_i(struct wined3d_device *device,
         UINT start_register, const int *constants, UINT vector4i_count);
-HRESULT __cdecl wined3d_device_set_render_state(struct wined3d_device *device,
+void __cdecl wined3d_device_set_ps_sampler(struct wined3d_device *device, UINT idx, struct wined3d_sampler *sampler);
+void __cdecl wined3d_device_set_render_state(struct wined3d_device *device,
         enum wined3d_render_state state, DWORD value);
 HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device,
         UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport);
-HRESULT __cdecl wined3d_device_set_sampler_state(struct wined3d_device *device,
+void __cdecl wined3d_device_set_sampler_state(struct wined3d_device *device,
         UINT sampler_idx, enum wined3d_sampler_state state, DWORD value);
-HRESULT __cdecl wined3d_device_set_scissor_rect(struct wined3d_device *device, const RECT *rect);
-HRESULT __cdecl wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software);
+void __cdecl wined3d_device_set_scissor_rect(struct wined3d_device *device, const RECT *rect);
+void __cdecl wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software);
+void __cdecl wined3d_device_set_stream_output(struct wined3d_device *device, UINT idx,
+        struct wined3d_buffer *buffer, UINT offset);
 HRESULT __cdecl wined3d_device_set_stream_source(struct wined3d_device *device,
         UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride);
 HRESULT __cdecl wined3d_device_set_stream_source_freq(struct wined3d_device *device, UINT stream_idx, UINT divider);
 HRESULT __cdecl wined3d_device_set_texture(struct wined3d_device *device, UINT stage, struct wined3d_texture *texture);
-HRESULT __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *device,
+void __cdecl wined3d_device_set_texture_stage_state(struct wined3d_device *device,
         UINT stage, enum wined3d_texture_stage_state state, DWORD value);
-HRESULT __cdecl wined3d_device_set_transform(struct wined3d_device *device,
-        WINED3DTRANSFORMSTATETYPE state, const struct wined3d_matrix *matrix);
-HRESULT __cdecl wined3d_device_set_vertex_declaration(struct wined3d_device *device,
+void __cdecl wined3d_device_set_transform(struct wined3d_device *device,
+        enum wined3d_transform_state state, const struct wined3d_matrix *matrix);
+void __cdecl wined3d_device_set_vertex_declaration(struct wined3d_device *device,
         struct wined3d_vertex_declaration *declaration);
-HRESULT __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader);
-HRESULT __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
+void __cdecl wined3d_device_set_vertex_shader(struct wined3d_device *device, struct wined3d_shader *shader);
+void __cdecl wined3d_device_set_viewport(struct wined3d_device *device, const struct wined3d_viewport *viewport);
+void __cdecl wined3d_device_set_vs_cb(struct wined3d_device *device, UINT idx, struct wined3d_buffer *buffer);
 HRESULT __cdecl wined3d_device_set_vs_consts_b(struct wined3d_device *device,
         UINT start_register, const BOOL *constants, UINT bool_count);
 HRESULT __cdecl wined3d_device_set_vs_consts_f(struct wined3d_device *device,
         UINT start_register, const float *constants, UINT vector4f_count);
 HRESULT __cdecl wined3d_device_set_vs_consts_i(struct wined3d_device *device,
         UINT start_register, const int *constants, UINT vector4i_count);
+void __cdecl wined3d_device_set_vs_sampler(struct wined3d_device *device, UINT idx, struct wined3d_sampler *sampler);
 void __cdecl wined3d_device_setup_fullscreen_window(struct wined3d_device *device, HWND window, UINT w, UINT h);
 BOOL __cdecl wined3d_device_show_cursor(struct wined3d_device *device, BOOL show);
 HRESULT __cdecl wined3d_device_uninit_3d(struct wined3d_device *device);
@@ -2255,11 +2267,11 @@ HRESULT __cdecl wined3d_palette_set_entries(struct wined3d_palette *palette,
         DWORD flags, DWORD start, DWORD count, const PALETTEENTRY *entries);
 
 HRESULT __cdecl wined3d_query_create(struct wined3d_device *device,
-        WINED3DQUERYTYPE type, struct wined3d_query **query);
+        enum wined3d_query_type type, struct wined3d_query **query);
 ULONG __cdecl wined3d_query_decref(struct wined3d_query *query);
 HRESULT __cdecl wined3d_query_get_data(struct wined3d_query *query, void *data, UINT data_size, DWORD flags);
 UINT __cdecl wined3d_query_get_data_size(const struct wined3d_query *query);
-WINED3DQUERYTYPE __cdecl wined3d_query_get_type(const struct wined3d_query *query);
+enum wined3d_query_type __cdecl wined3d_query_get_type(const struct wined3d_query *query);
 ULONG __cdecl wined3d_query_incref(struct wined3d_query *query);
 HRESULT __cdecl wined3d_query_issue(struct wined3d_query *query, DWORD flags);
 
@@ -2279,6 +2291,11 @@ void * __cdecl wined3d_rendertarget_view_get_parent(const struct wined3d_rendert
 struct wined3d_resource * __cdecl wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view);
 ULONG __cdecl wined3d_rendertarget_view_incref(struct wined3d_rendertarget_view *view);
 
+HRESULT __cdecl wined3d_sampler_create(void *parent, struct wined3d_sampler **sampler);
+ULONG __cdecl wined3d_sampler_decref(struct wined3d_sampler *sampler);
+void * __cdecl wined3d_sampler_get_parent(const struct wined3d_sampler *sampler);
+ULONG __cdecl wined3d_sampler_incref(struct wined3d_sampler *sampler);
+
 HRESULT __cdecl wined3d_shader_create_gs(struct wined3d_device *device, const DWORD *byte_code,
         const struct wined3d_shader_signature *output_signature, void *parent,
         const struct wined3d_parent_ops *parent_ops, struct wined3d_shader **shader, unsigned int max_version);
@@ -2296,22 +2313,23 @@ ULONG __cdecl wined3d_shader_incref(struct wined3d_shader *shader);
 HRESULT __cdecl wined3d_shader_set_local_constants_float(struct wined3d_shader *shader,
         UINT start_idx, const float *src_data, UINT vector4f_count);
 
-HRESULT __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
-HRESULT __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
+void __cdecl wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock);
+void __cdecl wined3d_stateblock_capture(struct wined3d_stateblock *stateblock);
 HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
-        WINED3DSTATEBLOCKTYPE type, struct wined3d_stateblock **stateblock);
+        enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock);
 ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
 ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
 
 HRESULT __cdecl wined3d_surface_blt(struct wined3d_surface *dst_surface, const RECT *dst_rect,
         struct wined3d_surface *src_surface, const RECT *src_rect, DWORD flags,
-        const WINEDDBLTFX *blt_fx, WINED3DTEXTUREFILTERTYPE filter);
+        const WINEDDBLTFX *blt_fx, enum wined3d_texture_filter_type filter);
 HRESULT __cdecl wined3d_surface_create(struct wined3d_device *device, UINT width, UINT height,
-        enum wined3d_format_id format_id, UINT level, DWORD usage, WINED3DPOOL pool,
-        enum wined3d_multisample_type multisample_type, DWORD multisample_quality, WINED3DSURFTYPE surface_type,
-        DWORD flags, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface);
+        enum wined3d_format_id format_id, DWORD usage, enum wined3d_pool pool,
+        enum wined3d_multisample_type multisample_type, DWORD multisample_quality, DWORD flags,
+        void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_surface **surface);
 ULONG __cdecl wined3d_surface_decref(struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_flip(struct wined3d_surface *surface, struct wined3d_surface *override, DWORD flags);
+struct wined3d_surface * __cdecl wined3d_surface_from_resource(struct wined3d_resource *resource);
 HRESULT __cdecl wined3d_surface_get_blt_status(const struct wined3d_surface *surface, DWORD flags);
 HRESULT __cdecl wined3d_surface_get_flip_status(const struct wined3d_surface *surface, DWORD flags);
 HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y);
@@ -2326,38 +2344,39 @@ HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
 ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_is_lost(const struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_map(struct wined3d_surface *surface,
-        struct wined3d_mapped_rect *mapped_rect, const RECT *rect, DWORD flags);
+        struct wined3d_map_desc *map_desc, const RECT *rect, DWORD flags);
 void __cdecl wined3d_surface_preload(struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_releasedc(struct wined3d_surface *surface, HDC dc);
 HRESULT __cdecl wined3d_surface_restore(struct wined3d_surface *surface);
 HRESULT __cdecl wined3d_surface_set_color_key(struct wined3d_surface *surface,
         DWORD flags, const struct wined3d_color_key *color_key);
-HRESULT __cdecl wined3d_surface_set_format(struct wined3d_surface *surface, enum wined3d_format_id format_id);
 HRESULT __cdecl wined3d_surface_set_mem(struct wined3d_surface *surface, void *mem);
 HRESULT __cdecl wined3d_surface_set_overlay_position(struct wined3d_surface *surface, LONG x, LONG y);
-HRESULT __cdecl wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette);
+void __cdecl wined3d_surface_set_palette(struct wined3d_surface *surface, struct wined3d_palette *palette);
 DWORD __cdecl wined3d_surface_set_priority(struct wined3d_surface *surface, DWORD new_priority);
 HRESULT __cdecl wined3d_surface_unmap(struct wined3d_surface *surface);
+HRESULT __cdecl wined3d_surface_update_desc(struct wined3d_surface *surface,
+        UINT width, UINT height, enum wined3d_format_id format_id,
+        enum wined3d_multisample_type multisample_type, UINT multisample_quality);
 HRESULT __cdecl wined3d_surface_update_overlay(struct wined3d_surface *surface, const RECT *src_rect,
         struct wined3d_surface *dst_surface, const RECT *dst_rect, DWORD flags, const WINEDDOVERLAYFX *fx);
 HRESULT __cdecl wined3d_surface_update_overlay_z_order(struct wined3d_surface *surface,
         DWORD flags, struct wined3d_surface *ref);
 
-HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device,
-        struct wined3d_swapchain_desc *desc, WINED3DSURFTYPE surface_type, void *parent,
-        const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
+HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
+        void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
 ULONG __cdecl wined3d_swapchain_decref(struct wined3d_swapchain *swapchain);
-HRESULT __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain,
-        UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type, struct wined3d_surface **backbuffer);
+struct wined3d_surface * __cdecl wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain,
+        UINT backbuffer_idx, enum wined3d_backbuffer_type backbuffer_type);
 struct wined3d_device * __cdecl wined3d_swapchain_get_device(const struct wined3d_swapchain *swapchain);
 HRESULT __cdecl wined3d_swapchain_get_display_mode(const struct wined3d_swapchain *swapchain,
-        struct wined3d_display_mode *mode);
+        struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation);
 HRESULT __cdecl wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain,
         struct wined3d_surface *dst_surface);
 HRESULT __cdecl wined3d_swapchain_get_gamma_ramp(const struct wined3d_swapchain *swapchain,
         struct wined3d_gamma_ramp *ramp);
 void * __cdecl wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain);
-HRESULT __cdecl wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain,
+void __cdecl wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain,
         struct wined3d_swapchain_desc *desc);
 HRESULT __cdecl wined3d_swapchain_get_raster_status(const struct wined3d_swapchain *swapchain,
         struct wined3d_raster_status *raster_status);
@@ -2367,22 +2386,22 @@ HRESULT __cdecl wined3d_swapchain_present(struct wined3d_swapchain *swapchain,
         const RGNDATA *dirty_region, DWORD flags);
 HRESULT __cdecl wined3d_swapchain_set_gamma_ramp(const struct wined3d_swapchain *swapchain,
         DWORD flags, const struct wined3d_gamma_ramp *ramp);
-HRESULT __cdecl wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window);
+void __cdecl wined3d_swapchain_set_window(struct wined3d_swapchain *swapchain, HWND window);
 
 HRESULT __cdecl wined3d_texture_add_dirty_region(struct wined3d_texture *texture,
         UINT layer, const struct wined3d_box *dirty_region);
 HRESULT __cdecl wined3d_texture_create_2d(struct wined3d_device *device, UINT width, UINT height,
-        UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
+        UINT level_count, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, void *parent,
         const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
 HRESULT __cdecl wined3d_texture_create_3d(struct wined3d_device *device, UINT width, UINT height, UINT depth,
-        UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
+        UINT level_count, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, void *parent,
         const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
 HRESULT __cdecl wined3d_texture_create_cube(struct wined3d_device *device, UINT edge_length,
-        UINT level_count, DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
+        UINT level_count, DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, void *parent,
         const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture);
 ULONG __cdecl wined3d_texture_decref(struct wined3d_texture *texture);
 void __cdecl wined3d_texture_generate_mipmaps(struct wined3d_texture *texture);
-WINED3DTEXTUREFILTERTYPE __cdecl wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture);
+enum wined3d_texture_filter_type __cdecl wined3d_texture_get_autogen_filter_type(const struct wined3d_texture *texture);
 DWORD __cdecl wined3d_texture_get_level_count(const struct wined3d_texture *texture);
 DWORD __cdecl wined3d_texture_get_lod(const struct wined3d_texture *texture);
 void * __cdecl wined3d_texture_get_parent(const struct wined3d_texture *texture);
@@ -2393,7 +2412,7 @@ struct wined3d_resource * __cdecl wined3d_texture_get_sub_resource(struct wined3
 ULONG __cdecl wined3d_texture_incref(struct wined3d_texture *texture);
 void __cdecl wined3d_texture_preload(struct wined3d_texture *texture);
 HRESULT __cdecl wined3d_texture_set_autogen_filter_type(struct wined3d_texture *texture,
-        WINED3DTEXTUREFILTERTYPE filter_type);
+        enum wined3d_texture_filter_type filter_type);
 DWORD __cdecl wined3d_texture_set_lod(struct wined3d_texture *texture, DWORD lod);
 DWORD __cdecl wined3d_texture_set_priority(struct wined3d_texture *texture, DWORD priority);
 
@@ -2408,7 +2427,7 @@ void * __cdecl wined3d_vertex_declaration_get_parent(const struct wined3d_vertex
 ULONG __cdecl wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration);
 
 HRESULT __cdecl wined3d_volume_create(struct wined3d_device *device, UINT width, UINT height, UINT depth,
-        DWORD usage, enum wined3d_format_id format_id, WINED3DPOOL pool, void *parent,
+        DWORD usage, enum wined3d_format_id format_id, enum wined3d_pool pool, void *parent,
         const struct wined3d_parent_ops *parent_ops, struct wined3d_volume **volume);
 ULONG __cdecl wined3d_volume_decref(struct wined3d_volume *volume);
 struct wined3d_volume * __cdecl wined3d_volume_from_resource(struct wined3d_resource *resource);
@@ -2417,7 +2436,7 @@ DWORD __cdecl wined3d_volume_get_priority(const struct wined3d_volume *volume);
 struct wined3d_resource * __cdecl wined3d_volume_get_resource(struct wined3d_volume *volume);
 ULONG __cdecl wined3d_volume_incref(struct wined3d_volume *volume);
 HRESULT __cdecl wined3d_volume_map(struct wined3d_volume *volume,
-        struct wined3d_mapped_box *mapped_box, const struct wined3d_box *box, DWORD flags);
+        struct wined3d_map_desc *map_desc, const struct wined3d_box *box, DWORD flags);
 void __cdecl wined3d_volume_preload(struct wined3d_volume *volume);
 DWORD __cdecl wined3d_volume_set_priority(struct wined3d_volume *volume, DWORD new_priority);
 HRESULT __cdecl wined3d_volume_unmap(struct wined3d_volume *volume);