150 unsigned int wined3d_flags;
152 wined3d_flags =
flags & handled;
164 return wined3d_flags;
169 switch (primitive_type)
172 return primitive_count;
175 return primitive_count * 2;
178 return primitive_count + 1;
181 return primitive_count * 3;
185 return primitive_count + 2;
188 FIXME(
"Unhandled primitive type %#x.\n", primitive_type);
206 FIXME(
"Unhandled swap effect %#x.\n", effect);
243 FIXME(
"Unhandled swap effect %#x.\n", effect);
253 WARN(
"Invalid swap effect %u passed.\n", present_parameters->
SwapEffect);
278 swapchain_desc->
flags
372 ERR(
"Handle %u(%p) is in the free list, but has type %#x.\n",
index,
entry,
entry->type);
375 t->free_entries =
entry->object;
382 if (!(
t->entry_count <
t->table_size))
385 UINT new_size =
t->table_size + (
t->table_size >> 1);
388 if (!(new_entries =
heap_realloc(
t->entries, new_size *
sizeof(*
t->entries))))
390 ERR(
"Failed to grow the handle table.\n");
393 t->entries = new_entries;
394 t->table_size = new_size;
397 entry = &
t->entries[
t->entry_count];
401 return t->entry_count++;
422 object =
entry->object;
423 entry->object =
t->free_entries;
447 return entry->object;
452 TRACE(
"iface %p, riid %s, out %p.\n",
474 TRACE(
"%p increasing refcount to %u.\n", iface,
ref);
484 if (
device->inDestruction)
489 TRACE(
"%p decreasing refcount to %u.\n", iface,
ref);
496 TRACE(
"Releasing wined3d device %p.\n",
device->wined3d_device);
502 for (
i = 0;
i <
device->numConvertedDecls; ++
i)
508 if (
device->vertex_buffer)
530 TRACE(
"iface %p.\n", iface);
532 TRACE(
"device state: %#x.\n",
device->device_state);
534 switch (
device->device_state)
551 TRACE(
"iface %p.\n", iface);
564 TRACE(
"iface %p, byte_count %u.\n", iface, byte_count);
567 FIXME(
"Byte count ignored.\n");
580 TRACE(
"iface %p, d3d8 %p.\n", iface,
d3d8);
594 TRACE(
"iface %p, caps %p.\n", iface, caps);
614 TRACE(
"iface %p, mode %p.\n", iface,
mode);
636 TRACE(
"iface %p, parameters %p.\n", iface, parameters);
653 TRACE(
"iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
654 iface, hotspot_x, hotspot_y,
bitmap);
658 WARN(
"No cursor bitmap, returning D3DERR_INVALIDCALL.\n");
674 TRACE(
"iface %p, x %u, y %u, flags %#x.\n", iface,
x,
y,
flags);
686 TRACE(
"iface %p, show %#x.\n", iface, show);
704 TRACE(
"iface %p, present_parameters %p, swapchain %p.\n",
705 iface, present_parameters, swapchain);
709 WARN(
"Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.\n");
725 WARN(
"Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.\n");
734 *swapchain = &
object->IDirect3DSwapChain8_iface;
743 IDirect3DBaseTexture8 *
texture;
753 WARN(
"Resource %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n",
resource);
761 WARN(
"Texture %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n",
texture,
resource);
769 WARN(
"Surface %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface);
780 TRACE(
"iface %p, present_parameters %p.\n", iface, present_parameters);
784 WARN(
"App not active, returning D3DERR_DEVICELOST.\n");
792 if (
device->vertex_buffer)
796 device->vertex_buffer_size = 0;
802 device->index_buffer_size = 0;
824 const RECT *dst_rect,
HWND dst_window_override,
const RGNDATA *dirty_region)
828 TRACE(
"iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n",
837 src_rect, dst_rect, dst_window_override, dirty_region);
848 TRACE(
"iface %p, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
849 iface, backbuffer_idx, backbuffer_type, backbuffer);
877 TRACE(
"iface %p, raster_status %p.\n", iface, raster_status);
902 TRACE(
"iface %p, ramp %p.\n", iface,
ramp);
918 TRACE(
"iface %p, width %u, height %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
925 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
931 WARN(
"Failed to initialize texture, hr %#x.\n",
hr);
936 TRACE(
"Created texture %p.\n",
object);
937 *
texture = (IDirect3DTexture8 *)&
object->IDirect3DBaseTexture8_iface;
950 TRACE(
"iface %p, width %u, height %u, depth %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
957 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
963 WARN(
"Failed to initialize volume texture, hr %#x.\n",
hr);
968 TRACE(
"Created volume texture %p.\n",
object);
969 *
texture = (IDirect3DVolumeTexture8 *)&
object->IDirect3DBaseTexture8_iface;
981 TRACE(
"iface %p, edge_length %u, levels %u, usage %#x, format %#x, pool %#x, texture %p.\n",
988 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
994 WARN(
"Failed to initialize cube texture, hr %#x.\n",
hr);
999 TRACE(
"Created cube texture %p.\n",
object);
1000 *
texture = (IDirect3DCubeTexture8 *)&
object->IDirect3DBaseTexture8_iface;
1012 TRACE(
"iface %p, size %u, usage %#x, fvf %#x, pool %#x, buffer %p.\n",
1015 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1021 WARN(
"Failed to initialize vertex buffer, hr %#x.\n",
hr);
1026 TRACE(
"Created vertex buffer %p.\n",
object);
1027 *
buffer = &
object->IDirect3DVertexBuffer8_iface;
1039 TRACE(
"iface %p, size %u, usage %#x, format %#x, pool %#x, buffer %p.\n",
1042 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
1048 WARN(
"Failed to initialize index buffer, hr %#x.\n",
hr);
1053 TRACE(
"Created index buffer %p.\n",
object);
1054 *
buffer = &
object->IDirect3DIndexBuffer8_iface;
1068 TRACE(
"device %p, width %u, height %u, format %#x, flags %#x, surface %p, "
1069 "usage %#x, pool %#x, multisample_type %#x, multisample_quality %u.\n",
1071 usage,
pool, multisample_type, multisample_quality);
1075 desc.multisample_type = multisample_type;
1076 desc.multisample_quality = multisample_quality;
1093 WARN(
"Failed to create texture, hr %#x.\n",
hr);
1110 IDirect3DSurface8 **surface)
1115 TRACE(
"iface %p, width %u, height %u, format %#x, multisample_type %#x, lockable %#x, surface %p.\n",
1131 IDirect3DSurface8 **surface)
1135 TRACE(
"iface %p, width %u, height %u, format %#x, multisample_type %#x, surface %p.\n",
1154 TRACE(
"iface %p, width %u, height %u, format %#x, surface %p.\n",
1164 IDirect3DSurface8 *src_surface,
const RECT *src_rects,
UINT rect_count,
1165 IDirect3DSurface8 *dst_surface,
const POINT *dst_points)
1173 TRACE(
"iface %p, src_surface %p, src_rects %p, rect_count %u, dst_surface %p, dst_points %p.\n",
1174 iface, src_surface, src_rects, rect_count, dst_surface, dst_points);
1183 WARN(
"Source %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", src_surface);
1187 src_format = wined3d_desc.
format;
1188 src_w = wined3d_desc.
width;
1189 src_h = wined3d_desc.
height;
1194 WARN(
"Destination %p is a depth stencil surface, returning D3DERR_INVALIDCALL.\n", dst_surface);
1203 WARN(
"Source %p format must match the destination %p format, returning D3DERR_INVALIDCALL.\n",
1204 src_surface, dst_surface);
1210 if (!rect_count && !src_rects && !dst_points)
1220 if (src_rects && dst_points)
1222 for (
i = 0;
i < rect_count; ++
i)
1226 RECT dst_rect = {dst_points[
i].
x, dst_points[
i].
y,
1227 dst_points[
i].
x +
w, dst_points[
i].
y +
h};
1235 for (
i = 0;
i < rect_count; ++
i)
1239 RECT dst_rect = {0, 0,
w,
h};
1252 IDirect3DBaseTexture8 *src_texture, IDirect3DBaseTexture8 *dst_texture)
1258 TRACE(
"iface %p, src_texture %p, dst_texture %p.\n", iface, src_texture, dst_texture);
1277 TRACE(
"iface %p, dst_surface %p.\n", iface, dst_surface);
1281 WARN(
"Invalid destination surface passed.\n");
1294 IDirect3DSurface8 *render_target, IDirect3DSurface8 *depth_stencil)
1302 TRACE(
"iface %p, render_target %p, depth_stencil %p.\n", iface, render_target, depth_stencil);
1306 WARN(
"Render target surface does not match device.\n");
1338 WARN(
"Depth stencil is smaller than the render target, returning D3DERR_INVALIDCALL\n");
1345 WARN(
"Multisample settings do not match, returning D3DERR_INVALIDCALL\n");
1372 TRACE(
"iface %p, render_target %p.\n", iface, render_target);
1389 ERR(
"Failed to get wined3d render target.\n");
1390 *render_target =
NULL;
1405 TRACE(
"iface %p, depth_stencil %p.\n", iface, depth_stencil);
1422 *depth_stencil =
NULL;
1434 TRACE(
"iface %p.\n", iface);
1448 TRACE(
"iface %p.\n", iface);
1462 ((
color >> 16) & 0xff) / 255.0f,
1463 ((
color >> 8) & 0xff) / 255.0f,
1464 (
color & 0xff) / 255.0f,
1465 ((
color >> 24) & 0xff) / 255.0f,
1470 TRACE(
"iface %p, rect_count %u, rects %p, flags %#x, color 0x%08x, z %.8e, stencil %u.\n",
1473 if (rect_count && !rects)
1475 WARN(
"count %u with NULL rects.\n", rect_count);
1536 TRACE(
"iface %p, viewport %p.\n", iface, viewport);
1557 TRACE(
"iface %p, viewport %p.\n", iface, viewport);
1577 TRACE(
"iface %p, material %p.\n", iface, material);
1591 TRACE(
"iface %p, material %p.\n", iface, material);
1736 TRACE(
"iface %p.\n", iface);
1751 TRACE(
"iface %p, token %p.\n", iface,
token);
1760 WARN(
"Failed to end the state block, %#x.\n",
hr);
1770 ERR(
"Failed to create a handle\n");
1778 TRACE(
"Returning %#x (%p).\n", *
token, stateblock);
1788 TRACE(
"iface %p, token %#x.\n", iface,
token);
1797 WARN(
"Invalid handle (%#x) passed.\n",
token);
1812 TRACE(
"iface %p, token %#x.\n", iface,
token);
1818 WARN(
"Invalid handle (%#x) passed.\n",
token);
1833 TRACE(
"iface %p, token %#x.\n", iface,
token);
1840 WARN(
"Invalid handle (%#x) passed.\n",
token);
1847 ERR(
"Stateblock %p has references left, this shouldn't happen.\n", stateblock);
1867 WARN(
"Unexpected stateblock type, returning D3DERR_INVALIDCALL\n");
1876 ERR(
"Failed to create the state block, hr %#x\n",
hr);
1885 ERR(
"Failed to allocate a handle.\n");
1893 TRACE(
"Returning %#x (%p).\n", *
handle, stateblock);
1903 TRACE(
"iface %p, clip_status %p.\n", iface, clip_status);
1918 TRACE(
"iface %p, clip_status %p.\n", iface, clip_status);
1933 TRACE(
"iface %p, stage %u, texture %p.\n", iface, stage,
texture);
1960 TRACE(
"iface %p, stage %u, texture %p.\n", iface, stage,
texture);
2020 TRACE(
"iface %p, stage %u, state %#x, value %p.\n", iface, stage,
Type,
value);
2024 WARN(
"Invalid Type %#x passed.\n",
Type);
2031 if (
l->sampler_state)
2046 TRACE(
"iface %p, stage %u, state %#x, value %#x.\n", iface, stage,
type,
value);
2050 WARN(
"Invalid type %#x passed.\n",
type);
2057 if (
l->sampler_state)
2071 TRACE(
"iface %p, pass_count %p.\n", iface, pass_count);
2083 FIXME(
"iface %p, info_id %#x, info %p, info_size %u stub!\n", iface, info_id,
info, info_size);
2091 WARN(
"iface %p, palette_idx %u, entries %p unimplemented\n", iface, palette_idx, entries);
2102 FIXME(
"iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2109 WARN(
"iface %p, palette_idx %u unimplemented.\n", iface, palette_idx);
2116 FIXME(
"iface %p, palette_idx %p unimplemented.\n", iface, palette_idx);
2127 TRACE(
"iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
2128 iface, primitive_type, start_vertex, primitive_count);
2141 UINT start_idx,
UINT primitive_count)
2146 TRACE(
"iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, start_idx %u, primitive_count %u.\n",
2147 iface, primitive_type, min_vertex_idx,
vertex_count, start_idx, primitive_count);
2163 if (
device->vertex_buffer_size < min_size || !
device->vertex_buffer)
2169 TRACE(
"Growing vertex buffer to %u bytes\n",
size);
2175 desc.misc_flags = 0;
2176 desc.structure_byte_stride = 0;
2181 ERR(
"Failed to create vertex buffer, hr %#x.\n",
hr);
2185 if (
device->vertex_buffer)
2190 device->vertex_buffer_pos = 0;
2208 TRACE(
"iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
2209 iface, primitive_type, primitive_count,
data,
stride);
2211 if (!primitive_count)
2213 WARN(
"primitive_count is 0, returning D3D_OK\n");
2222 vb_pos =
device->vertex_buffer_pos;
2258 if (
device->index_buffer_size < min_size || !
device->index_buffer)
2264 TRACE(
"Growing index buffer to %u bytes\n",
size);
2270 desc.misc_flags = 0;
2271 desc.structure_byte_stride = 0;
2276 ERR(
"Failed to create index buffer, hr %#x.\n",
hr);
2280 if (
device->index_buffer)
2285 device->index_buffer_pos = 0;
2293 const void *vertex_data,
UINT vertex_stride)
2299 UINT idx_size = idx_count * idx_fmt_size;
2306 TRACE(
"iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
2307 "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
2308 iface, primitive_type, min_vertex_idx,
vertex_count, primitive_count,
2309 index_data, index_format, vertex_data, vertex_stride);
2311 if (!primitive_count)
2313 WARN(
"primitive_count is 0, returning D3D_OK\n");
2323 vb_pos =
device->vertex_buffer_pos;
2324 align = vb_pos % vertex_stride;
2326 if (vb_pos + vtx_size +
align >
device->vertex_buffer_size)
2339 device->vertex_buffer_pos = vb_pos + vtx_size;
2345 ib_pos =
device->index_buffer_pos;
2346 align = ib_pos % idx_fmt_size;
2348 if (ib_pos + idx_size +
align >
device->index_buffer_size)
2361 device->index_buffer_pos = ib_pos + idx_size;
2390 TRACE(
"iface %p, src_start_idx %u, dst_idx %u, vertex_count %u, dst_buffer %p, flags %#x.\n",
2406 DWORD shader_handle;
2410 TRACE(
"iface %p, declaration %p, byte_code %p, shader %p, usage %#x.\n",
2413 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
2424 ERR(
"Failed to allocate vertex shader handle.\n");
2435 WARN(
"Failed to initialize vertex shader, hr %#x.\n",
hr);
2444 TRACE(
"Created vertex shader %p (handle %#x).\n",
object, shader_handle);
2457 TRACE(
"Searching for declaration for fvf %08x... ",
fvf);
2460 high =
device->numConvertedDecls - 1;
2463 p = (low + high) >> 1;
2466 if (convertedDecls[
p].
fvf ==
fvf)
2472 if (convertedDecls[
p].
fvf <
fvf)
2477 TRACE(
"not found. Creating and inserting at position %d.\n", low);
2479 if (!(d3d8_declaration =
heap_alloc(
sizeof(*d3d8_declaration))))
2484 WARN(
"Failed to initialize vertex declaration, hr %#x.\n",
hr);
2489 if (
device->declArraySize ==
device->numConvertedDecls)
2494 sizeof(*convertedDecls) * (
device->numConvertedDecls + grow))))
2499 device->decls = convertedDecls;
2500 device->declArraySize += grow;
2503 memmove(convertedDecls + low + 1, convertedDecls + low,
2504 sizeof(*convertedDecls) * (
device->numConvertedDecls - low));
2505 convertedDecls[low].
declaration = d3d8_declaration;
2506 convertedDecls[low].
fvf =
fvf;
2507 ++
device->numConvertedDecls;
2509 TRACE(
"Returning %p. %u decls in array.\n", d3d8_declaration,
device->numConvertedDecls);
2511 return d3d8_declaration;
2534 TRACE(
"Setting shader\n");
2539 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2588 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2611 TRACE(
"iface %p, start_register %u, data %p, count %u.\n",
2616 WARN(
"Trying to access %u constants, but d3d8 only supports %u\n",
2634 TRACE(
"iface %p, start_register %u, data %p, count %u.\n",
2639 WARN(
"Trying to access %u constants, but d3d8 only supports %u\n",
2658 TRACE(
"iface %p, shader %#x, data %p, data_size %p.\n",
2667 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2681 if (*data_size < declaration->elements_size)
2696 TRACE(
"iface %p, shader %#x, data %p, data_size %p.\n",
2702 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2722 IDirect3DIndexBuffer8 *
buffer,
UINT base_vertex_idx)
2727 TRACE(
"iface %p, buffer %p, base_vertex_idx %u.\n", iface,
buffer, base_vertex_idx);
2745 IDirect3DIndexBuffer8 **
buffer,
UINT *base_vertex_index)
2752 TRACE(
"iface %p, buffer %p, base_vertex_index %p.\n", iface,
buffer, base_vertex_index);
2780 DWORD shader_handle;
2784 TRACE(
"iface %p, byte_code %p, shader %p.\n", iface, byte_code,
shader);
2789 if (!(
object = heap_alloc_zero(
sizeof(*
object))))
2797 ERR(
"Failed to allocate pixel shader handle.\n");
2807 WARN(
"Failed to initialize pixel shader, hr %#x.\n",
hr);
2816 TRACE(
"Created pixel shader %p (handle %#x).\n",
object, shader_handle);
2840 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2845 TRACE(
"Setting shader %p.\n", shader_impl);
2891 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2912 TRACE(
"iface %p, start_register %u, data %p, count %u.\n",
2928 TRACE(
"iface %p, start_register %u, data %p, count %u.\n",
2945 TRACE(
"iface %p, shader %#x, data %p, data_size %p.\n",
2951 WARN(
"Invalid handle (%#x) passed.\n",
shader);
2966 FIXME(
"iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
2967 iface,
handle, segment_count, patch_info);
2974 FIXME(
"iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
2975 iface,
handle, segment_count, patch_info);
2981 FIXME(
"iface %p, handle %#x unimplemented.\n", iface,
handle);
2992 TRACE(
"iface %p, stream_idx %u, buffer %p, stride %u.\n",
3011 TRACE(
"iface %p, stream_idx %u, buffer %p, stride %p.\n",
3028 ERR(
"Failed to get wined3d stream source, hr %#x.\n",
hr);
3171 TRACE(
"device_parent %p, wined3d_texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
3174 if (!(d3d_surface = heap_alloc_zero(
sizeof(*d3d_surface))))
3179 TRACE(
"Created surface %p.\n", d3d_surface);
3190 TRACE(
"device_parent %p, texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
3193 if (!(d3d_volume = heap_alloc_zero(
sizeof(*d3d_volume))))
3198 TRACE(
"Created volume %p.\n", d3d_volume);
3211 TRACE(
"device_parent %p, container_parent %p, desc %p, texture flags %#x, texture %p.\n",
3212 device_parent, container_parent,
desc, texture_flags,
texture);
3218 WARN(
"Failed to create texture, hr %#x.\n",
hr);
3235 TRACE(
"device_parent %p, desc %p, swapchain %p.\n", device_parent,
desc, swapchain);
3239 WARN(
"Failed to create swapchain, hr %#x.\n",
hr);
3264#if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
3266 __asm__ volatile (
"fnstcw %0" :
"=m" (cw));
3267 cw = (cw & ~0xf3f) | 0x3f;
3268 __asm__ volatile (
"fldcw %0" : :
"m" (cw));
3269#elif defined(__i386__) && defined(_MSC_VER)
3272 cw = (cw & ~0xf3f) | 0x3f;
3275 FIXME(
"FPU setup not implemented for this platform.\n");
3290 *
sizeof(*
device->handle_table.entries))))
3292 ERR(
"Failed to allocate handle table memory.\n");
3304 WARN(
"Failed to create wined3d device, hr %#x.\n",
hr);
3318 ERR(
"Failed to acquire focus window, hr %#x.\n",
hr);
3346 WARN(
"Failed to initialize 3D, hr %#x.\n",
hr);
3361 device->declArraySize = 16;
3364 ERR(
"Failed to allocate FVF vertex declaration map memory.\n");
#define DECLSPEC_HOTPATCH
static void * heap_alloc(size_t len)
static BOOL heap_free(void *mem)
static void * heap_realloc(void *mem, size_t len)
#define InterlockedIncrement
#define InterlockedDecrement
static const char * wine_dbgstr_rect(const RECT *prc)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
#define STDMETHODCALLTYPE
struct d3d8_texture * unsafe_impl_from_IDirect3DBaseTexture8(IDirect3DBaseTexture8 *iface) DECLSPEC_HIDDEN
@ D3D8_DEVICE_STATE_NOT_RESET
#define VS_HIGHESTFIXEDFXF
#define D3D8_INVALID_HANDLE
HRESULT d3d8_swapchain_create(struct d3d8_device *device, struct wined3d_swapchain_desc *desc, struct d3d8_swapchain **swapchain) DECLSPEC_HIDDEN
struct d3d8_surface * unsafe_impl_from_IDirect3DSurface8(IDirect3DSurface8 *iface) DECLSPEC_HIDDEN
HRESULT volumetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
HRESULT d3d8_pixel_shader_init(struct d3d8_pixel_shader *shader, struct d3d8_device *device, const DWORD *byte_code, DWORD shader_handle) DECLSPEC_HIDDEN
#define D3D8_INITIAL_HANDLE_TABLE_SIZE
void surface_init(struct d3d8_surface *surface, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN
struct d3d8_device * d3d8_surface_get_device(const struct d3d8_surface *surface) DECLSPEC_HIDDEN
HRESULT d3d8_vertex_shader_init(struct d3d8_vertex_shader *shader, struct d3d8_device *device, const DWORD *declaration, const DWORD *byte_code, DWORD shader_handle, DWORD usage) DECLSPEC_HIDDEN
#define D3DPRESENTFLAGS_MASK
void d3d8_vertex_shader_destroy(struct d3d8_vertex_shader *shader) DECLSPEC_HIDDEN
void d3d8_surface_release_rendertarget_view(struct d3d8_surface *surface, struct wined3d_rendertarget_view *rtv) DECLSPEC_HIDDEN
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF
HRESULT d3d8_vertex_declaration_init_fvf(struct d3d8_vertex_declaration *declaration, struct d3d8_device *device, DWORD fvf) DECLSPEC_HIDDEN
HRESULT cubetexture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
static struct d3d8_device * impl_from_IDirect3DDevice8(IDirect3DDevice8 *iface)
HRESULT texture_init(struct d3d8_texture *texture, struct d3d8_device *device, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool) DECLSPEC_HIDDEN
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
void d3d8_vertex_declaration_destroy(struct d3d8_vertex_declaration *declaration) DECLSPEC_HIDDEN
void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops) DECLSPEC_HIDDEN
void d3d8_pixel_shader_destroy(struct d3d8_pixel_shader *shader) DECLSPEC_HIDDEN
struct wined3d_rendertarget_view * d3d8_surface_acquire_rendertarget_view(struct d3d8_surface *surface) DECLSPEC_HIDDEN
enum _D3DTEXTURESTAGESTATETYPE D3DTEXTURESTAGESTATETYPE
enum _D3DBACKBUFFER_TYPE D3DBACKBUFFER_TYPE
#define D3DPS_VERSION(major, minor)
enum _D3DDEVTYPE D3DDEVTYPE
enum _D3DSWAPEFFECT D3DSWAPEFFECT
#define D3DLOCK_NO_DIRTY_UPDATE
@ D3DSWAPEFFECT_COPY_VSYNC
#define D3DLOCK_NOOVERWRITE
enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE
#define D3DLOCK_NOSYSLOCK
#define D3DVS_VERSION(major, minor)
#define D3DUSAGE_RENDERTARGET
enum _D3DFORMAT D3DFORMAT
#define D3DUSAGE_DEPTHSTENCIL
enum _D3DMULTISAMPLE_TYPE D3DMULTISAMPLE_TYPE
enum _D3DSTATEBLOCKTYPE D3DSTATEBLOCKTYPE
#define D3DERR_INVALIDCALL
struct d3d8_indexbuffer * unsafe_impl_from_IDirect3DIndexBuffer8(IDirect3DIndexBuffer8 *iface)
struct d3d8_vertexbuffer * unsafe_impl_from_IDirect3DVertexBuffer8(IDirect3DVertexBuffer8 *iface)
HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
static D3DSWAPEFFECT d3dswapeffect_from_wined3dswapeffect(enum wined3d_swap_effect effect)
static HRESULT WINAPI d3d8_device_SetStreamSource(IDirect3DDevice8 *iface, UINT stream_idx, IDirect3DVertexBuffer8 *buffer, UINT stride)
static HRESULT WINAPI d3d8_device_BeginScene(IDirect3DDevice8 *iface)
static HRESULT WINAPI d3d8_device_GetClipPlane(IDirect3DDevice8 *iface, DWORD index, float *plane)
static HRESULT WINAPI d3d8_device_SetPixelShader(IDirect3DDevice8 *iface, DWORD shader)
static HRESULT WINAPI d3d8_device_Clear(IDirect3DDevice8 *iface, DWORD rect_count, const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil)
static HRESULT WINAPI d3d8_device_DrawRectPatch(IDirect3DDevice8 *iface, UINT handle, const float *segment_count, const D3DRECTPATCH_INFO *patch_info)
static HRESULT WINAPI d3d8_device_SetVertexShaderConstant(IDirect3DDevice8 *iface, DWORD start_register, const void *data, DWORD count)
static HRESULT d3d8_device_create_surface(struct d3d8_device *device, UINT width, UINT height, D3DFORMAT format, DWORD flags, IDirect3DSurface8 **surface, UINT usage, D3DPOOL pool, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality)
static HRESULT WINAPI d3d8_device_SetPaletteEntries(IDirect3DDevice8 *iface, UINT palette_idx, const PALETTEENTRY *entries)
static HRESULT WINAPI d3d8_device_LightEnable(IDirect3DDevice8 *iface, DWORD index, BOOL enable)
static HRESULT WINAPI d3d8_device_DrawIndexedPrimitiveUP(IDirect3DDevice8 *iface, D3DPRIMITIVETYPE primitive_type, UINT min_vertex_idx, UINT vertex_count, UINT primitive_count, const void *index_data, D3DFORMAT index_format, const void *vertex_data, UINT vertex_stride)
static HRESULT WINAPI d3d8_device_CopyRects(IDirect3DDevice8 *iface, IDirect3DSurface8 *src_surface, const RECT *src_rects, UINT rect_count, IDirect3DSurface8 *dst_surface, const POINT *dst_points)
static void STDMETHODCALLTYPE d3d8_null_wined3d_object_destroyed(void *parent)
static HRESULT WINAPI d3d8_device_SetCursorProperties(IDirect3DDevice8 *iface, UINT hotspot_x, UINT hotspot_y, IDirect3DSurface8 *bitmap)
static void CDECL device_parent_mode_changed(struct wined3d_device_parent *device_parent)
static struct d3d8_device * device_from_device_parent(struct wined3d_device_parent *device_parent)
static HRESULT WINAPI d3d8_device_CreateTexture(IDirect3DDevice8 *iface, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture8 **texture)
static HRESULT WINAPI d3d8_device_TestCooperativeLevel(IDirect3DDevice8 *iface)
static HRESULT WINAPI d3d8_device_SetClipPlane(IDirect3DDevice8 *iface, DWORD index, const float *plane)
static HRESULT WINAPI d3d8_device_GetFrontBuffer(IDirect3DDevice8 *iface, IDirect3DSurface8 *dst_surface)
static HRESULT WINAPI d3d8_device_DeletePixelShader(IDirect3DDevice8 *iface, DWORD shader)
static HRESULT WINAPI d3d8_device_GetRenderTarget(IDirect3DDevice8 *iface, IDirect3DSurface8 **render_target)
static HRESULT WINAPI d3d8_device_GetDeviceCaps(IDirect3DDevice8 *iface, D3DCAPS8 *caps)
static BOOL WINAPI d3d8_device_ShowCursor(IDirect3DDevice8 *iface, BOOL show)
static HRESULT WINAPI d3d8_device_GetPaletteEntries(IDirect3DDevice8 *iface, UINT palette_idx, PALETTEENTRY *entries)
static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource)
static ULONG WINAPI d3d8_device_AddRef(IDirect3DDevice8 *iface)
static HRESULT WINAPI d3d8_device_CreateStateBlock(IDirect3DDevice8 *iface, D3DSTATEBLOCKTYPE type, DWORD *handle)
static HRESULT WINAPI d3d8_device_UpdateTexture(IDirect3DDevice8 *iface, IDirect3DBaseTexture8 *src_texture, IDirect3DBaseTexture8 *dst_texture)
static HRESULT WINAPI d3d8_device_ApplyStateBlock(IDirect3DDevice8 *iface, DWORD token)
static HRESULT d3d8_device_prepare_index_buffer(struct d3d8_device *device, UINT min_size)
static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc)
static HRESULT WINAPI d3d8_device_SetMaterial(IDirect3DDevice8 *iface, const D3DMATERIAL8 *material)
static HRESULT WINAPI d3d8_device_GetMaterial(IDirect3DDevice8 *iface, D3DMATERIAL8 *material)
static HRESULT WINAPI d3d8_device_SetClipStatus(IDirect3DDevice8 *iface, const D3DCLIPSTATUS8 *clip_status)
static void * d3d8_get_object(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
static UINT WINAPI d3d8_device_GetAvailableTextureMem(IDirect3DDevice8 *iface)
static HRESULT WINAPI d3d8_device_CreateImageSurface(IDirect3DDevice8 *iface, UINT width, UINT height, D3DFORMAT format, IDirect3DSurface8 **surface)
static const struct wined3d_device_parent_ops d3d8_wined3d_device_parent_ops
static HRESULT WINAPI d3d8_device_SetPixelShaderConstant(IDirect3DDevice8 *iface, DWORD start_register, const void *data, DWORD count)
static HRESULT WINAPI d3d8_device_SetViewport(IDirect3DDevice8 *iface, const D3DVIEWPORT8 *viewport)
static HRESULT WINAPI d3d8_device_Present(IDirect3DDevice8 *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region)
static HRESULT WINAPI d3d8_device_CreateIndexBuffer(IDirect3DDevice8 *iface, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer8 **buffer)
static DWORD d3d8_allocate_handle(struct d3d8_handle_table *t, void *object, enum d3d8_handle_type type)
static HRESULT WINAPI d3d8_device_CreateDepthStencilSurface(IDirect3DDevice8 *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, IDirect3DSurface8 **surface)
static const struct IDirect3DDevice8Vtbl d3d8_device_vtbl
static BOOL wined3d_swapchain_desc_from_present_parameters(struct wined3d_swapchain_desc *swapchain_desc, const D3DPRESENT_PARAMETERS *present_parameters)
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
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)
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
static HRESULT WINAPI d3d8_device_MultiplyTransform(IDirect3DDevice8 *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
static HRESULT WINAPI d3d8_device_GetCreationParameters(IDirect3DDevice8 *iface, D3DDEVICE_CREATION_PARAMETERS *parameters)
static HRESULT WINAPI d3d8_device_GetVertexShaderFunction(IDirect3DDevice8 *iface, DWORD shader, void *data, DWORD *data_size)
static HRESULT WINAPI d3d8_device_ResourceManagerDiscardBytes(IDirect3DDevice8 *iface, DWORD byte_count)
static HRESULT WINAPI d3d8_device_ProcessVertices(IDirect3DDevice8 *iface, UINT src_start_idx, UINT dst_idx, UINT vertex_count, IDirect3DVertexBuffer8 *dst_buffer, DWORD flags)
static HRESULT WINAPI d3d8_device_GetPixelShader(IDirect3DDevice8 *iface, DWORD *shader)
static HRESULT WINAPI d3d8_device_SetCurrentTexturePalette(IDirect3DDevice8 *iface, UINT palette_idx)
static HRESULT WINAPI d3d8_device_GetDisplayMode(IDirect3DDevice8 *iface, D3DDISPLAYMODE *mode)
static HRESULT d3d8_device_prepare_vertex_buffer(struct d3d8_device *device, UINT min_size)
static HRESULT WINAPI d3d8_device_SetIndices(IDirect3DDevice8 *iface, IDirect3DIndexBuffer8 *buffer, UINT base_vertex_idx)
static HRESULT WINAPI d3d8_device_CreatePixelShader(IDirect3DDevice8 *iface, const DWORD *byte_code, DWORD *shader)
static HRESULT WINAPI d3d8_device_GetLightEnable(IDirect3DDevice8 *iface, DWORD index, BOOL *enable)
static HRESULT WINAPI d3d8_device_EndStateBlock(IDirect3DDevice8 *iface, DWORD *token)
static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate)
static HRESULT WINAPI d3d8_device_Reset(IDirect3DDevice8 *iface, D3DPRESENT_PARAMETERS *present_parameters)
static HRESULT WINAPI d3d8_device_CreateCubeTexture(IDirect3DDevice8 *iface, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture8 **texture)
static HRESULT WINAPI d3d8_device_GetPixelShaderFunction(IDirect3DDevice8 *iface, DWORD shader, void *data, DWORD *data_size)
static HRESULT WINAPI d3d8_device_GetDirect3D(IDirect3DDevice8 *iface, IDirect3D8 **d3d8)
static HRESULT WINAPI d3d8_device_GetLight(IDirect3DDevice8 *iface, DWORD index, D3DLIGHT8 *light)
static void * d3d8_free_handle(struct d3d8_handle_table *t, DWORD handle, enum d3d8_handle_type type)
static HRESULT WINAPI d3d8_device_GetTextureStageState(IDirect3DDevice8 *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE Type, DWORD *value)
static struct d3d8_vertex_declaration * d3d8_device_get_fvf_declaration(struct d3d8_device *device, DWORD fvf)
static HRESULT CDECL device_parent_surface_created(struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
static HRESULT WINAPI d3d8_device_GetClipStatus(IDirect3DDevice8 *iface, D3DCLIPSTATUS8 *clip_status)
static HRESULT WINAPI d3d8_device_SetRenderState(IDirect3DDevice8 *iface, D3DRENDERSTATETYPE state, DWORD value)
static HRESULT WINAPI d3d8_device_DrawPrimitive(IDirect3DDevice8 *iface, D3DPRIMITIVETYPE primitive_type, UINT start_vertex, UINT primitive_count)
static HRESULT WINAPI d3d8_device_GetTexture(IDirect3DDevice8 *iface, DWORD stage, IDirect3DBaseTexture8 **texture)
static HRESULT WINAPI d3d8_device_QueryInterface(IDirect3DDevice8 *iface, REFIID riid, void **out)
static HRESULT WINAPI d3d8_device_GetRasterStatus(IDirect3DDevice8 *iface, D3DRASTER_STATUS *raster_status)
static HRESULT WINAPI d3d8_device_CreateVolumeTexture(IDirect3DDevice8 *iface, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture8 **texture)
static HRESULT WINAPI d3d8_device_GetPixelShaderConstant(IDirect3DDevice8 *iface, DWORD start_register, void *data, DWORD count)
static HRESULT WINAPI d3d8_device_GetStreamSource(IDirect3DDevice8 *iface, UINT stream_idx, IDirect3DVertexBuffer8 **buffer, UINT *stride)
static HRESULT CDECL device_parent_volume_created(struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
static HRESULT WINAPI d3d8_device_GetVertexShaderDeclaration(IDirect3DDevice8 *iface, DWORD shader, void *data, DWORD *data_size)
static void setup_fpu(void)
static HRESULT WINAPI d3d8_device_DeleteStateBlock(IDirect3DDevice8 *iface, DWORD token)
static HRESULT WINAPI d3d8_device_GetTransform(IDirect3DDevice8 *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
static HRESULT WINAPI d3d8_device_DeletePatch(IDirect3DDevice8 *iface, UINT handle)
static HRESULT WINAPI d3d8_device_GetInfo(IDirect3DDevice8 *iface, DWORD info_id, void *info, DWORD info_size)
static HRESULT WINAPI d3d8_device_GetViewport(IDirect3DDevice8 *iface, D3DVIEWPORT8 *viewport)
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags)
static HRESULT WINAPI d3d8_device_GetRenderState(IDirect3DDevice8 *iface, D3DRENDERSTATETYPE state, DWORD *value)
static HRESULT WINAPI d3d8_device_SetVertexShader(IDirect3DDevice8 *iface, DWORD shader)
static HRESULT WINAPI d3d8_device_GetDepthStencilSurface(IDirect3DDevice8 *iface, IDirect3DSurface8 **depth_stencil)
static HRESULT WINAPI d3d8_device_BeginStateBlock(IDirect3DDevice8 *iface)
static void WINAPI d3d8_device_SetGammaRamp(IDirect3DDevice8 *iface, DWORD flags, const D3DGAMMARAMP *ramp)
static HRESULT WINAPI d3d8_device_DeleteVertexShader(IDirect3DDevice8 *iface, DWORD shader)
static HRESULT WINAPI d3d8_device_CreateVertexShader(IDirect3DDevice8 *iface, const DWORD *declaration, const DWORD *byte_code, DWORD *shader, DWORD usage)
static HRESULT WINAPI d3d8_device_GetVertexShader(IDirect3DDevice8 *iface, DWORD *shader)
static HRESULT CDECL device_parent_create_swapchain(struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
static const struct wined3d_parent_ops d3d8_null_wined3d_parent_ops
static HRESULT WINAPI d3d8_device_GetVertexShaderConstant(IDirect3DDevice8 *iface, DWORD start_register, void *data, DWORD count)
static HRESULT WINAPI d3d8_device_GetIndices(IDirect3DDevice8 *iface, IDirect3DIndexBuffer8 **buffer, UINT *base_vertex_index)
static HRESULT CDECL device_parent_create_swapchain_texture(struct wined3d_device_parent *device_parent, void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture)
static HRESULT WINAPI d3d8_device_CreateVertexBuffer(IDirect3DDevice8 *iface, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer8 **buffer)
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d8_device_EndScene(IDirect3DDevice8 *iface)
static HRESULT WINAPI d3d8_device_SetLight(IDirect3DDevice8 *iface, DWORD index, const D3DLIGHT8 *light)
static HRESULT WINAPI d3d8_device_SetTexture(IDirect3DDevice8 *iface, DWORD stage, IDirect3DBaseTexture8 *texture)