ReactOS 0.4.17-dev-966-gf06eace
device.c
Go to the documentation of this file.
1/*
2 * IDirect3DDevice9 implementation
3 *
4 * Copyright 2002-2005 Jason Edmeades
5 * Copyright 2002-2005 Raphael Junqueira
6 * Copyright 2005 Oliver Stieber
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 */
22
23#include "d3d9_private.h"
24
26
28
30{
32};
33
34static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_colour, D3DCOLOR d3d_colour)
35{
36 wined3d_colour->r = ((d3d_colour >> 16) & 0xff) / 255.0f;
37 wined3d_colour->g = ((d3d_colour >> 8) & 0xff) / 255.0f;
38 wined3d_colour->b = (d3d_colour & 0xff) / 255.0f;
39 wined3d_colour->a = ((d3d_colour >> 24) & 0xff) / 255.0f;
40}
41
43{
44 BYTE *c = (BYTE *)&format;
45
46 /* Don't translate FOURCC formats */
47 if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3]))
48 return (D3DFORMAT)format;
49
50 switch(format)
51 {
61 case WINED3DFMT_A8_UNORM: return D3DFMT_A8;
71 case WINED3DFMT_P8_UINT: return D3DFMT_P8;
72 case WINED3DFMT_L8_UNORM: return D3DFMT_L8;
101 default:
102 FIXME("Unhandled wined3d format %#x.\n", format);
103 return D3DFMT_UNKNOWN;
104 }
105}
106
108{
109 BYTE *c = (BYTE *)&format;
110
111 /* Don't translate FOURCC formats */
112 if (isprint(c[0]) && isprint(c[1]) && isprint(c[2]) && isprint(c[3]))
113 return (enum wined3d_format_id)format;
114
115 switch(format)
116 {
126 case D3DFMT_A8: return WINED3DFMT_A8_UNORM;
136 case D3DFMT_P8: return WINED3DFMT_P8_UINT;
137 case D3DFMT_L8: return WINED3DFMT_L8_UNORM;
147 case D3DFMT_D32: return WINED3DFMT_D32_UNORM;
152 case D3DFMT_D16: return WINED3DFMT_D16_UNORM;
153 case D3DFMT_L16: return WINED3DFMT_L16_UNORM;
166 default:
167 FIXME("Unhandled D3DFORMAT %#x.\n", format);
168 return WINED3DFMT_UNKNOWN;
169 }
170}
171
172unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags, unsigned int usage)
173{
174 static const unsigned int handled = D3DLOCK_NOSYSLOCK
179 unsigned int wined3d_flags;
180
181 wined3d_flags = flags & handled;
183 wined3d_flags |= WINED3D_MAP_READ;
184 if (!(flags & D3DLOCK_READONLY))
185 wined3d_flags |= WINED3D_MAP_WRITE;
186 if (!(wined3d_flags & (WINED3D_MAP_READ | WINED3D_MAP_WRITE)))
187 wined3d_flags |= WINED3D_MAP_WRITE;
188 flags &= ~(handled | D3DLOCK_READONLY);
189
190 if (flags)
191 FIXME("Unhandled flags %#x.\n", flags);
192
193 return wined3d_flags;
194}
195
196static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
197{
198 switch (primitive_type)
199 {
200 case D3DPT_POINTLIST:
201 return primitive_count;
202
203 case D3DPT_LINELIST:
204 return primitive_count * 2;
205
206 case D3DPT_LINESTRIP:
207 return primitive_count + 1;
208
210 return primitive_count * 3;
211
214 return primitive_count + 2;
215
216 default:
217 FIXME("Unhandled primitive type %#x.\n", primitive_type);
218 return 0;
219 }
220}
221
223{
224 switch (effect)
225 {
229 return D3DSWAPEFFECT_FLIP;
231 return D3DSWAPEFFECT_COPY;
236 default:
237 FIXME("Unhandled swap effect %#x.\n", effect);
238 return D3DSWAPEFFECT_FLIP;
239 }
240}
241
243 const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval)
244{
245 present_parameters->BackBufferWidth = swapchain_desc->backbuffer_width;
246 present_parameters->BackBufferHeight = swapchain_desc->backbuffer_height;
247 present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc->backbuffer_format);
248 present_parameters->BackBufferCount = swapchain_desc->backbuffer_count;
249 present_parameters->MultiSampleType = d3dmultisample_type_from_wined3d(swapchain_desc->multisample_type);
250 present_parameters->MultiSampleQuality = swapchain_desc->multisample_quality;
251 present_parameters->SwapEffect = d3dswapeffect_from_wined3dswapeffect(swapchain_desc->swap_effect);
252 present_parameters->hDeviceWindow = swapchain_desc->device_window;
253 present_parameters->Windowed = swapchain_desc->windowed;
254 present_parameters->EnableAutoDepthStencil = swapchain_desc->enable_auto_depth_stencil;
255 present_parameters->AutoDepthStencilFormat
257 present_parameters->Flags = swapchain_desc->flags & D3DPRESENTFLAGS_MASK;
258 present_parameters->FullScreen_RefreshRateInHz = swapchain_desc->refresh_rate;
259 present_parameters->PresentationInterval = presentation_interval;
260}
261
263{
264 switch (effect)
265 {
276 default:
277 FIXME("Unhandled swap effect %#x.\n", effect);
279 }
280}
281
283{
284 switch (interval)
285 {
296 default:
297 FIXME("Unhandled presentation interval %#lx.\n", interval);
300 }
301}
302
304 struct wined3d_output *output, const D3DPRESENT_PARAMETERS *present_parameters,
305 BOOL extended)
306{
307 D3DSWAPEFFECT highest_swapeffect = extended ? D3DSWAPEFFECT_FLIPEX : D3DSWAPEFFECT_COPY;
308 UINT highest_bb_count = extended ? 30 : 3;
309
310 if (!present_parameters->SwapEffect || present_parameters->SwapEffect > highest_swapeffect)
311 {
312 WARN("Invalid swap effect %u passed.\n", present_parameters->SwapEffect);
313 return FALSE;
314 }
315 if (present_parameters->BackBufferCount > highest_bb_count
316 || (present_parameters->SwapEffect == D3DSWAPEFFECT_COPY
317 && present_parameters->BackBufferCount > 1))
318 {
319 WARN("Invalid backbuffer count %u.\n", present_parameters->BackBufferCount);
320 return FALSE;
321 }
322 switch (present_parameters->PresentationInterval)
323 {
330 break;
331 default:
332 WARN("Invalid presentation interval %#x.\n", present_parameters->PresentationInterval);
333 return FALSE;
334 }
335
336 swapchain_desc->output = output;
337 swapchain_desc->backbuffer_width = present_parameters->BackBufferWidth;
338 swapchain_desc->backbuffer_height = present_parameters->BackBufferHeight;
339 swapchain_desc->backbuffer_format = wined3dformat_from_d3dformat(present_parameters->BackBufferFormat);
340 swapchain_desc->backbuffer_count = max(1, present_parameters->BackBufferCount);
342 swapchain_desc->multisample_type = wined3d_multisample_type_from_d3d(present_parameters->MultiSampleType);
343 swapchain_desc->multisample_quality = present_parameters->MultiSampleQuality;
344 swapchain_desc->swap_effect = wined3dswapeffect_from_d3dswapeffect(present_parameters->SwapEffect);
345 swapchain_desc->device_window = present_parameters->hDeviceWindow;
346 swapchain_desc->windowed = present_parameters->Windowed;
347 swapchain_desc->enable_auto_depth_stencil = present_parameters->EnableAutoDepthStencil;
348 swapchain_desc->auto_depth_stencil_format
350 swapchain_desc->flags
352 if (extended)
354 if ((present_parameters->Flags & D3DPRESENTFLAG_LOCKABLE_BACKBUFFER)
356 /* WINED3DFMT_UNKNOWN creates the swapchain with the current
357 * display format, which is always GDI-compatible. */
358 || swapchain_desc->backbuffer_format == WINED3DFMT_UNKNOWN))
359 swapchain_desc->flags |= WINED3D_SWAPCHAIN_GDI_COMPATIBLE;
360 swapchain_desc->refresh_rate = present_parameters->FullScreen_RefreshRateInHz;
361 swapchain_desc->auto_restore_display_mode = TRUE;
362
363 if (present_parameters->Flags & ~D3DPRESENTFLAGS_MASK)
364 FIXME("Unhandled flags %#lx.\n", present_parameters->Flags & ~D3DPRESENTFLAGS_MASK);
365
366 return TRUE;
367}
368
369void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_ordinal,
370 D3DCAPS9 *caps, const struct wined3d_caps *wined3d_caps)
371{
372 static const DWORD ps_minor_version[] = {0, 4, 0, 0};
373 static const DWORD vs_minor_version[] = {0, 1, 0, 0};
374 static const DWORD texture_filter_caps =
381 struct wined3d_output_desc output_desc;
383 unsigned int output_idx;
384 HRESULT hr;
385
387 caps->AdapterOrdinal = adapter_ordinal;
388 caps->Caps = wined3d_caps->Caps;
389 caps->Caps2 = wined3d_caps->Caps2;
390 caps->Caps3 = wined3d_caps->Caps3;
444 caps->VS20Caps.Caps = wined3d_caps->VS20Caps.caps;
445 caps->VS20Caps.DynamicFlowControlDepth = wined3d_caps->VS20Caps.dynamic_flow_control_depth;
446 caps->VS20Caps.NumTemps = wined3d_caps->VS20Caps.temp_count;
447 caps->VS20Caps.StaticFlowControlDepth = wined3d_caps->VS20Caps.static_flow_control_depth;
448 caps->PS20Caps.Caps = wined3d_caps->PS20Caps.caps;
449 caps->PS20Caps.DynamicFlowControlDepth = wined3d_caps->PS20Caps.dynamic_flow_control_depth;
450 caps->PS20Caps.NumTemps = wined3d_caps->PS20Caps.temp_count;
451 caps->PS20Caps.StaticFlowControlDepth = wined3d_caps->PS20Caps.static_flow_control_depth;
452 caps->PS20Caps.NumInstructionSlots = wined3d_caps->PS20Caps.instruction_slot_count;
458
459 /* Some functionality is implemented in d3d9.dll, not wined3d.dll. Add the needed caps. */
461
462 /* Filter wined3d caps. */
463 caps->TextureFilterCaps &= texture_filter_caps;
464 caps->CubeTextureFilterCaps &= texture_filter_caps;
465 caps->VolumeTextureFilterCaps &= texture_filter_caps;
466
467 caps->DevCaps &=
475
476 caps->ShadeCaps &=
479
480 caps->RasterCaps &=
487
488 caps->DevCaps2 &=
492
493 caps->Caps2 &=
496
497 caps->VertexProcessingCaps &=
501
502 caps->TextureCaps &=
509
512
513 if (caps->PixelShaderVersion > 3)
514 {
515 caps->PixelShaderVersion = D3DPS_VERSION(3, 0);
516 }
517 else
518 {
520 caps->PixelShaderVersion = D3DPS_VERSION(major, ps_minor_version[major]);
521 }
522
523 if (caps->VertexShaderVersion > 3)
524 {
526 }
527 else
528 {
530 caps->VertexShaderVersion = D3DVS_VERSION(major, vs_minor_version[major]);
531 }
532
533 /* Get adapter group information */
534 output_idx = adapter_ordinal;
535 wined3d_output = d3d9->wined3d_outputs[output_idx];
536
540
541 if (FAILED(hr))
542 {
543 ERR("Failed to get output desc, hr %#lx.\n", hr);
544 return;
545 }
546
547 caps->MasterAdapterOrdinal = output_idx - output_desc.ordinal;
548 caps->AdapterOrdinalInGroup = output_desc.ordinal;
549 if (!caps->AdapterOrdinalInGroup)
550 {
553 }
554 else
555 {
556 caps->NumberOfAdaptersInGroup = 0;
557 }
558}
559
561{
563}
564
566{
567 return (enum wined3d_transform_state)type;
568}
569
571{
572 return (enum wined3d_render_state)type;
573}
574
576{
577 return (enum wined3d_sampler_state)type;
578}
579
581{
582 return (enum wined3d_primitive_type)type;
583}
584
586{
587 struct wined3d_viewport vp;
588 RECT rect;
589
590 wined3d_device_context_get_viewports(device->immediate_context, NULL, &vp);
594}
595
597{
599}
600
602{
604 return IDirect3DDevice9Ex_QueryInterface(&device->IDirect3DDevice9Ex_iface, iid, out);
605}
606
608{
610 return IDirect3DDevice9Ex_AddRef(&device->IDirect3DDevice9Ex_iface);
611}
612
614{
616 return IDirect3DDevice9Ex_Release(&device->IDirect3DDevice9Ex_iface);
617}
618
620{
621 FIXME("iface %p, iid %s, out %p stub!\n", iface, debugstr_guid(iid), out);
622
623 if (!out)
624 return E_INVALIDARG;
625
626 *out = NULL;
627 return E_NOINTERFACE;
628}
629
630static HRESULT WINAPI d3d9on12_UnwrapUnderlyingResource(IDirect3DDevice9On12 *iface, IDirect3DResource9 *resource, ID3D12CommandQueue *queue, REFIID iid, void **out)
631{
632 FIXME("iface %p, resource %p, queue %p, iid %s, out %p stub!\n", iface, resource, queue, debugstr_guid(iid), out);
633 return E_NOTIMPL;
634}
635
636static HRESULT WINAPI d3d9on12_ReturnUnderlyingResource(IDirect3DDevice9On12 *iface, IDirect3DResource9 *resource, UINT fence_count, UINT64 *signal_values, ID3D12Fence **fences)
637{
638 FIXME("iface %p, resource %p, fence_count %#x, signal_values %p, fences %p stub!\n", iface, resource, fence_count, signal_values, fences);
639 return E_NOTIMPL;
640}
641
642static const struct IDirect3DDevice9On12Vtbl d3d9on12_vtbl =
643{
644 /* IUnknown */
648 /* IDirect3DDevice9On12 */
652};
653
655{
656 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
657
658 if (IsEqualGUID(riid, &IID_IDirect3DDevice9)
660 {
662 *out = iface;
663 return S_OK;
664 }
665
666 if (IsEqualGUID(riid, &IID_IDirect3DDevice9Ex))
667 {
669
670 /* Find out if the creating d3d9 interface was created with Direct3DCreate9Ex.
671 * It doesn't matter with which function the device was created. */
672 if (!device->d3d_parent->extended)
673 {
674 WARN("IDirect3D9 instance wasn't created with CreateDirect3D9Ex, returning E_NOINTERFACE.\n");
675 *out = NULL;
676 return E_NOINTERFACE;
677 }
678
680 *out = iface;
681 return S_OK;
682 }
683
684 if (IsEqualGUID(riid, &IID_IDirect3DDevice9On12))
685 {
687
688 if (!device->d3d_parent->d3d9on12)
689 {
690 WARN("IDirect3D9 instance wasn't created with D3D9On12 enabled, returning E_NOINTERFACE.\n");
691 *out = NULL;
692 return E_NOINTERFACE;
693 }
694
696 *out = &device->IDirect3DDevice9On12_iface;
697 return S_OK;
698 }
699
700 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
701
702 *out = NULL;
703 return E_NOINTERFACE;
704}
705
707{
710
711 TRACE("%p increasing refcount to %lu.\n", iface, refcount);
712
713 return refcount;
714}
715
717{
720
721 if (device->in_destruction)
722 return 0;
723
725
726 TRACE("%p decreasing refcount to %lu.\n", iface, refcount);
727
728 if (!refcount)
729 {
730 unsigned i;
731 device->in_destruction = TRUE;
732
734 for (i = 0; i < device->fvf_decl_count; ++i)
735 {
737 }
738 free(device->fvf_decls);
739
742
743 for (i = 0; i < device->implicit_swapchain_count; ++i)
744 {
745 wined3d_swapchain_decref(device->implicit_swapchains[i]);
746 }
747 free(device->implicit_swapchains);
748
749 if (device->recording)
752
754 wined3d_device_decref(device->wined3d_device);
756
757 IDirect3D9Ex_Release(&device->d3d_parent->IDirect3D9Ex_iface);
758
759 free(device);
760 }
761
762 return refcount;
763}
764
766{
768
769 TRACE("iface %p.\n", iface);
770
771 TRACE("device state: %#lx.\n", device->device_state);
772
773 if (device->d3d_parent->extended)
774 return D3D_OK;
775
776 switch (device->device_state)
777 {
778 default:
780 return D3D_OK;
782 return D3DERR_DEVICELOST;
785 }
786}
787
789{
791 UINT ret;
792
793 TRACE("iface %p.\n", iface);
794
798
799 return ret;
800}
801
803{
805
806 TRACE("iface %p.\n", iface);
807
811
812 return D3D_OK;
813}
814
816{
818
819 TRACE("iface %p, d3d9 %p.\n", iface, d3d9);
820
821 if (!d3d9)
822 return D3DERR_INVALIDCALL;
823
824 return IDirect3D9Ex_QueryInterface(&device->d3d_parent->IDirect3D9Ex_iface, &IID_IDirect3D9, (void **)d3d9);
825}
826
828{
831 HRESULT hr;
832
833 TRACE("iface %p, caps %p.\n", iface, caps);
834
835 if (!caps)
836 return D3DERR_INVALIDCALL;
837
838 memset(caps, 0, sizeof(*caps));
839
843
844 d3d9_caps_from_wined3dcaps(device->d3d_parent, device->adapter_ordinal, caps, &wined3d_caps);
845
846 return hr;
847}
848
850{
852 struct wined3d_display_mode wined3d_mode;
853 HRESULT hr;
854
855 TRACE("iface %p, swapchain %u, mode %p.\n", iface, swapchain, mode);
856
858 hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain, &wined3d_mode, NULL);
860
861 if (SUCCEEDED(hr))
862 {
863 mode->Width = wined3d_mode.width;
864 mode->Height = wined3d_mode.height;
865 mode->RefreshRate = wined3d_mode.refresh_rate;
866 mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
867 }
868
869 return hr;
870}
871
874{
876
877 TRACE("iface %p, parameters %p.\n", iface, parameters);
878
883
884 parameters->AdapterOrdinal = device->adapter_ordinal;
885 return D3D_OK;
886}
887
889 UINT hotspot_x, UINT hotspot_y, IDirect3DSurface9 *bitmap)
890{
893 D3DSURFACE_DESC surface_desc;
895 HRESULT hr;
896
897 TRACE("iface %p, hotspot_x %u, hotspot_y %u, bitmap %p.\n",
898 iface, hotspot_x, hotspot_y, bitmap);
899
900 if (!bitmap)
901 {
902 WARN("No cursor bitmap, returning D3DERR_INVALIDCALL.\n");
903 return D3DERR_INVALIDCALL;
904 }
905
906 if (FAILED(hr = IDirect3DSurface9_GetDesc(bitmap, &surface_desc)))
907 {
908 WARN("Failed to get surface description, hr %#lx.\n", hr);
909 return hr;
910 }
911
912 if (FAILED(hr = IDirect3D9_GetAdapterDisplayMode(&device->d3d_parent->IDirect3D9Ex_iface,
913 device->adapter_ordinal, &mode)))
914 {
915 WARN("Failed to get device display mode, hr %#lx.\n", hr);
916 return hr;
917 }
918
919 if (surface_desc.Width > mode.Width || surface_desc.Height > mode.Height)
920 {
921 WARN("Surface dimension %ux%u exceeds display mode %ux%u.\n", surface_desc.Width,
922 surface_desc.Height, mode.Width, mode.Height);
923 return D3DERR_INVALIDCALL;
924 }
925
928 hotspot_x, hotspot_y, bitmap_impl->wined3d_texture, bitmap_impl->sub_resource_idx);
930
931 return hr;
932}
933
935{
937
938 TRACE("iface %p, x %u, y %u, flags %#lx.\n", iface, x, y, flags);
939
943}
944
946{
948 BOOL ret;
949
950 TRACE("iface %p, show %#x.\n", iface, show);
951
953 ret = wined3d_device_show_cursor(device->wined3d_device, show);
955
956 return ret;
957}
958
960 D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain)
961{
963 struct wined3d_device_creation_parameters creation_parameters;
965 struct d3d9_swapchain *object;
966 unsigned int swap_interval;
967 unsigned int output_idx;
968 unsigned int i, count;
969 HRESULT hr;
970
971 TRACE("iface %p, present_parameters %p, swapchain %p.\n",
972 iface, present_parameters, swapchain);
973
974 if (!present_parameters->Windowed)
975 {
976 WARN("Trying to create an additional fullscreen swapchain, returning D3DERR_INVALIDCALL.\n");
977 return D3DERR_INVALIDCALL;
978 }
979
982 for (i = 0; i < count; ++i)
983 {
985
988
989 if (!desc.windowed)
990 {
992 WARN("Trying to create an additional swapchain in fullscreen mode, returning D3DERR_INVALIDCALL.\n");
993 return D3DERR_INVALIDCALL;
994 }
995 }
997
998 output_idx = device->adapter_ordinal;
999 if (!wined3d_swapchain_desc_from_d3d9(&desc, device->d3d_parent->wined3d_outputs[output_idx],
1000 present_parameters, device->d3d_parent->extended))
1001 return D3DERR_INVALIDCALL;
1002 wined3d_device_get_creation_parameters(device->wined3d_device, &creation_parameters);
1003 if (creation_parameters.flags & WINED3DCREATE_NOWINDOWCHANGES)
1007 *swapchain = (IDirect3DSwapChain9 *)&object->IDirect3DSwapChain9Ex_iface;
1009 &desc, present_parameters->PresentationInterval);
1010
1011 return hr;
1012}
1013
1015 UINT swapchain_idx, IDirect3DSwapChain9 **swapchain)
1016{
1019 HRESULT hr;
1020
1021 TRACE("iface %p, swapchain_idx %u, swapchain %p.\n", iface, swapchain_idx, swapchain);
1022
1024 if (swapchain_idx < device->implicit_swapchain_count)
1025 {
1026 d3d9_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchains[swapchain_idx]);
1027 *swapchain = (IDirect3DSwapChain9 *)&d3d9_swapchain->IDirect3DSwapChain9Ex_iface;
1028 IDirect3DSwapChain9Ex_AddRef(*swapchain);
1029 hr = D3D_OK;
1030 }
1031 else
1032 {
1033 *swapchain = NULL;
1035 }
1037
1038 return hr;
1039}
1040
1042{
1044 UINT count;
1045
1046 TRACE("iface %p.\n", iface);
1047
1051
1052 return count;
1053}
1054
1056{
1058 struct d3d9_indexbuffer *index_buffer;
1060 IDirect3DBaseTexture9 *texture;
1061 struct d3d9_surface *surface;
1063
1065 if ((desc.access & WINED3D_RESOURCE_ACCESS_CPU) || (desc.usage & WINED3DUSAGE_MANAGED))
1066 return D3D_OK;
1067
1068 if (desc.resource_type != WINED3D_RTYPE_TEXTURE_2D)
1069 {
1070 if (desc.bind_flags & WINED3D_BIND_VERTEX_BUFFER)
1071 {
1073 if (vertex_buffer && vertex_buffer->draw_buffer)
1074 return D3D_OK;
1075 }
1076 if (desc.bind_flags & WINED3D_BIND_INDEX_BUFFER)
1077 {
1078 index_buffer = wined3d_resource_get_parent(resource);
1079 if (index_buffer && index_buffer->sysmem)
1080 return D3D_OK;
1081 }
1082
1083 WARN("Resource %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", resource);
1084 return D3DERR_INVALIDCALL;
1085 }
1086
1088 if (parent && SUCCEEDED(IUnknown_QueryInterface(parent, &IID_IDirect3DBaseTexture9, (void **)&texture)))
1089 {
1091 WARN("Texture %p (resource %p) in pool D3DPOOL_DEFAULT blocks the Reset call.\n", texture, resource);
1092 return D3DERR_INVALIDCALL;
1093 }
1094
1096 if (!surface || !surface->resource.refcount)
1097 return D3D_OK;
1098
1099 WARN("Surface %p in pool D3DPOOL_DEFAULT blocks the Reset call.\n", surface);
1100 return D3DERR_INVALIDCALL;
1101}
1102
1104{
1105 UINT i, new_swapchain_count = wined3d_device_get_swapchain_count(device->wined3d_device);
1106
1107 if (!(device->implicit_swapchains = malloc(new_swapchain_count * sizeof(*device->implicit_swapchains))))
1108 return E_OUTOFMEMORY;
1109
1110 for (i = 0; i < new_swapchain_count; ++i)
1111 {
1112 device->implicit_swapchains[i] = wined3d_device_get_swapchain(device->wined3d_device, i);
1113 }
1114 device->implicit_swapchain_count = new_swapchain_count;
1115
1116 return D3D_OK;
1117}
1118
1120 D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
1121{
1122 struct wined3d_swapchain_desc swapchain_desc, old_swapchain_desc;
1123 struct d3d9_surface **old_backbuffers = NULL;
1124 BOOL extended = device->d3d_parent->extended;
1125 struct wined3d_display_mode wined3d_mode;
1126 struct wined3d_rendertarget_view *rtv;
1128 unsigned int output_idx;
1129 unsigned int i;
1130 HRESULT hr;
1131
1132 if (!extended && device->device_state == D3D9_DEVICE_STATE_LOST)
1133 {
1134 WARN("App not active, returning D3DERR_DEVICELOST.\n");
1135 return D3DERR_DEVICELOST;
1136 }
1137
1138 if (mode)
1139 {
1140 wined3d_mode.width = mode->Width;
1141 wined3d_mode.height = mode->Height;
1142 wined3d_mode.refresh_rate = mode->RefreshRate;
1143 wined3d_mode.format_id = wined3dformat_from_d3dformat(mode->Format);
1144 wined3d_mode.scanline_ordering = wined3d_scanline_ordering_from_d3d(mode->ScanLineOrdering);
1145 }
1146
1147 output_idx = device->adapter_ordinal;
1148 if (!wined3d_swapchain_desc_from_d3d9(&swapchain_desc,
1149 device->d3d_parent->wined3d_outputs[output_idx], present_parameters, extended))
1150 return D3DERR_INVALIDCALL;
1151 swapchain_desc.flags |= WINED3D_SWAPCHAIN_IMPLICIT;
1152
1154
1157
1158 if (!extended)
1159 {
1160 if (device->recording)
1162 device->recording = NULL;
1163 device->update_state = device->state;
1165 }
1166
1168 {
1170 return hr;
1171 }
1172 d3d9_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchains[0]);
1173
1175
1176 /* wined3d_device_reset() may recreate swapchain textures.
1177 *
1178 * If the device is not extended, we don't need to remove the reference to
1179 * the wined3d swapchain from the old d3d9 surfaces: we will fail the reset
1180 * if they have 0 references, and therefore they are not actually holding a
1181 * reference to the wined3d swapchain, and will not do anything with it when
1182 * they are destroyed.
1183 *
1184 * If the device is extended, those swapchain textures can survive the
1185 * reset, and need to be detached from the implicit swapchain here. To add
1186 * some complexity, we need to add a temporary reference, but we can only do
1187 * that in the extended case, otherwise we'll try to validate that there are
1188 * 0 reference and fail. */
1189
1190 if (extended)
1191 {
1192 if (!(old_backbuffers = malloc(old_swapchain_desc.backbuffer_count * sizeof(*old_backbuffers))))
1193 {
1195 return hr;
1196 }
1197
1198 for (i = 0; i < old_swapchain_desc.backbuffer_count; ++i)
1199 {
1200 old_backbuffers[i] = wined3d_texture_get_sub_resource_parent(
1202 /* Resetting might drop the last reference, so grab an extra one here.
1203 * This also lets us always decref the swapchain, without needing to
1204 * worry about whether it's externally referenced. */
1205 IDirect3DSurface9_AddRef(&old_backbuffers[i]->IDirect3DSurface9_iface);
1206 }
1207 }
1208
1209 if (SUCCEEDED(hr = wined3d_device_reset(device->wined3d_device, &swapchain_desc,
1210 mode ? &wined3d_mode : NULL, reset_enum_callback, !extended)))
1211 {
1212 struct d3d9_surface *surface;
1213
1214 free(device->implicit_swapchains);
1215
1216 if (!extended)
1217 {
1218 device->auto_mipmaps = 0;
1220 !!swapchain_desc.enable_auto_depth_stencil);
1222 }
1223
1225 {
1226 device->device_state = D3D9_DEVICE_STATE_NOT_RESET;
1227 }
1228 else
1229 {
1230 d3d9_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchains[0]);
1234 present_parameters->BackBufferWidth = swapchain_desc.backbuffer_width;
1235 present_parameters->BackBufferHeight = swapchain_desc.backbuffer_height;
1236 present_parameters->BackBufferFormat = d3dformat_from_wined3dformat(swapchain_desc.backbuffer_format);
1237 present_parameters->BackBufferCount = swapchain_desc.backbuffer_count;
1238
1239 if (extended)
1240 {
1241 for (i = 0; i < old_swapchain_desc.backbuffer_count; ++i)
1242 {
1243 surface = old_backbuffers[i];
1244 /* We have a reference to this surface, so we can assert that it's
1245 * currently holding a reference to the swapchain. */
1247 surface->swapchain = NULL;
1248 surface->container = (IUnknown *)&device->IDirect3DDevice9Ex_iface;
1249 }
1250 }
1251
1252 /* FIXME: This should be the new backbuffer count, but we don't support
1253 * changing the backbuffer count in wined3d yet. */
1254 for (i = 0; i < old_swapchain_desc.backbuffer_count; ++i)
1255 {
1257
1258 if ((surface = d3d9_surface_create(backbuffer, 0, (IUnknown *)&device->IDirect3DDevice9Ex_iface)))
1259 surface->parent_device = &device->IDirect3DDevice9Ex_iface;
1260 }
1261
1262 device->in_scene = FALSE;
1263 device->device_state = D3D9_DEVICE_STATE_OK;
1264
1265 if (extended)
1266 {
1267 const struct wined3d_viewport *current = &device->stateblock_state->viewport;
1268 struct wined3d_viewport vp;
1269 RECT rect;
1270
1271 vp.x = 0;
1272 vp.y = 0;
1273 vp.width = swapchain_desc.backbuffer_width;
1274 vp.height = swapchain_desc.backbuffer_height;
1275 vp.min_z = current->min_z;
1276 vp.max_z = current->max_z;
1278
1279 SetRect(&rect, 0, 0, swapchain_desc.backbuffer_width, swapchain_desc.backbuffer_height);
1281 }
1282 }
1283
1284 rtv = wined3d_device_context_get_rendertarget_view(device->immediate_context, 0);
1286 for (i = 1; i < ARRAY_SIZE(device->render_targets); ++i)
1287 device->render_targets[i] = NULL;
1288
1289 if ((rtv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
1290 {
1292
1294 (IUnknown *)&device->IDirect3DDevice9Ex_iface)))
1295 surface->parent_device = &device->IDirect3DDevice9Ex_iface;
1296 }
1297 }
1298 else if (!extended)
1299 {
1300 device->device_state = D3D9_DEVICE_STATE_NOT_RESET;
1301 }
1302
1303 if (extended)
1304 {
1305 for (i = 0; i < old_swapchain_desc.backbuffer_count; ++i)
1306 IDirect3DSurface9_Release(&old_backbuffers[i]->IDirect3DSurface9_iface);
1307 free(old_backbuffers);
1308 }
1309
1311
1312 return hr;
1313}
1314
1316 D3DPRESENT_PARAMETERS *present_parameters)
1317{
1319
1320 TRACE("iface %p, present_parameters %p.\n", iface, present_parameters);
1321
1322 return d3d9_device_reset(device, present_parameters, NULL);
1323}
1324
1326 const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region)
1327{
1329 struct d3d9_swapchain *swapchain;
1330 unsigned int i;
1331 HRESULT hr;
1332
1333 TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p.\n",
1334 iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect), dst_window_override, dirty_region);
1335
1336 if (device->device_state != D3D9_DEVICE_STATE_OK)
1337 return device->d3d_parent->extended ? S_PRESENT_OCCLUDED : D3DERR_DEVICELOST;
1338
1339 if (dirty_region)
1340 FIXME("Ignoring dirty_region %p.\n", dirty_region);
1341
1343 for (i = 0; i < device->implicit_swapchain_count; ++i)
1344 {
1345 swapchain = wined3d_swapchain_get_parent(device->implicit_swapchains[i]);
1347 src_rect, dst_rect, dst_window_override, swapchain->swap_interval, 0)))
1348 {
1350 return hr;
1351 }
1352 }
1354
1355 return D3D_OK;
1356}
1357
1359 UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer)
1360{
1363 HRESULT hr;
1364
1365 TRACE("iface %p, swapchain %u, backbuffer_idx %u, backbuffer_type %#x, backbuffer %p.\n",
1366 iface, swapchain, backbuffer_idx, backbuffer_type, backbuffer);
1367
1368 /* backbuffer_type is ignored by native. */
1369
1370 /* No need to check for backbuffer == NULL, Windows crashes in that case. */
1371 *backbuffer = NULL;
1372
1374 if (swapchain >= device->implicit_swapchain_count)
1375 {
1377 WARN("Swapchain index %u is out of range, returning D3DERR_INVALIDCALL.\n", swapchain);
1378 return D3DERR_INVALIDCALL;
1379 }
1380
1381 d3d9_swapchain = wined3d_swapchain_get_parent(device->implicit_swapchains[swapchain]);
1383 backbuffer_idx, backbuffer_type, backbuffer);
1385
1386 return hr;
1387}
1388
1390 UINT swapchain, D3DRASTER_STATUS *raster_status)
1391{
1393 HRESULT hr;
1394
1395 TRACE("iface %p, swapchain %u, raster_status %p.\n", iface, swapchain, raster_status);
1396
1398 hr = wined3d_device_get_raster_status(device->wined3d_device,
1399 swapchain, (struct wined3d_raster_status *)raster_status);
1401
1402 return hr;
1403}
1404
1406{
1408 HRESULT hr;
1409
1410 TRACE("iface %p, enable %#x.\n", iface, enable);
1411
1415
1416 return hr;
1417}
1418
1420 UINT swapchain, DWORD flags, const D3DGAMMARAMP *ramp)
1421{
1423
1424 TRACE("iface %p, swapchain %u, flags %#lx, ramp %p.\n", iface, swapchain, flags, ramp);
1425
1426 /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
1428 wined3d_device_set_gamma_ramp(device->wined3d_device, swapchain, flags, (const struct wined3d_gamma_ramp *)ramp);
1430}
1431
1433{
1435
1436 TRACE("iface %p, swapchain %u, ramp %p.\n", iface, swapchain, ramp);
1437
1438 /* Note: D3DGAMMARAMP is compatible with struct wined3d_gamma_ramp. */
1440 wined3d_device_get_gamma_ramp(device->wined3d_device, swapchain, (struct wined3d_gamma_ramp *)ramp);
1442}
1443
1446 D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle)
1447{
1449 struct d3d9_texture *object;
1450 BOOL set_mem = FALSE;
1451 unsigned int i;
1452 HRESULT hr;
1453
1454 TRACE("iface %p, width %u, height %u, levels %u, usage %#lx, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1455 iface, width, height, levels, usage, format, pool, texture, shared_handle);
1456
1457 *texture = NULL;
1458 if (shared_handle)
1459 {
1460 if (!device->d3d_parent->extended)
1461 {
1462 WARN("Trying to create a shared or user memory texture on a non-ex device.\n");
1463 return E_NOTIMPL;
1464 }
1465
1466 if (pool == D3DPOOL_SYSTEMMEM)
1467 {
1468 if (levels != 1)
1469 return D3DERR_INVALIDCALL;
1470 set_mem = TRUE;
1471 }
1472 else
1473 {
1474 if (pool != D3DPOOL_DEFAULT)
1475 {
1476 WARN("Trying to create a shared texture in pool %#x.\n", pool);
1477 return D3DERR_INVALIDCALL;
1478 }
1479 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1480 }
1481 }
1482
1483 if (!(object = calloc(1, sizeof(*object))))
1485
1487 if (FAILED(hr))
1488 {
1489 WARN("Failed to initialize texture, hr %#lx.\n", hr);
1490 free(object);
1491 return hr;
1492 }
1493
1494 if (set_mem)
1495 {
1497 wined3d_texture_update_desc(object->wined3d_texture, 0, *shared_handle, 0);
1499 }
1500
1501 levels = wined3d_texture_get_level_count(object->wined3d_texture);
1502 for (i = 0; i < levels; ++i)
1503 {
1504 if (!d3d9_surface_create(object->wined3d_texture, i, (IUnknown *)&object->IDirect3DBaseTexture9_iface))
1505 {
1506 IDirect3DTexture9_Release(&object->IDirect3DBaseTexture9_iface);
1507 return E_OUTOFMEMORY;
1508 }
1509 }
1510
1511 TRACE("Created texture %p.\n", object);
1512 *texture = (IDirect3DTexture9 *)&object->IDirect3DBaseTexture9_iface;
1513
1514 return D3D_OK;
1515}
1516
1519 D3DPOOL pool, IDirect3DVolumeTexture9 **texture, HANDLE *shared_handle)
1520{
1522 struct d3d9_texture *object;
1523 HRESULT hr;
1524
1525 TRACE("iface %p, width %u, height %u, depth %u, levels %u, "
1526 "usage %#lx, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1527 iface, width, height, depth, levels,
1528 usage, format, pool, texture, shared_handle);
1529
1530 *texture = NULL;
1531 if (shared_handle)
1532 {
1533 if (!device->d3d_parent->extended)
1534 {
1535 WARN("Trying to create a shared volume texture on a non-ex device.\n");
1536 return E_NOTIMPL;
1537 }
1538
1539 if (pool != D3DPOOL_DEFAULT)
1540 {
1541 WARN("Trying to create a shared volume texture in pool %#x.\n", pool);
1542 return D3DERR_INVALIDCALL;
1543 }
1544 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1545 }
1546
1547 if (!(object = calloc(1, sizeof(*object))))
1549
1551 if (FAILED(hr))
1552 {
1553 WARN("Failed to initialize volume texture, hr %#lx.\n", hr);
1554 free(object);
1555 return hr;
1556 }
1557
1558 TRACE("Created volume texture %p.\n", object);
1559 *texture = (IDirect3DVolumeTexture9 *)&object->IDirect3DBaseTexture9_iface;
1560
1561 return D3D_OK;
1562}
1563
1566 IDirect3DCubeTexture9 **texture, HANDLE *shared_handle)
1567{
1569 struct d3d9_texture *object;
1570 unsigned int i;
1571 HRESULT hr;
1572
1573 TRACE("iface %p, edge_length %u, levels %u, usage %#lx, format %#x, pool %#x, texture %p, shared_handle %p.\n",
1574 iface, edge_length, levels, usage, format, pool, texture, shared_handle);
1575
1576 *texture = NULL;
1577 if (shared_handle)
1578 {
1579 if (!device->d3d_parent->extended)
1580 {
1581 WARN("Trying to create a shared cube texture on a non-ex device.\n");
1582 return E_NOTIMPL;
1583 }
1584
1585 if (pool != D3DPOOL_DEFAULT)
1586 {
1587 WARN("Trying to create a shared cube texture in pool %#x.\n", pool);
1588 return D3DERR_INVALIDCALL;
1589 }
1590 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1591 }
1592
1593 if (!(object = calloc(1, sizeof(*object))))
1595
1596 hr = d3d9_texture_cube_init(object, device, edge_length, levels, usage, format, pool);
1597 if (FAILED(hr))
1598 {
1599 WARN("Failed to initialize cube texture, hr %#lx.\n", hr);
1600 free(object);
1601 return hr;
1602 }
1603
1604 levels = wined3d_texture_get_level_count(object->wined3d_texture);
1605 for (i = 0; i < levels * 6; ++i)
1606 {
1607 if (!d3d9_surface_create(object->wined3d_texture, i, (IUnknown *)&object->IDirect3DBaseTexture9_iface))
1608 {
1609 IDirect3DTexture9_Release(&object->IDirect3DBaseTexture9_iface);
1610 return E_OUTOFMEMORY;
1611 }
1612 }
1613
1614 TRACE("Created cube texture %p.\n", object);
1615 *texture = (IDirect3DCubeTexture9 *)&object->IDirect3DBaseTexture9_iface;
1616
1617 return D3D_OK;
1618}
1619
1621 DWORD usage, DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer9 **buffer,
1622 HANDLE *shared_handle)
1623{
1625 struct d3d9_vertexbuffer *object;
1626 HRESULT hr;
1627
1628 TRACE("iface %p, size %u, usage %#lx, fvf %#lx, pool %#x, buffer %p, shared_handle %p.\n",
1629 iface, size, usage, fvf, pool, buffer, shared_handle);
1630
1631 if (shared_handle)
1632 {
1633 if (!device->d3d_parent->extended)
1634 {
1635 WARN("Trying to create a shared vertex buffer on a non-ex device.\n");
1636 return E_NOTIMPL;
1637 }
1638
1639 if (pool != D3DPOOL_DEFAULT)
1640 {
1641 WARN("Trying to create a shared vertex buffer in pool %#x.\n", pool);
1642 return D3DERR_NOTAVAILABLE;
1643 }
1644 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1645 }
1646
1647 if (!(object = calloc(1, sizeof(*object))))
1649
1650 hr = vertexbuffer_init(object, device, size, usage, fvf, pool);
1651 if (FAILED(hr))
1652 {
1653 WARN("Failed to initialize vertex buffer, hr %#lx.\n", hr);
1654 free(object);
1655 return hr;
1656 }
1657
1658 TRACE("Created vertex buffer %p.\n", object);
1659 *buffer = &object->IDirect3DVertexBuffer9_iface;
1660
1661 return D3D_OK;
1662}
1663
1665 DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **buffer,
1666 HANDLE *shared_handle)
1667{
1669 struct d3d9_indexbuffer *object;
1670 HRESULT hr;
1671
1672 TRACE("iface %p, size %u, usage %#lx, format %#x, pool %#x, buffer %p, shared_handle %p.\n",
1673 iface, size, usage, format, pool, buffer, shared_handle);
1674
1675 if (shared_handle)
1676 {
1677 if (!device->d3d_parent->extended)
1678 {
1679 WARN("Trying to create a shared index buffer on a non-ex device.\n");
1680 return E_NOTIMPL;
1681 }
1682
1683 if (pool != D3DPOOL_DEFAULT)
1684 {
1685 WARN("Trying to create a shared index buffer in pool %#x.\n", pool);
1686 return D3DERR_NOTAVAILABLE;
1687 }
1688 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1689 }
1690
1691 if (!(object = calloc(1, sizeof(*object))))
1693
1695 if (FAILED(hr))
1696 {
1697 WARN("Failed to initialize index buffer, hr %#lx.\n", hr);
1698 free(object);
1699 return hr;
1700 }
1701
1702 TRACE("Created index buffer %p.\n", object);
1703 *buffer = &object->IDirect3DIndexBuffer9_iface;
1704
1705 return D3D_OK;
1706}
1707
1709 enum wined3d_format_id format, enum wined3d_multisample_type multisample_type,
1710 unsigned int multisample_quality, unsigned int usage, unsigned int bind_flags, unsigned int access,
1711 unsigned int width, unsigned int height, void *user_mem, IDirect3DSurface9 **surface)
1712{
1714 struct d3d9_surface *surface_impl;
1715 struct wined3d_texture *texture;
1716 HRESULT hr;
1717
1718 TRACE("device %p, flags %#x, format %#x, multisample_type %#x, multisample_quality %u, "
1719 "usage %#x, bind_flags %#x, access %#x, width %u, height %u, user_mem %p, surface %p.\n",
1720 device, flags, format, multisample_type, multisample_quality, usage,
1721 bind_flags, access, width, height, user_mem, surface);
1722
1723 desc.resource_type = WINED3D_RTYPE_TEXTURE_2D;
1724 desc.format = format;
1725 desc.multisample_type = multisample_type;
1726 desc.multisample_quality = multisample_quality;
1727 desc.usage = usage;
1728 desc.bind_flags = bind_flags;
1729 desc.access = access;
1730 desc.width = width;
1731 desc.height = height;
1732 desc.depth = 1;
1733 desc.size = 0;
1734
1737
1739
1740 if (FAILED(hr = wined3d_texture_create(device->wined3d_device, &desc,
1742 {
1744 WARN("Failed to create texture, hr %#lx.\n", hr);
1747 return hr;
1748 }
1749
1750 if (!(surface_impl = d3d9_surface_create(texture, 0, NULL)))
1751 {
1754 return E_OUTOFMEMORY;
1755 }
1756 surface_impl->parent_device = &device->IDirect3DDevice9Ex_iface;
1757 *surface = &surface_impl->IDirect3DSurface9_iface;
1758 IDirect3DSurface9_AddRef(*surface);
1759
1760 if (user_mem)
1761 wined3d_texture_update_desc(texture, 0, user_mem, 0);
1762
1764
1766
1767 return D3D_OK;
1768}
1769
1771{
1772 switch (format)
1773 {
1780 return TRUE;
1781 default:
1782 return FALSE;
1783 }
1784}
1785
1787 D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality,
1788 BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle)
1789{
1791 unsigned int access = WINED3D_RESOURCE_ACCESS_GPU;
1792
1793 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %lu.\n"
1794 "lockable %#x, surface %p, shared_handle %p.\n",
1795 iface, width, height, format, multisample_type, multisample_quality,
1796 lockable, surface, shared_handle);
1797
1798 *surface = NULL;
1799 if (shared_handle)
1800 {
1801 if (!device->d3d_parent->extended)
1802 {
1803 WARN("Trying to create a shared render target on a non-ex device.\n");
1804 return E_NOTIMPL;
1805 }
1806
1807 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1808 }
1809
1810 if (lockable)
1812
1814 wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0,
1816}
1817
1819 D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality,
1820 BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle)
1821{
1823 DWORD flags = 0;
1824
1825 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %lu.\n"
1826 "discard %#x, surface %p, shared_handle %p.\n",
1827 iface, width, height, format, multisample_type, multisample_quality,
1828 discard, surface, shared_handle);
1829
1830 *surface = NULL;
1831 if (shared_handle)
1832 {
1833 if (!device->d3d_parent->extended)
1834 {
1835 WARN("Trying to create a shared depth stencil on a non-ex device.\n");
1836 return E_NOTIMPL;
1837 }
1838
1839 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
1840 }
1841
1842 if (discard)
1844
1846 wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, 0,
1848}
1849
1850
1852 IDirect3DSurface9 *src_surface, const RECT *src_rect,
1853 IDirect3DSurface9 *dst_surface, const POINT *dst_point)
1854{
1858 struct wined3d_sub_resource_desc src_desc, dst_desc;
1859 struct wined3d_box src_box;
1860 HRESULT hr;
1861
1862 TRACE("iface %p, src_surface %p, src_rect %s, dst_surface %p, dst_point %p.\n",
1863 iface, src_surface, wine_dbgstr_rect(src_rect), dst_surface, dst_point);
1864
1866
1867 wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &src_desc);
1868 wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &dst_desc);
1869 if (src_desc.format != dst_desc.format)
1870 {
1872 WARN("Surface formats (%#x/%#x) don't match.\n",
1875 return D3DERR_INVALIDCALL;
1876 }
1877
1879 {
1881 WARN("Cannot use UpdateSurface with multisampled surfaces.\n");
1882 return D3DERR_INVALIDCALL;
1883 }
1884
1885 if (src_rect)
1886 wined3d_box_set(&src_box, src_rect->left, src_rect->top, src_rect->right, src_rect->bottom, 0, 1);
1887 else
1888 wined3d_box_set(&src_box, 0, 0, src_desc.width, src_desc.height, 0, 1);
1889
1891 wined3d_texture_get_resource(dst->wined3d_texture), dst->sub_resource_idx, dst_point ? dst_point->x : 0,
1892 dst_point ? dst_point->y : 0, 0, wined3d_texture_get_resource(src->wined3d_texture),
1893 src->sub_resource_idx, &src_box, 0);
1894 if (SUCCEEDED(hr) && dst->texture)
1896
1898
1899 if (FAILED(hr))
1900 return D3DERR_INVALIDCALL;
1901
1902 return hr;
1903}
1904
1906 IDirect3DBaseTexture9 *src_texture, IDirect3DBaseTexture9 *dst_texture)
1907{
1909 struct d3d9_texture *src_impl, *dst_impl;
1910 HRESULT hr;
1911
1912 TRACE("iface %p, src_texture %p, dst_texture %p.\n", iface, src_texture, dst_texture);
1913
1914 src_impl = unsafe_impl_from_IDirect3DBaseTexture9(src_texture);
1915 dst_impl = unsafe_impl_from_IDirect3DBaseTexture9(dst_texture);
1916
1917 if (src_impl->draw_texture || dst_impl->draw_texture)
1918 {
1919 WARN("Source or destination is managed; returning D3DERR_INVALIDCALL.\n");
1920 return D3DERR_INVALIDCALL;
1921 }
1922
1924 hr = wined3d_device_update_texture(device->wined3d_device,
1925 src_impl->wined3d_texture, dst_impl->wined3d_texture);
1926 if (SUCCEEDED(hr))
1929
1930 return hr;
1931}
1932
1934 IDirect3DSurface9 *render_target, IDirect3DSurface9 *dst_surface)
1935{
1937 struct d3d9_surface *rt_impl = unsafe_impl_from_IDirect3DSurface9(render_target);
1938 struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface);
1939 struct wined3d_sub_resource_desc wined3d_desc;
1940 RECT dst_rect, src_rect;
1941 HRESULT hr;
1942
1943 TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, render_target, dst_surface);
1944
1945 if (!render_target || !dst_surface)
1946 return D3DERR_INVALIDCALL;
1947
1949 wined3d_texture_get_sub_resource_desc(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &wined3d_desc);
1950 SetRect(&dst_rect, 0, 0, wined3d_desc.width, wined3d_desc.height);
1951
1953 SetRect(&src_rect, 0, 0, wined3d_desc.width, wined3d_desc.height);
1954
1955 /* TODO: Check surface sizes, pools, etc. */
1956 if (wined3d_desc.multisample_type)
1958 else
1959 hr = wined3d_device_context_blt(device->immediate_context,
1960 dst_impl->wined3d_texture, dst_impl->sub_resource_idx, &dst_rect,
1961 rt_impl->wined3d_texture, rt_impl->sub_resource_idx, &src_rect, 0, NULL, WINED3D_TEXF_POINT);
1963
1964 return hr;
1965}
1966
1968 UINT swapchain, IDirect3DSurface9 *dst_surface)
1969{
1971 struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface);
1973
1974 TRACE("iface %p, swapchain %u, dst_surface %p.\n", iface, swapchain, dst_surface);
1975
1977 if (swapchain < device->implicit_swapchain_count)
1979 dst_impl->wined3d_texture, dst_impl->sub_resource_idx);
1981
1982 return hr;
1983}
1984
1986 const RECT *src_rect, IDirect3DSurface9 *dst_surface, const RECT *dst_rect, D3DTEXTUREFILTERTYPE filter)
1987{
1991 struct wined3d_sub_resource_desc src_desc, dst_desc;
1993 RECT d, s;
1994
1995 TRACE("iface %p, src_surface %p, src_rect %s, dst_surface %p, dst_rect %s, filter %#x.\n",
1996 iface, src_surface, wine_dbgstr_rect(src_rect), dst_surface, wine_dbgstr_rect(dst_rect), filter);
1997
1999 wined3d_texture_get_sub_resource_desc(dst->wined3d_texture, dst->sub_resource_idx, &dst_desc);
2000 if (!dst_rect)
2001 {
2002 SetRect(&d, 0, 0, dst_desc.width, dst_desc.height);
2003 dst_rect = &d;
2004 }
2005
2006 wined3d_texture_get_sub_resource_desc(src->wined3d_texture, src->sub_resource_idx, &src_desc);
2007 if (!src_rect)
2008 {
2009 SetRect(&s, 0, 0, src_desc.width, src_desc.height);
2010 src_rect = &s;
2011 }
2012
2013 if (dst_desc.access & WINED3D_RESOURCE_ACCESS_CPU)
2014 {
2015 WARN("Destination resource is not in DEFAULT pool.\n");
2016 goto done;
2017 }
2018 if (src_desc.access & WINED3D_RESOURCE_ACCESS_CPU)
2019 {
2020 WARN("Source resource is not in DEFAULT pool.\n");
2021 goto done;
2022 }
2023
2024 if (dst->texture && !(dst_desc.bind_flags & (WINED3D_BIND_RENDER_TARGET | WINED3D_BIND_DEPTH_STENCIL)))
2025 {
2026 WARN("Destination is a regular texture.\n");
2027 goto done;
2028 }
2029
2031 {
2032 if (device->in_scene)
2033 {
2034 WARN("Rejecting depth / stencil blit while in scene.\n");
2035 goto done;
2036 }
2037
2038 if (src_rect->left || src_rect->top || src_rect->right != src_desc.width
2039 || src_rect->bottom != src_desc.height)
2040 {
2041 WARN("Rejecting depth / stencil blit with invalid source rect %s.\n",
2042 wine_dbgstr_rect(src_rect));
2043 goto done;
2044 }
2045
2046 if (dst_rect->left || dst_rect->top || dst_rect->right != dst_desc.width
2047 || dst_rect->bottom != dst_desc.height)
2048 {
2049 WARN("Rejecting depth / stencil blit with invalid destination rect %s.\n",
2050 wine_dbgstr_rect(dst_rect));
2051 goto done;
2052 }
2053
2054 if (src_desc.width != dst_desc.width || src_desc.height != dst_desc.height)
2055 {
2056 WARN("Rejecting depth / stencil blit with mismatched surface sizes.\n");
2057 goto done;
2058 }
2059 }
2060
2061 hr = wined3d_device_context_blt(device->immediate_context, dst->wined3d_texture,
2062 dst->sub_resource_idx, dst_rect, src->wined3d_texture, src->sub_resource_idx,
2066 if (SUCCEEDED(hr) && dst->texture)
2068
2069done:
2071 return hr;
2072}
2073
2075 IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color)
2076{
2077 const struct wined3d_color c =
2078 {
2079 ((color >> 16) & 0xff) / 255.0f,
2080 ((color >> 8) & 0xff) / 255.0f,
2081 (color & 0xff) / 255.0f,
2082 ((color >> 24) & 0xff) / 255.0f,
2083 };
2085 struct d3d9_surface *surface_impl = unsafe_impl_from_IDirect3DSurface9(surface);
2087 struct wined3d_rendertarget_view *rtv;
2088 HRESULT hr;
2089
2090 TRACE("iface %p, surface %p, rect %p, color 0x%08lx.\n", iface, surface, rect, color);
2091
2092 if (!surface)
2093 return D3DERR_INVALIDCALL;
2094
2096
2098 surface_impl->sub_resource_idx, &desc)))
2099 {
2101 return D3DERR_INVALIDCALL;
2102 }
2103
2104 if (desc.access & WINED3D_RESOURCE_ACCESS_CPU)
2105 {
2107 WARN("Colour fills are not allowed on surfaces with resource access %#x.\n", desc.access);
2108 return D3DERR_INVALIDCALL;
2109 }
2111 {
2113 WARN("Colorfill is not allowed on non-RT textures, returning D3DERR_INVALIDCALL.\n");
2114 return D3DERR_INVALIDCALL;
2115 }
2116 if (desc.bind_flags & WINED3D_BIND_DEPTH_STENCIL)
2117 {
2119 WARN("Colorfill is not allowed on depth stencil surfaces, returning D3DERR_INVALIDCALL.\n");
2120 return D3DERR_INVALIDCALL;
2121 }
2122
2123 wined3d_stateblock_apply_clear_state(device->state, device->wined3d_device);
2124 rtv = d3d9_surface_acquire_rendertarget_view(surface_impl);
2126 rtv, rect, WINED3DCLEAR_TARGET, &c, 0.0f, 0);
2127 d3d9_surface_release_rendertarget_view(surface_impl, rtv);
2128 if (SUCCEEDED(hr) && surface_impl->texture)
2130
2132
2133 return hr;
2134}
2135
2138 HANDLE *shared_handle)
2139{
2141 unsigned int usage, access;
2142 void *user_mem = NULL;
2143
2144 TRACE("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p.\n",
2145 iface, width, height, format, pool, surface, shared_handle);
2146
2147 *surface = NULL;
2148 if (pool == D3DPOOL_MANAGED)
2149 {
2150 WARN("Attempting to create a managed offscreen plain surface.\n");
2151 return D3DERR_INVALIDCALL;
2152 }
2153
2154 if (shared_handle)
2155 {
2156 if (!device->d3d_parent->extended)
2157 {
2158 WARN("Trying to create a shared or user memory surface on a non-ex device.\n");
2159 return E_NOTIMPL;
2160 }
2161
2162 if (pool == D3DPOOL_SYSTEMMEM)
2163 user_mem = *shared_handle;
2164 else
2165 {
2166 if (pool != D3DPOOL_DEFAULT)
2167 {
2168 WARN("Trying to create a shared surface in pool %#x.\n", pool);
2169 return D3DERR_INVALIDCALL;
2170 }
2171 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
2172 }
2173 }
2174
2178
2179 if (!device->d3d_parent->extended)
2181
2183 WINED3D_MULTISAMPLE_NONE, 0, usage, 0, access, width, height, user_mem, surface);
2184}
2185
2187{
2189 struct d3d9_surface *surface_impl = unsafe_impl_from_IDirect3DSurface9(surface);
2190 struct wined3d_rendertarget_view *rtv;
2191 HRESULT hr;
2192
2193 TRACE("iface %p, idx %lu, surface %p.\n", iface, idx, surface);
2194
2196 {
2197 WARN("Invalid index %lu specified.\n", idx);
2198 return D3DERR_INVALIDCALL;
2199 }
2200
2201 if (!idx && !surface_impl)
2202 {
2203 WARN("Trying to set render target 0 to NULL.\n");
2204 return D3DERR_INVALIDCALL;
2205 }
2206
2207 if (surface_impl && d3d9_surface_get_device(surface_impl) != device)
2208 {
2209 WARN("Render target surface does not match device.\n");
2210 return D3DERR_INVALIDCALL;
2211 }
2212
2214 rtv = surface_impl ? d3d9_surface_acquire_rendertarget_view(surface_impl) : NULL;
2215 hr = wined3d_device_context_set_rendertarget_views(device->immediate_context, idx, 1, &rtv, TRUE);
2216 d3d9_surface_release_rendertarget_view(surface_impl, rtv);
2217 if (SUCCEEDED(hr))
2218 {
2219 if (!idx)
2221 device->render_targets[idx] = surface_impl;
2222 }
2224
2225 return hr;
2226}
2227
2229{
2231 struct wined3d_rendertarget_view *wined3d_rtv;
2232 struct d3d9_surface *surface_impl;
2233 HRESULT hr = D3D_OK;
2234
2235 TRACE("iface %p, idx %lu, surface %p.\n", iface, idx, surface);
2236
2237 if (!surface)
2238 return D3DERR_INVALIDCALL;
2239
2241 {
2242 WARN("Invalid index %lu specified.\n", idx);
2243 return D3DERR_INVALIDCALL;
2244 }
2245
2248 {
2249 /* We want the sub resource parent here, since the view itself may be
2250 * internal to wined3d and may not have a parent. */
2252 *surface = &surface_impl->IDirect3DSurface9_iface;
2253 IDirect3DSurface9_AddRef(*surface);
2254 }
2255 else
2256 {
2258 *surface = NULL;
2259 }
2261
2262 return hr;
2263}
2264
2266{
2269 struct wined3d_rendertarget_view *rtv;
2270 HRESULT hr;
2271
2272 TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
2273
2275 rtv = ds_impl ? d3d9_surface_acquire_rendertarget_view(ds_impl) : NULL;
2276 hr = wined3d_device_context_set_depth_stencil_view(device->immediate_context, rtv);
2280
2281 return hr;
2282}
2283
2285{
2287 struct wined3d_rendertarget_view *wined3d_dsv;
2288 struct d3d9_surface *surface_impl;
2289 HRESULT hr = D3D_OK;
2290
2291 TRACE("iface %p, depth_stencil %p.\n", iface, depth_stencil);
2292
2293 if (!depth_stencil)
2294 return D3DERR_INVALIDCALL;
2295
2297 if ((wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
2298 {
2299 /* We want the sub resource parent here, since the view itself may be
2300 * internal to wined3d and may not have a parent. */
2301 surface_impl = wined3d_rendertarget_view_get_sub_resource_parent(wined3d_dsv);
2302 *depth_stencil = &surface_impl->IDirect3DSurface9_iface;
2304 }
2305 else
2306 {
2309 }
2311
2312 return hr;
2313}
2314
2316{
2318 HRESULT hr;
2319
2320 TRACE("iface %p.\n", iface);
2321
2323 if (SUCCEEDED(hr = wined3d_device_begin_scene(device->wined3d_device)))
2324 device->in_scene = TRUE;
2326
2327 return hr;
2328}
2329
2331{
2333 HRESULT hr;
2334
2335 TRACE("iface %p.\n", iface);
2336
2338 if (SUCCEEDED(hr = wined3d_device_end_scene(device->wined3d_device)))
2339 device->in_scene = FALSE;
2341
2342 return hr;
2343}
2344
2346{
2347 unsigned int i;
2348
2349 for (i = 0; i < ARRAY_SIZE(device->render_targets); ++i)
2350 {
2351 struct d3d9_surface *surface = device->render_targets[i];
2352
2353 if (surface && surface->texture)
2355 }
2356}
2357
2359 const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil)
2360{
2362 struct wined3d_color c;
2363 HRESULT hr;
2364
2365 TRACE("iface %p, rect_count %lu, rects %p, flags %#lx, color 0x%08lx, z %.8e, stencil %lu.\n",
2366 iface, rect_count, rects, flags, color, z, stencil);
2367
2368 if (rect_count && !rects)
2369 {
2370 WARN("count %lu with NULL rects.\n", rect_count);
2371 rect_count = 0;
2372 }
2373
2376 wined3d_stateblock_apply_clear_state(device->state, device->wined3d_device);
2377 hr = wined3d_device_clear(device->wined3d_device, rect_count, (const RECT *)rects, flags, &c, z, stencil);
2378 if (SUCCEEDED(hr))
2381
2382 return hr;
2383}
2384
2387{
2389
2390 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
2391
2392 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
2397
2398 return D3D_OK;
2399}
2400
2403{
2405
2406 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
2407
2408 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
2410 memcpy(matrix, &device->stateblock_state->transforms[state], sizeof(*matrix));
2412
2413 return D3D_OK;
2414}
2415
2418{
2420
2421 TRACE("iface %p, state %#x, matrix %p.\n", iface, state, matrix);
2422
2423 /* Note: D3DMATRIX is compatible with struct wined3d_matrix. */
2428
2429 return D3D_OK;
2430}
2431
2433{
2435 struct wined3d_viewport vp;
2436
2437 TRACE("iface %p, viewport %p.\n", iface, viewport);
2438
2439 vp.x = viewport->X;
2440 vp.y = viewport->Y;
2441 vp.width = viewport->Width;
2442 vp.height = viewport->Height;
2443 vp.min_z = viewport->MinZ;
2444 vp.max_z = viewport->MaxZ;
2445
2447 wined3d_stateblock_set_viewport(device->update_state, &vp);
2449
2450 return D3D_OK;
2451}
2452
2454{
2457
2458 TRACE("iface %p, viewport %p.\n", iface, viewport);
2459
2461 wined3d_viewport = device->stateblock_state->viewport;
2463
2464 viewport->X = wined3d_viewport.x;
2465 viewport->Y = wined3d_viewport.y;
2466 viewport->Width = wined3d_viewport.width;
2467 viewport->Height = wined3d_viewport.height;
2468 viewport->MinZ = wined3d_viewport.min_z;
2469 viewport->MaxZ = wined3d_viewport.max_z;
2470
2471 return D3D_OK;
2472}
2473
2475{
2477
2478 TRACE("iface %p, material %p.\n", iface, material);
2479
2480 /* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
2482 wined3d_stateblock_set_material(device->update_state, (const struct wined3d_material *)material);
2484
2485 return D3D_OK;
2486}
2487
2489{
2491
2492 TRACE("iface %p, material %p.\n", iface, material);
2493
2494 /* Note: D3DMATERIAL9 is compatible with struct wined3d_material. */
2496 memcpy(material, &device->stateblock_state->material, sizeof(*material));
2498
2499 return D3D_OK;
2500}
2501
2503{
2505 HRESULT hr;
2506
2507 TRACE("iface %p, index %lu, light %p.\n", iface, index, light);
2508
2509 /* Note: D3DLIGHT9 is compatible with struct wined3d_light. */
2511 hr = wined3d_stateblock_set_light(device->update_state, index, (const struct wined3d_light *)light);
2513
2514 return hr;
2515}
2516
2518{
2520 BOOL enabled;
2521 HRESULT hr;
2522
2523 TRACE("iface %p, index %lu, light %p.\n", iface, index, light);
2524
2525 /* Note: D3DLIGHT9 is compatible with struct wined3d_light. */
2529
2530 return hr;
2531}
2532
2534{
2536 HRESULT hr;
2537
2538 TRACE("iface %p, index %lu, enable %#x.\n", iface, index, enable);
2539
2543
2544 return hr;
2545}
2546
2548{
2550 struct wined3d_light light;
2551 HRESULT hr;
2552
2553 TRACE("iface %p, index %lu, enabled %p.\n", iface, index, enabled);
2554
2558
2559 return hr;
2560}
2561
2563{
2565 HRESULT hr;
2566
2567 TRACE("iface %p, index %lu, plane %p.\n", iface, index, plane);
2568
2569 index = min(index, device->max_user_clip_planes - 1);
2570
2572 hr = wined3d_stateblock_set_clip_plane(device->update_state, index, (const struct wined3d_vec4 *)plane);
2574
2575 return hr;
2576}
2577
2579{
2581
2582 TRACE("iface %p, index %lu, plane %p.\n", iface, index, plane);
2583
2584 index = min(index, device->max_user_clip_planes - 1);
2585
2587 memcpy(plane, &device->stateblock_state->clip_planes[index], sizeof(struct wined3d_vec4));
2589
2590 return D3D_OK;
2591}
2592
2594{
2595 const struct wined3d_stateblock_state *state = device->stateblock_state;
2596 struct wined3d_rendertarget_view *wined3d_dsv;
2597 struct wined3d_resource *dst_resource;
2598 struct wined3d_texture *dst_texture;
2600 struct d3d9_surface *d3d9_dsv;
2601
2602 if (!(dst_texture = state->textures[0]))
2603 return;
2604 dst_resource = wined3d_texture_get_resource(dst_texture);
2605 wined3d_resource_get_desc(dst_resource, &desc);
2607 && desc.format != WINED3DFMT_X8D24_UNORM
2608 && desc.format != WINED3DFMT_DF16
2609 && desc.format != WINED3DFMT_DF24
2610 && desc.format != WINED3DFMT_INTZ)
2611 return;
2612
2613 if (!(wined3d_dsv = wined3d_device_context_get_depth_stencil_view(device->immediate_context)))
2614 return;
2616
2617 wined3d_device_context_resolve_sub_resource(device->immediate_context, dst_resource, 0,
2618 wined3d_rendertarget_view_get_resource(wined3d_dsv), d3d9_dsv->sub_resource_idx, desc.format);
2619}
2620
2623{
2625
2626 TRACE("iface %p, state %#x, value %#lx.\n", iface, state, value);
2627
2633
2634 return D3D_OK;
2635}
2636
2639{
2642
2643 TRACE("iface %p, state %#x, value %p.\n", iface, state, value);
2644
2646 device_state = device->stateblock_state;
2647 *value = device_state->rs[state];
2649
2650 return D3D_OK;
2651}
2652
2654 D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateblock)
2655{
2657 struct d3d9_stateblock *object;
2658 HRESULT hr;
2659
2660 TRACE("iface %p, type %#x, stateblock %p.\n", iface, type, stateblock);
2661
2663 {
2664 WARN("Unexpected stateblock type, returning D3DERR_INVALIDCALL.\n");
2665 return D3DERR_INVALIDCALL;
2666 }
2667
2669 if (device->recording)
2670 {
2672 WARN("Trying to create a stateblock while recording, returning D3DERR_INVALIDCALL.\n");
2673 return D3DERR_INVALIDCALL;
2674 }
2676
2677 if (!(object = calloc(1, sizeof(*object))))
2678 return E_OUTOFMEMORY;
2679
2680 hr = stateblock_init(object, device, type, NULL);
2681 if (FAILED(hr))
2682 {
2683 WARN("Failed to initialize stateblock, hr %#lx.\n", hr);
2684 free(object);
2685 return hr;
2686 }
2687
2688 TRACE("Created stateblock %p.\n", object);
2689 *stateblock = &object->IDirect3DStateBlock9_iface;
2690
2691 return D3D_OK;
2692}
2693
2695{
2697 struct wined3d_stateblock *stateblock;
2698 HRESULT hr;
2699
2700 TRACE("iface %p.\n", iface);
2701
2703 if (device->recording)
2704 {
2706 WARN("Trying to begin a stateblock while recording, returning D3DERR_INVALIDCALL.\n");
2707 return D3DERR_INVALIDCALL;
2708 }
2709
2710 if (SUCCEEDED(hr = wined3d_stateblock_create(device->wined3d_device, device->state, WINED3D_SBT_RECORDED, &stateblock)))
2711 device->update_state = device->recording = stateblock;
2713
2714 return hr;
2715}
2716
2717static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDirect3DStateBlock9 **stateblock)
2718{
2721 struct d3d9_stateblock *object;
2722 HRESULT hr;
2723
2724 TRACE("iface %p, stateblock %p.\n", iface, stateblock);
2725
2727 if (!device->recording)
2728 {
2730 WARN("Trying to end a stateblock, but no stateblock is being recorded.\n");
2731 return D3DERR_INVALIDCALL;
2732 }
2733 wined3d_stateblock = device->recording;
2735 device->recording = NULL;
2736 device->update_state = device->state;
2738
2739 if (!(object = calloc(1, sizeof(*object))))
2740 {
2742 return E_OUTOFMEMORY;
2743 }
2744
2746 if (FAILED(hr))
2747 {
2748 WARN("Failed to initialize stateblock, hr %#lx.\n", hr);
2750 free(object);
2751 return hr;
2752 }
2753
2754 TRACE("Created stateblock %p.\n", object);
2755 *stateblock = &object->IDirect3DStateBlock9_iface;
2756
2757 return D3D_OK;
2758}
2759
2761{
2763 HRESULT hr;
2764
2765 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
2766
2768 hr = wined3d_device_set_clip_status(device->wined3d_device, (const struct wined3d_clip_status *)clip_status);
2770
2771 return hr;
2772}
2773
2775{
2777 HRESULT hr;
2778
2779 TRACE("iface %p, clip_status %p.\n", iface, clip_status);
2780
2782 hr = wined3d_device_get_clip_status(device->wined3d_device, (struct wined3d_clip_status *)clip_status);
2784
2785 return hr;
2786}
2787
2788static HRESULT WINAPI d3d9_device_GetTexture(IDirect3DDevice9Ex *iface, DWORD stage, IDirect3DBaseTexture9 **texture)
2789{
2792 const struct wined3d_stateblock_state *state;
2793 struct d3d9_texture *texture_impl;
2794
2795 TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
2796
2797 if (!texture)
2798 return D3DERR_INVALIDCALL;
2799
2800 if (stage >= D3DVERTEXTEXTURESAMPLER0 && stage <= D3DVERTEXTEXTURESAMPLER3)
2802
2803 if (stage >= ARRAY_SIZE(state->textures))
2804 {
2805 WARN("Ignoring invalid stage %lu.\n", stage);
2806 *texture = NULL;
2807 return D3D_OK;
2808 }
2809
2811 state = device->stateblock_state;
2812 if ((wined3d_texture = state->textures[stage]))
2813 {
2815 *texture = &texture_impl->IDirect3DBaseTexture9_iface;
2817 }
2818 else
2819 {
2820 *texture = NULL;
2821 }
2823
2824 return D3D_OK;
2825}
2826
2827static HRESULT WINAPI d3d9_device_SetTexture(IDirect3DDevice9Ex *iface, DWORD stage, IDirect3DBaseTexture9 *texture)
2828{
2830 struct d3d9_texture *texture_impl;
2831
2832 TRACE("iface %p, stage %lu, texture %p.\n", iface, stage, texture);
2833
2835
2836 if (stage >= D3DVERTEXTEXTURESAMPLER0 && stage <= D3DVERTEXTEXTURESAMPLER3)
2838
2840 wined3d_stateblock_set_texture(device->update_state, stage,
2841 texture_impl ? d3d9_texture_get_draw_texture(texture_impl) : NULL);
2842 if (!device->recording)
2843 {
2844 if (stage < D3D9_MAX_TEXTURE_UNITS)
2845 {
2846 if (texture_impl && texture_impl->usage & D3DUSAGE_AUTOGENMIPMAP)
2847 device->auto_mipmaps |= 1u << stage;
2848 else
2849 device->auto_mipmaps &= ~(1u << stage);
2850 }
2851 }
2853
2854 return D3D_OK;
2855}
2856
2858{
2859 WINED3D_TSS_INVALID, /* 0, unused */
2860 WINED3D_TSS_COLOR_OP, /* 1, D3DTSS_COLOROP */
2861 WINED3D_TSS_COLOR_ARG1, /* 2, D3DTSS_COLORARG1 */
2862 WINED3D_TSS_COLOR_ARG2, /* 3, D3DTSS_COLORARG2 */
2863 WINED3D_TSS_ALPHA_OP, /* 4, D3DTSS_ALPHAOP */
2864 WINED3D_TSS_ALPHA_ARG1, /* 5, D3DTSS_ALPHAARG1 */
2865 WINED3D_TSS_ALPHA_ARG2, /* 6, D3DTSS_ALPHAARG2 */
2866 WINED3D_TSS_BUMPENV_MAT00, /* 7, D3DTSS_BUMPENVMAT00 */
2867 WINED3D_TSS_BUMPENV_MAT01, /* 8, D3DTSS_BUMPENVMAT01 */
2868 WINED3D_TSS_BUMPENV_MAT10, /* 9, D3DTSS_BUMPENVMAT10 */
2869 WINED3D_TSS_BUMPENV_MAT11, /* 10, D3DTSS_BUMPENVMAT11 */
2870 WINED3D_TSS_TEXCOORD_INDEX, /* 11, D3DTSS_TEXCOORDINDEX */
2871 WINED3D_TSS_INVALID, /* 12, unused */
2872 WINED3D_TSS_INVALID, /* 13, unused */
2873 WINED3D_TSS_INVALID, /* 14, unused */
2874 WINED3D_TSS_INVALID, /* 15, unused */
2875 WINED3D_TSS_INVALID, /* 16, unused */
2876 WINED3D_TSS_INVALID, /* 17, unused */
2877 WINED3D_TSS_INVALID, /* 18, unused */
2878 WINED3D_TSS_INVALID, /* 19, unused */
2879 WINED3D_TSS_INVALID, /* 20, unused */
2880 WINED3D_TSS_INVALID, /* 21, unused */
2881 WINED3D_TSS_BUMPENV_LSCALE, /* 22, D3DTSS_BUMPENVLSCALE */
2882 WINED3D_TSS_BUMPENV_LOFFSET, /* 23, D3DTSS_BUMPENVLOFFSET */
2883 WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS, /* 24, D3DTSS_TEXTURETRANSFORMFLAGS */
2884 WINED3D_TSS_INVALID, /* 25, unused */
2885 WINED3D_TSS_COLOR_ARG0, /* 26, D3DTSS_COLORARG0 */
2886 WINED3D_TSS_ALPHA_ARG0, /* 27, D3DTSS_ALPHAARG0 */
2887 WINED3D_TSS_RESULT_ARG, /* 28, D3DTSS_RESULTARG */
2888 WINED3D_TSS_INVALID, /* 29, unused */
2889 WINED3D_TSS_INVALID, /* 30, unused */
2890 WINED3D_TSS_INVALID, /* 31, unused */
2891 WINED3D_TSS_CONSTANT, /* 32, D3DTSS_CONSTANT */
2892};
2893
2896{
2898
2899 TRACE("iface %p, stage %lu, state %#x, value %p.\n", iface, stage, state, value);
2900
2902 {
2903 WARN("Invalid state %#x passed.\n", state);
2904 return D3D_OK;
2905 }
2906
2908 *value = device->stateblock_state->texture_states[stage][tss_lookup[state]];
2910
2911 return D3D_OK;
2912}
2913
2916{
2918
2919 TRACE("iface %p, stage %lu, state %#x, value %#lx.\n", iface, stage, state, value);
2920
2921 if (state >= ARRAY_SIZE(tss_lookup))
2922 {
2923 WARN("Invalid state %#x passed.\n", state);
2924 return D3D_OK;
2925 }
2926
2930
2931 return D3D_OK;
2932}
2933
2935 DWORD sampler_idx, D3DSAMPLERSTATETYPE state, DWORD *value)
2936{
2939
2940 TRACE("iface %p, sampler_idx %lu, state %#x, value %p.\n", iface, sampler_idx, state, value);
2941
2942 if (sampler_idx >= D3DVERTEXTEXTURESAMPLER0 && sampler_idx <= D3DVERTEXTEXTURESAMPLER3)
2944
2945 if (sampler_idx >= ARRAY_SIZE(device_state->sampler_states))
2946 {
2947 WARN("Invalid sampler %lu.\n", sampler_idx);
2948 *value = 0;
2949 return D3D_OK;
2950 }
2951
2953 device_state = device->stateblock_state;
2954 *value = device_state->sampler_states[sampler_idx][state];
2956
2957 return D3D_OK;
2958}
2959
2962{
2964
2965 TRACE("iface %p, sampler %lu, state %#x, value %#lx.\n", iface, sampler, state, value);
2966
2969
2973
2974 return D3D_OK;
2975}
2976
2978{
2980 HRESULT hr;
2981
2982 TRACE("iface %p, pass_count %p.\n", iface, pass_count);
2983
2985 hr = wined3d_device_validate_device(device->wined3d_device, device->stateblock_state, pass_count);
2987
2988 return hr;
2989}
2990
2992 UINT palette_idx, const PALETTEENTRY *entries)
2993{
2994 WARN("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
2995
2996 /* The d3d9 palette API is non-functional on Windows. Getters and setters are implemented,
2997 * and some drivers allow the creation of P8 surfaces. These surfaces can be copied to
2998 * other P8 surfaces with StretchRect, but cannot be converted to (A)RGB.
2999 *
3000 * Some older(dx7) cards may have support for P8 textures, but games cannot rely on this. */
3001 return D3D_OK;
3002}
3003
3005 UINT palette_idx, PALETTEENTRY *entries)
3006{
3007 FIXME("iface %p, palette_idx %u, entries %p unimplemented.\n", iface, palette_idx, entries);
3008
3009 return D3DERR_INVALIDCALL;
3010}
3011
3013{
3014 WARN("iface %p, palette_idx %u unimplemented.\n", iface, palette_idx);
3015
3016 return D3D_OK;
3017}
3018
3020{
3021 FIXME("iface %p, palette_idx %p.\n", iface, palette_idx);
3022
3023 return D3DERR_INVALIDCALL;
3024}
3025
3027{
3029
3030 TRACE("iface %p, rect %p.\n", iface, rect);
3031
3035
3036 return D3D_OK;
3037}
3038
3040{
3042
3043 TRACE("iface %p, rect %p.\n", iface, rect);
3044
3046 *rect = device->stateblock_state->scissor_rect;
3048
3049 return D3D_OK;
3050}
3051
3053{
3055
3056 TRACE("iface %p, software %#x.\n", iface, software);
3057
3059 wined3d_device_set_software_vertex_processing(device->wined3d_device, software);
3061
3062 return D3D_OK;
3063}
3064
3066{
3068 BOOL ret;
3069
3070 TRACE("iface %p.\n", iface);
3071
3075
3076 return ret;
3077}
3078
3080{
3082 HRESULT hr;
3083
3084 TRACE("iface %p, segment_count %.8e.\n", iface, segment_count);
3085
3087 hr = wined3d_device_set_npatch_mode(device->wined3d_device, segment_count);
3089
3090 return hr;
3091}
3092
3094{
3096 float ret;
3097
3098 TRACE("iface %p.\n", iface);
3099
3101 ret = wined3d_device_get_npatch_mode(device->wined3d_device);
3103
3104 return ret;
3105}
3106
3107/* wined3d critical section must be taken by the caller. */
3109{
3110 const struct wined3d_stateblock_state *state = device->stateblock_state;
3111 struct wined3d_texture *texture;
3112 unsigned int i, map;
3113
3114 map = device->auto_mipmaps;
3115 while (map)
3116 {
3118 if ((texture = state->textures[i]))
3120 }
3121}
3122
3124 int base_vertex, unsigned int start_vertex, unsigned int vertex_count)
3125{
3126 const struct wined3d_stateblock_state *state = device->stateblock_state;
3127 struct wined3d_vertex_declaration *wined3d_decl;
3128 struct wined3d_box box = {0, 0, 0, 1, 0, 1};
3129 const struct wined3d_stream_state *stream;
3130 struct d3d9_vertexbuffer *d3d9_buffer;
3131 struct wined3d_resource *dst_resource;
3132 struct d3d9_vertex_declaration *decl;
3133 struct wined3d_buffer *dst_buffer;
3135 unsigned int stride, map;
3136 HRESULT hr;
3137
3138 if (!device->sysmem_vb)
3139 return;
3140 wined3d_decl = state->vertex_declaration;
3141 if (!wined3d_decl)
3142 return;
3143
3144 if (base_vertex >= 0 || start_vertex >= -base_vertex)
3145 start_vertex += base_vertex;
3146 else
3147 FIXME("System memory vertex data offset is negative.\n");
3148
3149 decl = wined3d_vertex_declaration_get_parent(wined3d_decl);
3150 map = decl->stream_map & device->sysmem_vb;
3151 while (map)
3152 {
3153 stream = &state->streams[wined3d_bit_scan(&map)];
3154 dst_buffer = stream->buffer;
3155 stride = stream->stride;
3156
3157 d3d9_buffer = wined3d_buffer_get_parent(dst_buffer);
3158 dst_resource = wined3d_buffer_get_resource(dst_buffer);
3159 wined3d_resource_get_desc(dst_resource, &desc);
3160 box.left = stream->offset + start_vertex * stride;
3161 box.right = min(box.left + vertex_count * stride, desc.size);
3163 dst_resource, 0, box.left, 0, 0,
3164 wined3d_buffer_get_resource(d3d9_buffer->wined3d_buffer), 0, &box, 0)))
3165 ERR("Failed to update buffer.\n");
3166 }
3167}
3168
3170 unsigned int *start_idx, unsigned int idx_count)
3171{
3172 const struct wined3d_stateblock_state *state = device->stateblock_state;
3173 unsigned int src_offset, idx_size, buffer_size, pos;
3174 struct wined3d_resource_desc resource_desc;
3175 struct wined3d_resource *index_buffer;
3176 struct wined3d_map_desc map_desc;
3177 struct wined3d_box box;
3178 HRESULT hr;
3179
3180 if (!device->sysmem_ib)
3181 return S_OK;
3182
3183 index_buffer = wined3d_buffer_get_resource(state->index_buffer);
3184 wined3d_resource_get_desc(index_buffer, &resource_desc);
3185 idx_size = (state->index_format == WINED3DFMT_R16_UINT) ? 2 : 4;
3186
3187 src_offset = (*start_idx) * idx_size;
3188 buffer_size = min(idx_count * idx_size, resource_desc.size - src_offset);
3189
3190 wined3d_box_set(&box, src_offset, 0, buffer_size, 1, 0, 1);
3191 if (FAILED(hr = wined3d_resource_map(index_buffer, 0, &map_desc, &box, WINED3D_MAP_READ)))
3192 {
3193 ERR("Failed to map index buffer, hr %#lx.\n", hr);
3194 return hr;
3195 }
3196 wined3d_streaming_buffer_upload(device->wined3d_device, &device->index_buffer,
3197 map_desc.data, buffer_size, idx_size, &pos);
3198 wined3d_resource_unmap(index_buffer, 0);
3199
3201 device->index_buffer.buffer, state->index_format, pos);
3202 *start_idx = 0;
3203 return S_OK;
3204}
3205
3207{
3208 for (unsigned int i = 0; i < WINED3D_MAX_STREAMS; ++i)
3209 {
3210 struct wined3d_buffer *buffer = device->stateblock_state->streams[i].buffer;
3211
3212 if (buffer)
3214 }
3215}
3216
3218{
3219 const struct wined3d_stateblock_state *state = device->stateblock_state;
3220 unsigned int i;
3221
3222 for (i = 0; i < WINED3D_MAX_COMBINED_SAMPLERS; ++i)
3223 {
3224 struct wined3d_texture *wined3d_texture = state->textures[i];
3225 struct d3d9_texture *d3d9_texture;
3226
3227 if (!wined3d_texture)
3228 continue;
3231 wined3d_device_update_texture(device->wined3d_device,
3233 }
3234}
3235
3237 D3DPRIMITIVETYPE primitive_type, UINT start_vertex, UINT primitive_count)
3238{
3240 unsigned int vertex_count;
3241
3242 TRACE("iface %p, primitive_type %#x, start_vertex %u, primitive_count %u.\n",
3243 iface, primitive_type, start_vertex, primitive_count);
3244
3246 if (!device->stateblock_state->vertex_declaration)
3247 {
3249 WARN("Called without a valid vertex declaration set.\n");
3250 return D3DERR_INVALIDCALL;
3251 }
3252 wined3d_device_apply_stateblock(device->wined3d_device, device->state);
3253 vertex_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
3259 wined3d_primitive_type_from_d3d(primitive_type), 0);
3260
3261 /* Instancing is ignored for non-indexed draws. */
3262 wined3d_device_context_draw(device->immediate_context, start_vertex, vertex_count, 0, 0);
3263
3266
3267 return D3D_OK;
3268}
3269
3271 D3DPRIMITIVETYPE primitive_type, INT base_vertex_idx, UINT min_vertex_idx,
3272 UINT vertex_count, UINT start_idx, UINT primitive_count)
3273{
3275 unsigned int index_count;
3276
3277 TRACE("iface %p, primitive_type %#x, base_vertex_idx %u, min_vertex_idx %u, "
3278 "vertex_count %u, start_idx %u, primitive_count %u.\n",
3279 iface, primitive_type, base_vertex_idx, min_vertex_idx,
3280 vertex_count, start_idx, primitive_count);
3281
3283 if (!device->stateblock_state->vertex_declaration)
3284 {
3286 WARN("Called without a valid vertex declaration set.\n");
3287 return D3DERR_INVALIDCALL;
3288 }
3289 if (!device->stateblock_state->index_buffer)
3290 {
3292 WARN("Called without a valid index buffer set.\n");
3293 return D3DERR_INVALIDCALL;
3294 }
3295 index_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
3297 d3d9_device_upload_sysmem_vertex_buffers(device, base_vertex_idx, min_vertex_idx, vertex_count);
3301 wined3d_primitive_type_from_d3d(primitive_type), 0);
3302 wined3d_device_apply_stateblock(device->wined3d_device, device->state);
3303 d3d9_device_upload_sysmem_index_buffer(device, &start_idx, index_count);
3304 wined3d_device_context_flush_mapped_buffer(device->immediate_context, device->stateblock_state->index_buffer);
3305 wined3d_device_context_draw_indexed(device->immediate_context, base_vertex_idx, start_idx, index_count, 0,
3306 device->stateblock_state->streams[0].frequency);
3309
3310 return D3D_OK;
3311}
3312
3314 D3DPRIMITIVETYPE primitive_type, UINT primitive_count, const void *data, UINT stride)
3315{
3317 UINT vtx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
3318 UINT size = vtx_count * stride;
3319 unsigned int vb_pos;
3320 HRESULT hr;
3321
3322 TRACE("iface %p, primitive_type %#x, primitive_count %u, data %p, stride %u.\n",
3323 iface, primitive_type, primitive_count, data, stride);
3324
3325 if (!stride)
3326 {
3327 WARN("stride is 0, returning D3DERR_INVALIDCALL.\n");
3328 return D3DERR_INVALIDCALL;
3329 }
3330 if (!primitive_count)
3331 {
3332 WARN("primitive_count is 0, returning D3D_OK.\n");
3333 return D3D_OK;
3334 }
3335
3337
3338 if (!device->stateblock_state->vertex_declaration)
3339 {
3341 WARN("Called without a valid vertex declaration set.\n");
3342 return D3DERR_INVALIDCALL;
3343 }
3344
3345 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device,
3346 &device->vertex_buffer, data, size, stride, &vb_pos)))
3347 goto done;
3348
3349 hr = wined3d_stateblock_set_stream_source(device->state, 0, device->vertex_buffer.buffer, 0, stride);
3350 if (FAILED(hr))
3351 goto done;
3352
3356 wined3d_primitive_type_from_d3d(primitive_type), 0);
3357 wined3d_device_apply_stateblock(device->wined3d_device, device->state);
3358
3359 /* Instancing is ignored for non-indexed draws. */
3360 wined3d_device_context_draw(device->immediate_context, vb_pos / stride, vtx_count, 0, 0);
3361
3364
3365done:
3367 return hr;
3368}
3369
3371 D3DPRIMITIVETYPE primitive_type, UINT min_vertex_idx, UINT vertex_count,
3372 UINT primitive_count, const void *index_data, D3DFORMAT index_format,
3373 const void *vertex_data, UINT vertex_stride)
3374{
3375 UINT idx_count = vertex_count_from_primitive_count(primitive_type, primitive_count);
3377 UINT idx_fmt_size = index_format == D3DFMT_INDEX16 ? 2 : 4;
3378 UINT vtx_size = vertex_count * vertex_stride;
3379 UINT idx_size = idx_count * idx_fmt_size;
3380 UINT vb_pos, ib_pos;
3381 HRESULT hr;
3382
3383 TRACE("iface %p, primitive_type %#x, min_vertex_idx %u, vertex_count %u, primitive_count %u, "
3384 "index_data %p, index_format %#x, vertex_data %p, vertex_stride %u.\n",
3385 iface, primitive_type, min_vertex_idx, vertex_count, primitive_count,
3386 index_data, index_format, vertex_data, vertex_stride);
3387
3388 if (!vertex_stride)
3389 {
3390 WARN("vertex_stride is 0, returning D3DERR_INVALIDCALL.\n");
3391 return D3DERR_INVALIDCALL;
3392 }
3393 if (!primitive_count)
3394 {
3395 WARN("primitive_count is 0, returning D3D_OK.\n");
3396 return D3D_OK;
3397 }
3398
3400
3401 if (!device->stateblock_state->vertex_declaration)
3402 {
3404 WARN("Called without a valid vertex declaration set.\n");
3405 return D3DERR_INVALIDCALL;
3406 }
3407
3408 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device, &device->vertex_buffer,
3409 (char *)vertex_data + min_vertex_idx * vertex_stride, vtx_size, vertex_stride, &vb_pos)))
3410 goto done;
3411
3412 if (FAILED(hr = wined3d_streaming_buffer_upload(device->wined3d_device, &device->index_buffer,
3413 index_data, idx_size, idx_fmt_size, &ib_pos)))
3414 goto done;
3415
3416 hr = wined3d_stateblock_set_stream_source(device->state, 0, device->vertex_buffer.buffer, 0, vertex_stride);
3417 if (FAILED(hr))
3418 goto done;
3419 wined3d_stateblock_set_index_buffer(device->state, device->index_buffer.buffer,
3420 wined3dformat_from_d3dformat(index_format));
3421
3424 wined3d_device_apply_stateblock(device->wined3d_device, device->state);
3426 wined3d_primitive_type_from_d3d(primitive_type), 0);
3428 vb_pos / vertex_stride - min_vertex_idx, ib_pos / idx_fmt_size, idx_count, 0,
3429 device->stateblock_state->streams[0].frequency);
3430
3433
3435
3436done:
3438 return hr;
3439}
3440
3442 UINT src_start_idx, UINT dst_idx, UINT vertex_count, IDirect3DVertexBuffer9 *dst_buffer,
3443 IDirect3DVertexDeclaration9 *declaration, DWORD flags)
3444{
3446 struct d3d9_vertexbuffer *dst_impl = unsafe_impl_from_IDirect3DVertexBuffer9(dst_buffer);
3448 const struct wined3d_stateblock_state *state;
3449 const struct wined3d_stream_state *stream;
3450 struct d3d9_vertexbuffer *d3d9_buffer;
3451 unsigned int i, map;
3452 HRESULT hr;
3453
3454 TRACE("iface %p, src_start_idx %u, dst_idx %u, vertex_count %u, dst_buffer %p, declaration %p, flags %#lx.\n",
3455 iface, src_start_idx, dst_idx, vertex_count, dst_buffer, declaration, flags);
3456
3458 state = device->stateblock_state;
3459
3460 /* Note that an alternative approach would be to simply create these
3461 * buffers with WINED3D_RESOURCE_ACCESS_MAP_R and update them here like we
3462 * do for draws. In some regards that would be easier, but it seems less
3463 * than optimal to upload data to the GPU only to subsequently download it
3464 * again. */
3465 map = device->sysmem_vb;
3466 while (map)
3467 {
3469 stream = &state->streams[i];
3470
3471 d3d9_buffer = wined3d_buffer_get_parent(stream->buffer);
3473 i, d3d9_buffer->wined3d_buffer, stream->offset, stream->stride)))
3474 ERR("Failed to set stream source.\n");
3475 }
3476
3477 hr = wined3d_device_process_vertices(device->wined3d_device, device->state, src_start_idx, dst_idx, vertex_count,
3478 dst_impl->wined3d_buffer, decl_impl ? decl_impl->wined3d_declaration : NULL,
3479 flags, dst_impl->fvf);
3480
3481 map = device->sysmem_vb;
3482 while (map)
3483 {
3485 stream = &state->streams[i];
3486
3487 d3d9_buffer = wined3d_buffer_get_parent(stream->buffer);
3489 i, d3d9_buffer->draw_buffer, stream->offset, stream->stride)))
3490 ERR("Failed to set stream source.\n");
3491 }
3492
3494
3495 return hr;
3496}
3497
3499 const D3DVERTEXELEMENT9 *elements, IDirect3DVertexDeclaration9 **declaration)
3500{
3503 HRESULT hr;
3504
3505 TRACE("iface %p, elements %p, declaration %p.\n", iface, elements, declaration);
3506
3507 if (!declaration)
3508 {
3509 WARN("Caller passed a NULL declaration, returning D3DERR_INVALIDCALL.\n");
3510 return D3DERR_INVALIDCALL;
3511 }
3512
3514 *declaration = &object->IDirect3DVertexDeclaration9_iface;
3515
3516 return hr;
3517}
3518
3520 IDirect3DVertexDeclaration9 *declaration)
3521{
3524
3525 TRACE("iface %p, declaration %p.\n", iface, declaration);
3526
3529 decl_impl ? decl_impl->wined3d_declaration : NULL);
3531
3532 return D3D_OK;
3533}
3534
3536 IDirect3DVertexDeclaration9 **declaration)
3537{
3539 struct wined3d_vertex_declaration *wined3d_declaration;
3540 struct d3d9_vertex_declaration *declaration_impl;
3541
3542 TRACE("iface %p, declaration %p.\n", iface, declaration);
3543
3544 if (!declaration) return D3DERR_INVALIDCALL;
3545
3547 if ((wined3d_declaration = device->stateblock_state->vertex_declaration))
3548 {
3550 *declaration = &declaration_impl->IDirect3DVertexDeclaration9_iface;
3552 }
3553 else
3554 {
3555 *declaration = NULL;
3556 }
3558
3559 TRACE("Returning %p.\n", *declaration);
3560 return D3D_OK;
3561}
3562
3564{
3565 struct wined3d_vertex_declaration *wined3d_declaration;
3566 struct fvf_declaration *fvf_decls = device->fvf_decls;
3567 struct d3d9_vertex_declaration *d3d9_declaration;
3569 int p, low, high; /* deliberately signed */
3570 HRESULT hr;
3571
3572 TRACE("Searching for declaration for fvf %08lx... ", fvf);
3573
3574 low = 0;
3575 high = device->fvf_decl_count - 1;
3576 while (low <= high)
3577 {
3578 p = (low + high) >> 1;
3579 TRACE("%d ", p);
3580
3581 if (fvf_decls[p].fvf == fvf)
3582 {
3583 TRACE("found %p.\n", fvf_decls[p].decl);
3584 return fvf_decls[p].decl;
3585 }
3586
3587 if (fvf_decls[p].fvf < fvf)
3588 low = p + 1;
3589 else
3590 high = p - 1;
3591 }
3592 TRACE("not found. Creating and inserting at position %d.\n", low);
3593
3595 return NULL;
3596
3597 hr = d3d9_vertex_declaration_create(device, elements, &d3d9_declaration);
3598 free(elements);
3599 if (FAILED(hr))
3600 return NULL;
3601
3602 if (device->fvf_decl_size == device->fvf_decl_count)
3603 {
3604 UINT grow = max(device->fvf_decl_size / 2, 8);
3605
3606 if (!(fvf_decls = realloc(fvf_decls, sizeof(*fvf_decls) * (device->fvf_decl_size + grow))))
3607 {
3609 return NULL;
3610 }
3611 device->fvf_decls = fvf_decls;
3612 device->fvf_decl_size += grow;
3613 }
3614
3615 d3d9_declaration->fvf = fvf;
3616 wined3d_declaration = d3d9_declaration->wined3d_declaration;
3619
3620 memmove(fvf_decls + low + 1, fvf_decls + low, sizeof(*fvf_decls) * (device->fvf_decl_count - low));
3621 fvf_decls[low].decl = wined3d_declaration;
3622 fvf_decls[low].fvf = fvf;
3623 ++device->fvf_decl_count;
3624
3625 TRACE("Returning %p. %u declarations in array.\n", wined3d_declaration, device->fvf_decl_count);
3626
3627 return wined3d_declaration;
3628}
3629
3631{
3633 struct wined3d_vertex_declaration *decl;
3634
3635 TRACE("iface %p, fvf %#lx.\n", iface, fvf);
3636
3637 if (!fvf)
3638 {
3639 WARN("%#lx is not a valid FVF.\n", fvf);
3640 return D3D_OK;
3641 }
3642
3644 if (!(decl = device_get_fvf_declaration(device, fvf)))
3645 {
3647 ERR("Failed to create a vertex declaration for fvf %#lx.\n", fvf);
3649 }
3650
3653
3654 return D3D_OK;
3655}
3656
3658{
3660 struct wined3d_vertex_declaration *wined3d_declaration;
3661 struct d3d9_vertex_declaration *d3d9_declaration;
3662
3663 TRACE("iface %p, fvf %p.\n", iface, fvf);
3664
3666 if ((wined3d_declaration = device->stateblock_state->vertex_declaration))
3667 {
3669 *fvf = d3d9_declaration->fvf;
3670 }
3671 else
3672 {
3673 *fvf = 0;
3674 }
3676
3677 TRACE("Returning FVF %#lx.\n", *fvf);
3678
3679 return D3D_OK;
3680}
3681
3683 const DWORD *byte_code, IDirect3DVertexShader9 **shader)
3684{
3686 struct d3d9_vertexshader *object;
3687 HRESULT hr;
3688
3689 TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
3690
3691 if (!(object = calloc(1, sizeof(*object))))
3692 return E_OUTOFMEMORY;
3693
3694 hr = vertexshader_init(object, device, byte_code);
3695 if (FAILED(hr))
3696 {
3697 WARN("Failed to initialize vertex shader, hr %#lx.\n", hr);
3698 free(object);
3699 return hr;
3700 }
3701
3702 TRACE("Created vertex shader %p.\n", object);
3703 *shader = &object->IDirect3DVertexShader9_iface;
3704
3705 return D3D_OK;
3706}
3707
3709{
3712
3713 TRACE("iface %p, shader %p.\n", iface, shader);
3714
3717 shader_obj ? shader_obj->wined3d_shader : NULL);
3719
3720 return D3D_OK;
3721}
3722
3724{
3726 struct d3d9_vertexshader *shader_impl;
3728
3729 TRACE("iface %p, shader %p.\n", iface, shader);
3730
3732 if ((wined3d_shader = device->stateblock_state->vs))
3733 {
3735 *shader = &shader_impl->IDirect3DVertexShader9_iface;
3737 }
3738 else
3739 {
3740 *shader = NULL;
3741 }
3743
3744 TRACE("Returning %p.\n", *shader);
3745
3746 return D3D_OK;
3747}
3748
3750 UINT reg_idx, const float *data, UINT count)
3751{
3753 HRESULT hr;
3754
3755 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3756
3758 {
3759 WARN("Trying to access %u constants, but d3d9 only supports %u\n",
3761 return D3DERR_INVALIDCALL;
3762 }
3763
3765 hr = wined3d_stateblock_set_vs_consts_f(device->update_state, reg_idx,
3766 count, (const struct wined3d_vec4 *)data);
3768
3769 return hr;
3770}
3771
3773 UINT start_idx, float *constants, UINT count)
3774{
3776 HRESULT hr;
3777
3778 TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
3779
3783
3784 return hr;
3785}
3786
3788 UINT reg_idx, const int *data, UINT count)
3789{
3791 HRESULT hr;
3792
3793 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3794
3797 reg_idx, count, (const struct wined3d_ivec4 *)data);
3799
3800 return hr;
3801}
3802
3804 UINT start_idx, int *constants, UINT count)
3805{
3807 HRESULT hr;
3808
3809 TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
3810
3814
3815 return hr;
3816}
3817
3819 UINT reg_idx, const BOOL *data, UINT count)
3820{
3822 HRESULT hr;
3823
3824 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
3825
3827 hr = wined3d_stateblock_set_vs_consts_b(device->update_state, reg_idx, count, data);
3829
3830 return hr;
3831}
3832
3834 UINT start_idx, BOOL *constants, UINT count)
3835{
3837 HRESULT hr;
3838
3839 TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
3840
3844
3845 return hr;
3846}
3847
3849 UINT stream_idx, IDirect3DVertexBuffer9 *buffer, UINT offset, UINT stride)
3850{
3854 HRESULT hr;
3855
3856 TRACE("iface %p, stream_idx %u, buffer %p, offset %u, stride %u.\n",
3857 iface, stream_idx, buffer, offset, stride);
3858
3859 if (stream_idx >= ARRAY_SIZE(device->stateblock_state->streams))
3860 {
3861 WARN("Stream index %u out of range.\n", stream_idx);
3863 }
3864
3866 if (!buffer_impl)
3867 {
3868 const struct wined3d_stream_state *stream = &device->stateblock_state->streams[stream_idx];
3869
3870 offset = stream->offset;
3871 stride = stream->stride;
3873 }
3874 else if (buffer_impl->draw_buffer)
3875 {
3876 wined3d_buffer = buffer_impl->draw_buffer;
3877 }
3878 else
3879 {
3880 wined3d_buffer = buffer_impl->wined3d_buffer;
3881 }
3882
3884 if (SUCCEEDED(hr) && !device->recording)
3885 {
3886 if (buffer_impl && buffer_impl->draw_buffer)
3887 device->sysmem_vb |= (1u << stream_idx);
3888 else
3889 device->sysmem_vb &= ~(1u << stream_idx);
3890 }
3891
3893
3894 return hr;
3895}
3896
3898 UINT stream_idx, IDirect3DVertexBuffer9 **buffer, UINT *offset, UINT *stride)
3899{
3901 const struct wined3d_stateblock_state *state;
3902 const struct wined3d_stream_state *stream;
3903 struct d3d9_vertexbuffer *buffer_impl;
3904
3905 TRACE("iface %p, stream_idx %u, buffer %p, offset %p, stride %p.\n",
3906 iface, stream_idx, buffer, offset, stride);
3907
3908 if (!buffer)
3909 return D3DERR_INVALIDCALL;
3910
3911 if (stream_idx >= ARRAY_SIZE(state->streams))
3912 {
3913 WARN("Stream index %u out of range.\n", stream_idx);
3915 }
3916
3918 stream = &device->stateblock_state->streams[stream_idx];
3919 if (stream->buffer)
3920 {
3921 buffer_impl = wined3d_buffer_get_parent(stream->buffer);
3922 *buffer = &buffer_impl->IDirect3DVertexBuffer9_iface;
3924 }
3925 else
3926 *buffer = NULL;
3927 if (offset)
3928 *offset = stream->offset;
3929 *stride = stream->stride;
3931
3932 return D3D_OK;
3933}
3934
3936{
3938 HRESULT hr;
3939
3940 TRACE("iface %p, stream_idx %u, freq %u.\n", iface, stream_idx, freq);
3941
3943 hr = wined3d_stateblock_set_stream_source_freq(device->update_state, stream_idx, freq);
3945
3946 return hr;
3947}
3948
3950{
3952 const struct wined3d_stream_state *stream;
3953
3954 TRACE("iface %p, stream_idx %u, freq %p.\n", iface, stream_idx, freq);
3955
3957 stream = &device->stateblock_state->streams[stream_idx];
3958 *freq = stream->flags | stream->frequency;
3960
3961 return D3D_OK;
3962}
3963
3964static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 *buffer)
3965{
3969
3970 TRACE("iface %p, buffer %p.\n", iface, buffer);
3971
3972 if (!ib)
3974 else
3976
3979 if (!device->recording)
3980 device->sysmem_ib = ib && ib->sysmem;
3982
3983 return D3D_OK;
3984}
3985
3986static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)
3987{
3990 struct d3d9_indexbuffer *buffer_impl;
3991
3992 TRACE("iface %p, buffer %p.\n", iface, buffer);
3993
3994 if (!buffer)
3995 return D3DERR_INVALIDCALL;
3996
3998 if ((wined3d_buffer = device->stateblock_state->index_buffer))
3999 {
4001 *buffer = &buffer_impl->IDirect3DIndexBuffer9_iface;
4003 }
4004 else
4005 {
4006 *buffer = NULL;
4007 }
4009
4010 return D3D_OK;
4011}
4012
4014 const DWORD *byte_code, IDirect3DPixelShader9 **shader)
4015{
4017 struct d3d9_pixelshader *object;
4018 HRESULT hr;
4019
4020 TRACE("iface %p, byte_code %p, shader %p.\n", iface, byte_code, shader);
4021
4022 if (!(object = calloc(1, sizeof(*object))))
4023 {
4024 FIXME("Failed to allocate pixel shader memory.\n");
4025 return E_OUTOFMEMORY;
4026 }
4027
4028 hr = pixelshader_init(object, device, byte_code);
4029 if (FAILED(hr))
4030 {
4031 WARN("Failed to initialize pixel shader, hr %#lx.\n", hr);
4032 free(object);
4033 return hr;
4034 }
4035
4036 TRACE("Created pixel shader %p.\n", object);
4037 *shader = &object->IDirect3DPixelShader9_iface;
4038
4039 return D3D_OK;
4040}
4041
4043{
4046
4047 TRACE("iface %p, shader %p.\n", iface, shader);
4048
4051 shader_obj ? shader_obj->wined3d_shader : NULL);
4053
4054 return D3D_OK;
4055}
4056
4058{
4060 struct d3d9_pixelshader *shader_impl;
4062
4063 TRACE("iface %p, shader %p.\n", iface, shader);
4064
4065 if (!shader) return D3DERR_INVALIDCALL;
4066
4068 if ((wined3d_shader = device->stateblock_state->ps))
4069 {
4071 *shader = &shader_impl->IDirect3DPixelShader9_iface;
4073 }
4074 else
4075 {
4076 *shader = NULL;
4077 }
4079
4080 TRACE("Returning %p.\n", *shader);
4081
4082 return D3D_OK;
4083}
4084
4086 UINT reg_idx, const float *data, UINT count)
4087{
4089 HRESULT hr;
4090
4091 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
4092
4095 reg_idx, count, (const struct wined3d_vec4 *)data);
4097
4098 return hr;
4099}
4100
4102 UINT start_idx, float *constants, UINT count)
4103{
4105 HRESULT hr;
4106
4107 TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
4108
4112
4113 return hr;
4114}
4115
4117 UINT reg_idx, const int *data, UINT count)
4118{
4120 HRESULT hr;
4121
4122 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
4123
4126 reg_idx, count, (const struct wined3d_ivec4 *)data);
4128
4129 return hr;
4130}
4131
4133 UINT start_idx, int *constants, UINT count)
4134{
4136 HRESULT hr;
4137
4138 TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
4139
4143
4144 return hr;
4145}
4146
4148 UINT reg_idx, const BOOL *data, UINT count)
4149{
4151 HRESULT hr;
4152
4153 TRACE("iface %p, reg_idx %u, data %p, count %u.\n", iface, reg_idx, data, count);
4154
4156 hr = wined3d_stateblock_set_ps_consts_b(device->update_state, reg_idx, count, data);
4158
4159 return hr;
4160}
4161
4163 UINT start_idx, BOOL *constants, UINT count)
4164{
4166 HRESULT hr;
4167
4168 TRACE("iface %p, start_idx %u, constants %p, count %u.\n", iface, start_idx, constants, count);
4169
4173
4174 return hr;
4175}
4176
4178 const float *segment_count, const D3DRECTPATCH_INFO *patch_info)
4179{
4180 FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
4181 iface, handle, segment_count, patch_info);
4182 return D3D_OK;
4183}
4184
4186 const float *segment_count, const D3DTRIPATCH_INFO *patch_info)
4187{
4188 FIXME("iface %p, handle %#x, segment_count %p, patch_info %p unimplemented.\n",
4189 iface, handle, segment_count, patch_info);
4190 return D3D_OK;
4191}
4192
4194{
4195 FIXME("iface %p, handle %#x unimplemented.\n", iface, handle);
4196 return D3DERR_INVALIDCALL;
4197}
4198
4200{
4202 struct d3d9_query *object;
4203 HRESULT hr;
4204
4205 TRACE("iface %p, type %#x, query %p.\n", iface, type, query);
4206
4207 if (!(object = calloc(1, sizeof(*object))))
4208 return E_OUTOFMEMORY;
4209
4210 hr = query_init(object, device, type);
4211 if (FAILED(hr))
4212 {
4213 WARN("Failed to initialize query, hr %#lx.\n", hr);
4214 free(object);
4215 return hr;
4216 }
4217
4218 TRACE("Created query %p.\n", object);
4219 if (query) *query = &object->IDirect3DQuery9_iface;
4220 else IDirect3DQuery9_Release(&object->IDirect3DQuery9_iface);
4221
4222 return D3D_OK;
4223}
4224
4226 UINT width, UINT height, float *rows, float *columns)
4227{
4228 FIXME("iface %p, width %u, height %u, rows %p, columns %p stub!\n",
4229 iface, width, height, rows, columns);
4230
4231 return E_NOTIMPL;
4232}
4233
4235 IDirect3DSurface9 *src_surface, IDirect3DSurface9 *dst_surface, IDirect3DVertexBuffer9 *src_descs,
4236 UINT rect_count, IDirect3DVertexBuffer9 *dst_descs, D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y)
4237{
4238 FIXME("iface %p, src_surface %p, dst_surface %p, src_descs %p, rect_count %u, "
4239 "dst_descs %p, operation %#x, offset_x %u, offset_y %u stub!\n",
4240 iface, src_surface, dst_surface, src_descs, rect_count,
4241 dst_descs, operation, offset_x, offset_y);
4242
4243 return E_NOTIMPL;
4244}
4245
4247 const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override,
4248 const RGNDATA *dirty_region, DWORD flags)
4249{
4251 struct d3d9_swapchain *swapchain;
4252 unsigned int i;
4253 HRESULT hr;
4254
4255 TRACE("iface %p, src_rect %s, dst_rect %s, dst_window_override %p, dirty_region %p, flags %#lx.\n",
4256 iface, wine_dbgstr_rect(src_rect), wine_dbgstr_rect(dst_rect),
4257 dst_window_override, dirty_region, flags);
4258
4259 if (device->device_state != D3D9_DEVICE_STATE_OK)
4260 return S_PRESENT_OCCLUDED;
4261
4262 if (dirty_region)
4263 FIXME("Ignoring dirty_region %p.\n", dirty_region);
4264
4266 for (i = 0; i < device->implicit_swapchain_count; ++i)
4267 {
4268 swapchain = wined3d_swapchain_get_parent(device->implicit_swapchains[i]);
4270 src_rect, dst_rect, dst_window_override, swapchain->swap_interval, flags)))
4271 {
4273 return hr;
4274 }
4275 }
4277
4278 return D3D_OK;
4279}
4280
4282{
4283 FIXME("iface %p, priority %p stub!\n", iface, priority);
4284
4285 return E_NOTIMPL;
4286}
4287
4289{
4290 FIXME("iface %p, priority %d stub!\n", iface, priority);
4291
4292 return E_NOTIMPL;
4293}
4294
4296{
4297 FIXME("iface %p, swapchain_idx %u stub!\n", iface, swapchain_idx);
4298
4299 return E_NOTIMPL;
4300}
4301
4303 IDirect3DResource9 **resources, UINT32 resource_count)
4304{
4305 FIXME("iface %p, resources %p, resource_count %u stub!\n",
4306 iface, resources, resource_count);
4307
4308 return E_NOTIMPL;
4309}
4310
4312{
4314
4315 TRACE("iface %p, max_latency %u.\n", iface, max_latency);
4316
4317 if (max_latency > 30)
4318 return D3DERR_INVALIDCALL;
4319
4321 wined3d_device_set_max_frame_latency(device->wined3d_device, max_latency);
4323
4324 return S_OK;
4325}
4326
4328{
4330
4331 TRACE("iface %p, max_latency %p.\n", iface, max_latency);
4332
4334 *max_latency = wined3d_device_get_max_frame_latency(device->wined3d_device);
4336
4337 return S_OK;
4338}
4339
4341{
4343 struct wined3d_swapchain_desc swapchain_desc;
4344
4345 TRACE("iface %p, dst_window %p.\n", iface, dst_window);
4346
4348 wined3d_swapchain_get_desc(device->implicit_swapchains[0], &swapchain_desc);
4350
4351 if (swapchain_desc.windowed)
4352 return D3D_OK;
4353
4354 /* FIXME: This is actually supposed to check if any other device is in
4355 * fullscreen mode. */
4356 if (dst_window != swapchain_desc.device_window)
4357 return device->device_state == D3D9_DEVICE_STATE_OK ? S_PRESENT_OCCLUDED : D3D_OK;
4358
4359 return device->device_state == D3D9_DEVICE_STATE_OK ? D3D_OK : S_PRESENT_OCCLUDED;
4360}
4361
4364 BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
4365{
4367 unsigned int access = WINED3D_RESOURCE_ACCESS_GPU;
4368
4369 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %lu, "
4370 "lockable %#x, surface %p, shared_handle %p, usage %#lx.\n",
4371 iface, width, height, format, multisample_type, multisample_quality,
4372 lockable, surface, shared_handle, usage);
4373
4374 *surface = NULL;
4375
4377 {
4378 WARN("Invalid usage %#lx.\n", usage);
4379 return D3DERR_INVALIDCALL;
4380 }
4381
4382 if (shared_handle)
4383 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
4384
4385 if (lockable)
4387
4389 wined3d_multisample_type_from_d3d(multisample_type), multisample_quality,
4391}
4392
4395 HANDLE *shared_handle, DWORD usage)
4396{
4397 FIXME("iface %p, width %u, height %u, format %#x, pool %#x, surface %p, shared_handle %p, usage %#lx stub!\n",
4398 iface, width, height, format, pool, surface, shared_handle, usage);
4399
4400 return E_NOTIMPL;
4401}
4402
4404 UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality,
4405 BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
4406{
4408 DWORD flags = 0;
4409
4410 TRACE("iface %p, width %u, height %u, format %#x, multisample_type %#x, multisample_quality %lu, "
4411 "discard %#x, surface %p, shared_handle %p, usage %#lx.\n",
4412 iface, width, height, format, multisample_type, multisample_quality,
4413 discard, surface, shared_handle, usage);
4414
4416 {
4417 WARN("Invalid usage %#lx.\n", usage);
4418 return D3DERR_INVALIDCALL;
4419 }
4420
4421 if (shared_handle)
4422 FIXME("Resource sharing not implemented, *shared_handle %p.\n", *shared_handle);
4423
4424 if (discard)
4426
4427 *surface = NULL;
4429 wined3d_multisample_type_from_d3d(multisample_type), multisample_quality, usage & WINED3DUSAGE_MASK,
4431}
4432
4434 D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
4435{
4437
4438 TRACE("iface %p, present_parameters %p, mode %p.\n", iface, present_parameters, mode);
4439
4440 if (!present_parameters->Windowed == !mode)
4441 {
4442 WARN("Mode can be passed if and only if Windowed is FALSE.\n");
4443 return D3DERR_INVALIDCALL;
4444 }
4445
4446 if (mode && (mode->Width != present_parameters->BackBufferWidth
4447 || mode->Height != present_parameters->BackBufferHeight))
4448 {
4449 WARN("Mode and back buffer mismatch (mode %ux%u, backbuffer %ux%u).\n",
4450 mode->Width, mode->Height,
4451 present_parameters->BackBufferWidth, present_parameters->BackBufferHeight);
4452 return D3DERR_INVALIDCALL;
4453 }
4454
4455 return d3d9_device_reset(device, present_parameters, mode);
4456}
4457
4459 UINT swapchain_idx, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation)
4460{
4462 struct wined3d_display_mode wined3d_mode;
4463 HRESULT hr;
4464
4465 TRACE("iface %p, swapchain_idx %u, mode %p, rotation %p.\n",
4466 iface, swapchain_idx, mode, rotation);
4467
4468 if (mode->Size != sizeof(*mode))
4469 return D3DERR_INVALIDCALL;
4470
4472 hr = wined3d_device_get_display_mode(device->wined3d_device, swapchain_idx, &wined3d_mode,
4473 (enum wined3d_display_rotation *)rotation);
4475
4476 if (SUCCEEDED(hr))
4477 {
4478 mode->Width = wined3d_mode.width;
4479 mode->Height = wined3d_mode.height;
4480 mode->RefreshRate = wined3d_mode.refresh_rate;
4481 mode->Format = d3dformat_from_wined3dformat(wined3d_mode.format_id);
4482 mode->ScanLineOrdering = d3dscanlineordering_from_wined3d(wined3d_mode.scanline_ordering);
4483 }
4484
4485 return hr;
4486}
4487
4488static const struct IDirect3DDevice9ExVtbl d3d9_device_vtbl =
4489{
4490 /* IUnknown */
4494 /* IDirect3DDevice9 */
4611 /* IDirect3DDevice9Ex */
4627};
4628
4630{
4632}
4633
4635 struct wined3d_device *device)
4636{
4637 TRACE("device_parent %p, device %p.\n", device_parent, device);
4638}
4639
4641{
4642 TRACE("device_parent %p.\n", device_parent);
4643}
4644
4646{
4648
4649 TRACE("device_parent %p, activate %#x.\n", device_parent, activate);
4650
4651 if (!device->d3d_parent)
4652 return;
4653
4654 if (!activate)
4656 else if (device->d3d_parent->extended)
4658 else
4660}
4661
4663 enum wined3d_resource_type type, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx,
4664 void **parent, const struct wined3d_parent_ops **parent_ops)
4665{
4666 TRACE("device_parent %p, type %#x, wined3d_texture %p, sub_resource_idx %u, parent %p, parent_ops %p.\n",
4667 device_parent, type, wined3d_texture, sub_resource_idx, parent, parent_ops);
4668
4670 {
4671 struct d3d9_volume *d3d_volume;
4672
4673 if (!(d3d_volume = calloc(1, sizeof(*d3d_volume))))
4674 return E_OUTOFMEMORY;
4675
4676 volume_init(d3d_volume, wined3d_texture, sub_resource_idx, parent_ops);
4677 *parent = d3d_volume;
4678 TRACE("Created volume %p.\n", d3d_volume);
4679 }
4680 else if (type != WINED3D_RTYPE_TEXTURE_2D)
4681 {
4682 ERR("Unhandled resource type %#x.\n", type);
4683 return E_FAIL;
4684 }
4685
4686 return D3D_OK;
4687}
4688
4690{
4695};
4696
4697static void setup_fpu(void)
4698{
4699#if defined(__i386__) && defined(_MSC_VER)
4700 WORD cw;
4701 __asm fnstcw cw;
4702 cw = (cw & ~0xf3f) | 0x3f;
4703 __asm fldcw cw;
4704#elif defined(__i386__) || (defined(__x86_64__) && !defined(__arm64ec__) && (defined(__GNUC__) || defined(__clang__)))
4705 WORD cw;
4706 __asm__ volatile ("fnstcw %0" : "=m" (cw));
4707 cw = (cw & ~0xf3f) | 0x3f;
4708 __asm__ volatile ("fldcw %0" : : "m" (cw));
4709#else
4710 FIXME("FPU setup not implemented for this platform.\n");
4711#endif
4712}
4713
4717{
4718 struct wined3d_swapchain_desc *swapchain_desc;
4720 struct d3d9_swapchain *d3d_swapchain;
4722 unsigned int output_idx;
4723 unsigned i, count = 1;
4724 D3DCAPS9 caps;
4725 HRESULT hr;
4726
4727 static const enum wined3d_feature_level feature_levels[] =
4728 {
4736 };
4737
4738 output_idx = adapter;
4739 if (output_idx >= parent->wined3d_output_count)
4740 return D3DERR_INVALIDCALL;
4741
4742 if (mode)
4743 FIXME("Ignoring display mode.\n");
4744
4745 device->IDirect3DDevice9Ex_iface.lpVtbl = &d3d9_device_vtbl;
4746 device->IDirect3DDevice9On12_iface.lpVtbl = &d3d9on12_vtbl;
4747 device->device_parent.ops = &d3d9_wined3d_device_parent_ops;
4748 device->adapter_ordinal = adapter;
4749 device->refcount = 1;
4750
4752
4754 wined3d_adapter = wined3d_output_get_adapter(parent->wined3d_outputs[output_idx]);
4756 focus_window, flags, 4, feature_levels, ARRAY_SIZE(feature_levels),
4757 &device->device_parent, &device->wined3d_device)))
4758 {
4759 WARN("Failed to create wined3d device, hr %#lx.\n", hr);
4761 return hr;
4762 }
4763
4764 device->immediate_context = wined3d_device_get_immediate_context(device->wined3d_device);
4767 device->max_user_clip_planes = caps.MaxUserClipPlanes;
4768 device->vs_uniform_count = caps.MaxVertexShaderConst;
4771
4772 if (FAILED(hr = wined3d_stateblock_create(device->wined3d_device, NULL, WINED3D_SBT_PRIMARY, &device->state)))
4773 {
4774 ERR("Failed to create the primary stateblock, hr %#lx.\n", hr);
4775 wined3d_device_decref(device->wined3d_device);
4777 return hr;
4778 }
4779 device->stateblock_state = wined3d_stateblock_get_state(device->state);
4780 device->update_state = device->state;
4781
4784
4787
4788 if (!parameters->Windowed)
4789 {
4790 if (!focus_window)
4791 focus_window = parameters->hDeviceWindow;
4792 if (FAILED(hr = wined3d_device_acquire_focus_window(device->wined3d_device, focus_window)))
4793 {
4794 ERR("Failed to acquire focus window, hr %#lx.\n", hr);
4795 wined3d_device_decref(device->wined3d_device);
4797 return hr;
4798 }
4799 }
4800
4801 if (!(swapchain_desc = malloc(sizeof(*swapchain_desc) * count)))
4802 {
4803 ERR("Failed to allocate wined3d parameters.\n");
4805 wined3d_device_decref(device->wined3d_device);
4807 return E_OUTOFMEMORY;
4808 }
4809
4810 for (i = 0; i < count; ++i)
4811 {
4812 if (!wined3d_swapchain_desc_from_d3d9(&swapchain_desc[i],
4813 parent->wined3d_outputs[output_idx + i], &parameters[i], parent->extended))
4814 {
4816 wined3d_device_decref(device->wined3d_device);
4817 free(swapchain_desc);
4819 return D3DERR_INVALIDCALL;
4820 }
4821 swapchain_desc[i].flags |= WINED3D_SWAPCHAIN_IMPLICIT;
4823 swapchain_desc[i].flags |= WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES;
4824 }
4825
4826 if (FAILED(hr = d3d9_swapchain_create(device, swapchain_desc,
4827 wined3dswapinterval_from_d3d(parameters->PresentationInterval), &d3d_swapchain)))
4828 {
4829 WARN("Failed to create swapchain, hr %#lx.\n", hr);
4831 free(swapchain_desc);
4832 wined3d_device_decref(device->wined3d_device);
4834 return hr;
4835 }
4836
4839
4841 !!swapchain_desc->enable_auto_depth_stencil);
4843
4845 {
4848 wined3d_device_decref(device->wined3d_device);
4849 free(swapchain_desc);
4851 return E_OUTOFMEMORY;
4852 }
4853
4854 for (i = 0; i < count; ++i)
4855 {
4857 &swapchain_desc[i], parameters[i].PresentationInterval);
4858 }
4859
4861
4862 free(swapchain_desc);
4863
4864 /* We could also simply ignore the initial rendertarget since it's known
4865 * not to be a texture (we currently use these only for automatic mipmap
4866 * generation). */
4871
4872 IDirect3D9Ex_AddRef(&parent->IDirect3D9Ex_iface);
4873 device->d3d_parent = parent;
4874
4875 return D3D_OK;
4876}
#define DECLSPEC_HOTPATCH
Definition: _mingw.h:240
#define isprint(c)
Definition: acclib.h:73
COMPILER_DEPENDENT_UINT64 UINT64
Definition: actypes.h:131
static int state
Definition: maze.c:121
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
Definition: precomp.h:23
operation
Definition: copy.c:29
#define ARRAY_SIZE(A)
Definition: main.h:20
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
Definition: _map.h:48
RECT rect
Definition: combotst.c:67
void CDECL wined3d_device_context_flush_mapped_buffer(struct wined3d_device_context *context, struct wined3d_buffer *buffer)
Definition: cs.c:3533
#define D3DERR_INVALIDCALL
Definition: d3d10_private.h:42
void volume_init(struct d3d8_volume *volume, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, const struct wined3d_parent_ops **parent_ops)
Definition: volume.c:203
static enum wined3d_device_type wined3d_device_type_from_d3d(D3DDEVTYPE type)
Definition: d3d8_private.h:392
static D3DMULTISAMPLE_TYPE d3dmultisample_type_from_wined3d(enum wined3d_multisample_type type)
Definition: d3d8_private.h:387
static unsigned int wined3d_usage_from_d3d(D3DPOOL pool, DWORD usage)
Definition: d3d8_private.h:365
#define D3DPRESENTFLAGS_MASK
Definition: d3d8_private.h:37
static unsigned int wined3daccess_from_d3dpool(D3DPOOL pool, unsigned int usage)
Definition: d3d8_private.h:341
@ D3DRS_POINTSIZE
Definition: d3d8types.h:786
enum _D3DTEXTURESTAGESTATETYPE D3DTEXTURESTAGESTATETYPE
enum _D3DBACKBUFFER_TYPE D3DBACKBUFFER_TYPE
#define D3DPS_VERSION(major, minor)
Definition: d3d8types.h:474
#define D3DPRESENTFLAG_LOCKABLE_BACKBUFFER
Definition: d3d8types.h:1140
enum _D3DDEVTYPE D3DDEVTYPE
#define D3DLOCK_DISCARD
Definition: d3d8types.h:72
@ D3DFMT_L6V5U5
Definition: d3d8types.h:625
@ D3DFMT_A1R5G5B5
Definition: d3d8types.h:608
@ D3DFMT_A8P8
Definition: d3d8types.h:617
@ D3DFMT_D16
Definition: d3d8types.h:644
@ D3DFMT_X1R5G5B5
Definition: d3d8types.h:607
@ D3DFMT_D16_LOCKABLE
Definition: d3d8types.h:640
@ D3DFMT_R8G8B8
Definition: d3d8types.h:603
@ D3DFMT_R3G3B2
Definition: d3d8types.h:610
@ D3DFMT_A8L8
Definition: d3d8types.h:621
@ D3DFMT_V16U16
Definition: d3d8types.h:628
@ D3DFMT_A8R8G8B8
Definition: d3d8types.h:604
@ D3DFMT_A2B10G10R10
Definition: d3d8types.h:614
@ D3DFMT_X8L8V8U8
Definition: d3d8types.h:626
@ D3DFMT_INDEX16
Definition: d3d8types.h:649
@ D3DFMT_A8
Definition: d3d8types.h:611
@ D3DFMT_X4R4G4B4
Definition: d3d8types.h:613
@ D3DFMT_R5G6B5
Definition: d3d8types.h:606
@ D3DFMT_A8R3G3B2
Definition: d3d8types.h:612
@ D3DFMT_V8U8
Definition: d3d8types.h:624
@ D3DFMT_A4R4G4B4
Definition: d3d8types.h:609
@ D3DFMT_D24S8
Definition: d3d8types.h:643
@ D3DFMT_D32
Definition: d3d8types.h:641
@ D3DFMT_D24X8
Definition: d3d8types.h:645
@ D3DFMT_P8
Definition: d3d8types.h:618
@ D3DFMT_INDEX32
Definition: d3d8types.h:650
@ D3DFMT_UNKNOWN
Definition: d3d8types.h:601
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
@ D3DFMT_L8
Definition: d3d8types.h:620
@ D3DFMT_G16R16
Definition: d3d8types.h:615
@ D3DFMT_A2W10V10U10
Definition: d3d8types.h:630
@ D3DFMT_Q8W8V8U8
Definition: d3d8types.h:627
@ D3DFMT_D15S1
Definition: d3d8types.h:642
@ D3DFMT_D24X4S4
Definition: d3d8types.h:646
@ D3DFMT_A4L4
Definition: d3d8types.h:622
#define D3DUSAGE_WRITEONLY
Definition: d3d8types.h:93
enum _D3DSWAPEFFECT D3DSWAPEFFECT
#define D3DLOCK_NO_DIRTY_UPDATE
Definition: d3d8types.h:73
enum _D3DPOOL D3DPOOL
@ D3DSWAPEFFECT_FLIP
Definition: d3d8types.h:852
@ D3DSWAPEFFECT_DISCARD
Definition: d3d8types.h:851
@ D3DSWAPEFFECT_COPY
Definition: d3d8types.h:853
#define D3DLOCK_NOOVERWRITE
Definition: d3d8types.h:71
@ D3DPT_LINELIST
Definition: d3d8types.h:719
@ D3DPT_POINTLIST
Definition: d3d8types.h:718
@ D3DPT_TRIANGLELIST
Definition: d3d8types.h:721
@ D3DPT_LINESTRIP
Definition: d3d8types.h:720
@ D3DPT_TRIANGLEFAN
Definition: d3d8types.h:723
@ D3DPT_TRIANGLESTRIP
Definition: d3d8types.h:722
@ D3DSBT_PIXELSTATE
Definition: d3d8types.h:831
@ D3DSBT_ALL
Definition: d3d8types.h:830
@ D3DSBT_VERTEXSTATE
Definition: d3d8types.h:832
enum _D3DTRANSFORMSTATETYPE D3DTRANSFORMSTATETYPE
#define D3DLOCK_NOSYSLOCK
Definition: d3d8types.h:70
#define D3DVS_VERSION(major, minor)
Definition: d3d8types.h:475
#define D3DUSAGE_RENDERTARGET
Definition: d3d8types.h:91
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
@ D3DPOOL_SYSTEMMEM
Definition: d3d8types.h:711
@ D3DPOOL_MANAGED
Definition: d3d8types.h:710
enum _D3DFORMAT D3DFORMAT
#define D3DUSAGE_DEPTHSTENCIL
Definition: d3d8types.h:92
enum _D3DTEXTUREFILTERTYPE D3DTEXTUREFILTERTYPE
enum _D3DMULTISAMPLE_TYPE D3DMULTISAMPLE_TYPE
enum _D3DSTATEBLOCKTYPE D3DSTATEBLOCKTYPE
#define D3DLOCK_READONLY
Definition: d3d8types.h:69
#define D3DCREATE_NOWINDOWCHANGES
Definition: d3d9.h:47
#define IDirect3DSwapChain9Ex_Release(p)
Definition: d3d9.h:1717
#define IDirect3D9Ex_QueryInterface(p, a, b)
Definition: d3d9.h:1632
#define IDirect3DQuery9_Release(p)
Definition: d3d9.h:1171
#define IDirect3DSwapChain9Ex_GetBackBuffer(p, a, b, c)
Definition: d3d9.h:1721
#define IDirect3DIndexBuffer9_AddRef(p)
Definition: d3d9.h:591
#define IDirect3DSwapChain9Ex_AddRef(p)
Definition: d3d9.h:1716
#define IDirect3D9Ex_Release(p)
Definition: d3d9.h:1634
#define IDirect3DDevice9Ex_Release(p)
Definition: d3d9.h:1930
#define IDirect3DVertexShader9_AddRef(p)
Definition: d3d9.h:1050
#define S_PRESENT_OCCLUDED
Definition: d3d9.h:110
#define IDirect3D9_GetAdapterDisplayMode(p, a, b)
Definition: d3d9.h:216
#define D3DCREATE_ADAPTERGROUP_DEVICE
Definition: d3d9.h:45
#define IDirect3DVertexDeclaration9_AddRef(p)
Definition: d3d9.h:1012
#define IDirect3DVertexDeclaration9_Release(p)
Definition: d3d9.h:1013
#define IDirect3DVertexBuffer9_AddRef(p)
Definition: d3d9.h:523
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:449
#define IDirect3DDevice9Ex_AddRef(p)
Definition: d3d9.h:1929
#define IDirect3DSurface9_GetDesc(p, a)
Definition: d3d9.h:462
#define IDirect3DBaseTexture9_Release(p)
Definition: d3d9.h:663
#define IDirect3DBaseTexture9_AddRef(p)
Definition: d3d9.h:662
#define IDirect3DDevice9Ex_QueryInterface(p, a, b)
Definition: d3d9.h:1928
#define IDirect3DSurface9_Release(p)
Definition: d3d9.h:450
#define IDirect3DTexture9_Release(p)
Definition: d3d9.h:842
#define IDirect3D9Ex_AddRef(p)
Definition: d3d9.h:1633
#define IDirect3DPixelShader9_AddRef(p)
Definition: d3d9.h:1088
D3DDISPLAYROTATION
Definition: d3d9types.h:1589
enum _D3DQUERYTYPE D3DQUERYTYPE
@ D3DFMT_A32B32G32R32F
Definition: d3d9types.h:861
@ D3DFMT_CxV8U8
Definition: d3d9types.h:863
@ D3DFMT_D24FS8
Definition: d3d9types.h:843
@ D3DFMT_A16B16G16R16F
Definition: d3d9types.h:856
@ D3DFMT_D32F_LOCKABLE
Definition: d3d9types.h:842
@ D3DFMT_R32F
Definition: d3d9types.h:859
@ D3DFMT_X8B8G8R8
Definition: d3d9types.h:803
@ D3DFMT_Q16W16V16U16
Definition: d3d9types.h:852
@ D3DFMT_A2R10G10B10
Definition: d3d9types.h:805
@ D3DFMT_G32R32F
Definition: d3d9types.h:860
@ D3DFMT_A8B8G8R8
Definition: d3d9types.h:802
@ D3DFMT_A16B16G16R16
Definition: d3d9types.h:806
@ D3DFMT_L16
Definition: d3d9types.h:841
@ D3DFMT_G16R16F
Definition: d3d9types.h:855
@ D3DFMT_R16F
Definition: d3d9types.h:854
#define D3D_MAX_SIMULTANEOUS_RENDERTARGETS
Definition: d3d9types.h:193
enum _D3DSAMPLERSTATETYPE D3DSAMPLERSTATETYPE
enum _D3DCOMPOSERECTSOP D3DCOMPOSERECTSOP
@ D3DSWAPEFFECT_FLIPEX
Definition: d3d9types.h:1105
@ D3DSWAPEFFECT_OVERLAY
Definition: d3d9types.h:1104
#define D3DVERTEXTEXTURESAMPLER0
Definition: d3d9types.h:202
#define D3DLOCK_DONOTWAIT
Definition: d3d9types.h:76
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:113
#define D3DVERTEXTEXTURESAMPLER3
Definition: d3d9types.h:205
#define D3D_OK
Definition: d3d.h:106
D3DPRIMITIVETYPE
Definition: d3dtypes.h:822
D3DRENDERSTATETYPE
Definition: d3dtypes.h:874
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define E_INVALIDARG
Definition: ddrawi.h:101
#define E_NOTIMPL
Definition: ddrawi.h:99
#define E_FAIL
Definition: ddrawi.h:102
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
HRESULT hr
Definition: delayimp.cpp:582
device_type
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static void CDECL device_parent_mode_changed(struct wined3d_device_parent *device_parent)
Definition: device.c:7692
static void CDECL device_parent_activate(struct wined3d_device_parent *device_parent, BOOL activate)
Definition: device.c:7697
static HRESULT CDECL device_parent_texture_sub_resource_created(struct wined3d_device_parent *device_parent, enum wined3d_resource_type type, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
Definition: device.c:7702
static void CDECL device_parent_wined3d_device_created(struct wined3d_device_parent *device_parent, struct wined3d_device *wined3d_device)
Definition: device.c:7658
HRESULT indexbuffer_init(struct d3d8_indexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: buffer.c:605
HRESULT vertexbuffer_init(struct d3d8_vertexbuffer *buffer, struct d3d8_device *device, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool)
Definition: buffer.c:284
static D3DSWAPEFFECT d3dswapeffect_from_wined3dswapeffect(enum wined3d_swap_effect effect)
Definition: device.c:184
static enum wined3d_transform_state wined3d_transform_state_from_d3d(D3DTRANSFORMSTATETYPE state)
Definition: device.c:446
static struct d3d8_device * device_from_device_parent(struct wined3d_device_parent *device_parent)
Definition: device.c:3587
static enum wined3d_swap_interval wined3dswapinterval_from_d3d(DWORD interval)
Definition: device.c:239
static HRESULT CDECL reset_enum_callback(struct wined3d_resource *resource)
Definition: device.c:892
static enum wined3d_multisample_type wined3d_multisample_type_from_d3d(D3DMULTISAMPLE_TYPE type)
Definition: device.c:260
static UINT vertex_count_from_primitive_count(D3DPRIMITIVETYPE primitive_type, UINT primitive_count)
Definition: device.c:158
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)
Definition: device.c:3667
D3DFORMAT d3dformat_from_wined3dformat(enum wined3d_format_id format)
Definition: device.c:33
static void device_reset_viewport_state(struct d3d8_device *device)
Definition: device.c:559
static void resolve_depth_buffer(struct d3d8_device *device)
Definition: device.c:1963
static enum wined3d_primitive_type wined3d_primitive_type_from_d3d(D3DPRIMITIVETYPE type)
Definition: device.c:464
static void setup_fpu(void)
Definition: device.c:3650
static enum wined3d_render_state wined3d_render_state_from_d3d(D3DRENDERSTATETYPE state)
Definition: device.c:451
unsigned int wined3dmapflags_from_d3dmapflags(unsigned int flags, unsigned int usage)
Definition: device.c:135
static enum wined3d_swap_effect wined3dswapeffect_from_d3dswapeffect(D3DSWAPEFFECT effect)
Definition: device.c:221
static void present_parameters_from_wined3d_swapchain_desc(D3DPRESENT_PARAMETERS *present_parameters, const struct wined3d_swapchain_desc *swapchain_desc, DWORD presentation_interval)
Definition: device.c:202
enum wined3d_format_id wined3dformat_from_d3dformat(D3DFORMAT format)
Definition: device.c:84
struct d3d9_indexbuffer * unsafe_impl_from_IDirect3DIndexBuffer9(IDirect3DIndexBuffer9 *iface)
Definition: buffer.c:654
struct d3d9_vertexbuffer * unsafe_impl_from_IDirect3DVertexBuffer9(IDirect3DVertexBuffer9 *iface)
Definition: buffer.c:347
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_PresentEx(IDirect3DDevice9Ex *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region, DWORD flags)
Definition: device.c:4246
static BOOL wined3d_swapchain_desc_from_d3d9(struct wined3d_swapchain_desc *swapchain_desc, struct wined3d_output *output, const D3DPRESENT_PARAMETERS *present_parameters, BOOL extended)
Definition: device.c:303
static HRESULT WINAPI d3d9_device_SetMaximumFrameLatency(IDirect3DDevice9Ex *iface, UINT max_latency)
Definition: device.c:4311
static HRESULT WINAPI d3d9_device_SetScissorRect(IDirect3DDevice9Ex *iface, const RECT *rect)
Definition: device.c:3026
static HRESULT WINAPI d3d9_device_SetGPUThreadPriority(IDirect3DDevice9Ex *iface, INT priority)
Definition: device.c:4288
static void d3d9_device_upload_sysmem_vertex_buffers(struct d3d9_device *device, int base_vertex, unsigned int start_vertex, unsigned int vertex_count)
Definition: device.c:3123
static HRESULT WINAPI d3d9_device_SetDepthStencilSurface(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *depth_stencil)
Definition: device.c:2265
static HRESULT WINAPI d3d9_device_GetDeviceCaps(IDirect3DDevice9Ex *iface, D3DCAPS9 *caps)
Definition: device.c:827
static HRESULT WINAPI d3d9_device_SetTransform(IDirect3DDevice9Ex *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
Definition: device.c:2385
static enum wined3d_texture_filter_type wined3d_texture_filter_type_from_d3d(D3DTEXTUREFILTERTYPE type)
Definition: device.c:560
static HRESULT WINAPI d3d9_device_GetLight(IDirect3DDevice9Ex *iface, DWORD index, D3DLIGHT9 *light)
Definition: device.c:2517
static HRESULT WINAPI d3d9_device_StretchRect(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *src_surface, const RECT *src_rect, IDirect3DSurface9 *dst_surface, const RECT *dst_rect, D3DTEXTUREFILTERTYPE filter)
Definition: device.c:1985
static HRESULT WINAPI d3d9_device_GetClipStatus(IDirect3DDevice9Ex *iface, D3DCLIPSTATUS9 *clip_status)
Definition: device.c:2774
static HRESULT WINAPI d3d9_device_DrawIndexedPrimitive(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, INT base_vertex_idx, UINT min_vertex_idx, UINT vertex_count, UINT start_idx, UINT primitive_count)
Definition: device.c:3270
static float WINAPI d3d9_device_GetNPatchMode(IDirect3DDevice9Ex *iface)
Definition: device.c:3093
static HRESULT WINAPI d3d9_device_DeletePatch(IDirect3DDevice9Ex *iface, UINT handle)
Definition: device.c:4193
static HRESULT WINAPI d3d9_device_SetVertexDeclaration(IDirect3DDevice9Ex *iface, IDirect3DVertexDeclaration9 *declaration)
Definition: device.c:3519
static HRESULT WINAPI d3d9_device_SetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 *shader)
Definition: device.c:4042
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantI(IDirect3DDevice9Ex *iface, UINT reg_idx, const int *data, UINT count)
Definition: device.c:3787
static HRESULT WINAPI d3d9_device_GetClipPlane(IDirect3DDevice9Ex *iface, DWORD index, float *plane)
Definition: device.c:2578
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Reset(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters)
Definition: device.c:1315
static HRESULT WINAPI d3d9_device_SetStreamSourceFreq(IDirect3DDevice9Ex *iface, UINT stream_idx, UINT freq)
Definition: device.c:3935
static HRESULT WINAPI d3d9_device_GetVertexShader(IDirect3DDevice9Ex *iface, IDirect3DVertexShader9 **shader)
Definition: device.c:3723
static HRESULT WINAPI d3d9_device_SetNPatchMode(IDirect3DDevice9Ex *iface, float segment_count)
Definition: device.c:3079
static HRESULT WINAPI d3d9_device_CreateVolumeTexture(IDirect3DDevice9Ex *iface, UINT width, UINT height, UINT depth, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DVolumeTexture9 **texture, HANDLE *shared_handle)
Definition: device.c:1517
static HRESULT WINAPI d3d9_device_CreateVertexShader(IDirect3DDevice9Ex *iface, const DWORD *byte_code, IDirect3DVertexShader9 **shader)
Definition: device.c:3682
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_ResetEx(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
Definition: device.c:4433
static const struct IDirect3DDevice9ExVtbl d3d9_device_vtbl
Definition: device.c:4488
static HRESULT WINAPI d3d9_device_GetStreamSourceFreq(IDirect3DDevice9Ex *iface, UINT stream_idx, UINT *freq)
Definition: device.c:3949
static HRESULT WINAPI d3d9_device_GetLightEnable(IDirect3DDevice9Ex *iface, DWORD index, BOOL *enabled)
Definition: device.c:2547
static HRESULT WINAPI d3d9_device_GetFVF(IDirect3DDevice9Ex *iface, DWORD *fvf)
Definition: device.c:3657
static HRESULT WINAPI d3d9_device_SetViewport(IDirect3DDevice9Ex *iface, const D3DVIEWPORT9 *viewport)
Definition: device.c:2432
static HRESULT WINAPI d3d9_device_BeginScene(IDirect3DDevice9Ex *iface)
Definition: device.c:2315
static HRESULT WINAPI d3d9_device_GetGPUThreadPriority(IDirect3DDevice9Ex *iface, INT *priority)
Definition: device.c:4281
static HRESULT WINAPI d3d9_device_CreateVertexDeclaration(IDirect3DDevice9Ex *iface, const D3DVERTEXELEMENT9 *elements, IDirect3DVertexDeclaration9 **declaration)
Definition: device.c:3498
static HRESULT WINAPI d3d9_device_GetViewport(IDirect3DDevice9Ex *iface, D3DVIEWPORT9 *viewport)
Definition: device.c:2453
static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurfaceEx(IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
Definition: device.c:4393
static HRESULT WINAPI d3d9_device_GetRasterStatus(IDirect3DDevice9Ex *iface, UINT swapchain, D3DRASTER_STATUS *raster_status)
Definition: device.c:1389
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState(IDirect3DDevice9Ex *iface, DWORD sampler, D3DSAMPLERSTATETYPE state, DWORD value)
Definition: device.c:2960
static HRESULT WINAPI d3d9_device_TestCooperativeLevel(IDirect3DDevice9Ex *iface)
Definition: device.c:765
static HRESULT WINAPI d3d9_device_GetMaterial(IDirect3DDevice9Ex *iface, D3DMATERIAL9 *material)
Definition: device.c:2488
static HRESULT WINAPI d3d9_device_GetDisplayModeEx(IDirect3DDevice9Ex *iface, UINT swapchain_idx, D3DDISPLAYMODEEX *mode, D3DDISPLAYROTATION *rotation)
Definition: device.c:4458
static UINT WINAPI d3d9_device_GetNumberOfSwapChains(IDirect3DDevice9Ex *iface)
Definition: device.c:1041
static HRESULT WINAPI d3d9_device_CreateStateBlock(IDirect3DDevice9Ex *iface, D3DSTATEBLOCKTYPE type, IDirect3DStateBlock9 **stateblock)
Definition: device.c:2653
static HRESULT WINAPI d3d9_device_SetClipStatus(IDirect3DDevice9Ex *iface, const D3DCLIPSTATUS9 *clip_status)
Definition: device.c:2760
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantB(IDirect3DDevice9Ex *iface, UINT reg_idx, const BOOL *data, UINT count)
Definition: device.c:4147
static HRESULT WINAPI d3d9_device_GetFrontBufferData(IDirect3DDevice9Ex *iface, UINT swapchain, IDirect3DSurface9 *dst_surface)
Definition: device.c:1967
static HRESULT WINAPI d3d9_device_DrawIndexedPrimitiveUP(IDirect3DDevice9Ex *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)
Definition: device.c:3370
static void d3d9_device_upload_managed_textures(struct d3d9_device *device)
Definition: device.c:3217
static HRESULT WINAPI d3d9_device_CreateQuery(IDirect3DDevice9Ex *iface, D3DQUERYTYPE type, IDirect3DQuery9 **query)
Definition: device.c:4199
static HRESULT WINAPI d3d9_device_GetDirect3D(IDirect3DDevice9Ex *iface, IDirect3D9 **d3d9)
Definition: device.c:815
static HRESULT WINAPI d3d9_device_GetCurrentTexturePalette(IDirect3DDevice9Ex *iface, UINT *palette_idx)
Definition: device.c:3019
static HRESULT WINAPI d3d9_device_SetPaletteEntries(IDirect3DDevice9Ex *iface, UINT palette_idx, const PALETTEENTRY *entries)
Definition: device.c:2991
void d3d9_caps_from_wined3dcaps(const struct d3d9 *d3d9, unsigned int adapter_ordinal, D3DCAPS9 *caps, const struct wined3d_caps *wined3d_caps)
Definition: device.c:369
static HRESULT WINAPI d3d9_device_SetMaterial(IDirect3DDevice9Ex *iface, const D3DMATERIAL9 *material)
Definition: device.c:2474
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantB(IDirect3DDevice9Ex *iface, UINT start_idx, BOOL *constants, UINT count)
Definition: device.c:4162
static HRESULT WINAPI d3d9_device_UpdateTexture(IDirect3DDevice9Ex *iface, IDirect3DBaseTexture9 *src_texture, IDirect3DBaseTexture9 *dst_texture)
Definition: device.c:1905
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantF(IDirect3DDevice9Ex *iface, UINT start_idx, float *constants, UINT count)
Definition: device.c:3772
BOOL is_gdi_compat_wined3dformat(enum wined3d_format_id format)
Definition: device.c:1770
static HRESULT WINAPI d3d9_device_GetBackBuffer(IDirect3DDevice9Ex *iface, UINT swapchain, UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer)
Definition: device.c:1358
static ULONG WINAPI d3d9on12_Release(IDirect3DDevice9On12 *iface)
Definition: device.c:613
static HRESULT WINAPI d3d9_device_CheckDeviceState(IDirect3DDevice9Ex *iface, HWND dst_window)
Definition: device.c:4340
static void WINAPI d3d9_device_SetCursorPosition(IDirect3DDevice9Ex *iface, int x, int y, DWORD flags)
Definition: device.c:934
static HRESULT WINAPI d3d9_device_MultiplyTransform(IDirect3DDevice9Ex *iface, D3DTRANSFORMSTATETYPE state, const D3DMATRIX *matrix)
Definition: device.c:2416
static HRESULT WINAPI d3d9_device_GetDisplayMode(IDirect3DDevice9Ex *iface, UINT swapchain, D3DDISPLAYMODE *mode)
Definition: device.c:849
static HRESULT WINAPI d3d9_device_GetScissorRect(IDirect3DDevice9Ex *iface, RECT *rect)
Definition: device.c:3039
static HRESULT WINAPI d3d9_device_DrawPrimitive(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, UINT start_vertex, UINT primitive_count)
Definition: device.c:3236
static BOOL WINAPI d3d9_device_GetSoftwareVertexProcessing(IDirect3DDevice9Ex *iface)
Definition: device.c:3065
static HRESULT WINAPI d3d9_device_SetDialogBoxMode(IDirect3DDevice9Ex *iface, BOOL enable)
Definition: device.c:1405
static HRESULT WINAPI d3d9_device_GetRenderState(IDirect3DDevice9Ex *iface, D3DRENDERSTATETYPE state, DWORD *value)
Definition: device.c:2637
static HRESULT WINAPI d3d9_device_CreateRenderTargetEx(IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
Definition: device.c:4362
static void d3d9_generate_auto_mipmaps(struct d3d9_device *device)
Definition: device.c:3108
static HRESULT WINAPI d3d9_device_GetSamplerState(IDirect3DDevice9Ex *iface, DWORD sampler_idx, D3DSAMPLERSTATETYPE state, DWORD *value)
Definition: device.c:2934
static HRESULT WINAPI d3d9_device_ComposeRects(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *src_surface, IDirect3DSurface9 *dst_surface, IDirect3DVertexBuffer9 *src_descs, UINT rect_count, IDirect3DVertexBuffer9 *dst_descs, D3DCOMPOSERECTSOP operation, INT offset_x, INT offset_y)
Definition: device.c:4234
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantB(IDirect3DDevice9Ex *iface, UINT reg_idx, const BOOL *data, UINT count)
Definition: device.c:3818
static struct d3d9_device * impl_from_IDirect3DDevice9On12(IDirect3DDevice9On12 *iface)
Definition: device.c:596
static enum wined3d_sampler_state wined3d_sampler_state_from_d3d(D3DSAMPLERSTATETYPE type)
Definition: device.c:575
static HRESULT WINAPI d3d9on12_ReturnUnderlyingResource(IDirect3DDevice9On12 *iface, IDirect3DResource9 *resource, UINT fence_count, UINT64 *signal_values, ID3D12Fence **fences)
Definition: device.c:636
const struct wined3d_parent_ops d3d9_null_wined3d_parent_ops
Definition: device.c:29
static void d3d9_device_flush_mapped_vertex_buffers(struct d3d9_device *device)
Definition: device.c:3206
static HRESULT WINAPI d3d9_device_DrawPrimitiveUP(IDirect3DDevice9Ex *iface, D3DPRIMITIVETYPE primitive_type, UINT primitive_count, const void *data, UINT stride)
Definition: device.c:3313
static HRESULT WINAPI d3d9_device_SetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 *buffer)
Definition: device.c:3964
static HRESULT WINAPI d3d9on12_UnwrapUnderlyingResource(IDirect3DDevice9On12 *iface, IDirect3DResource9 *resource, ID3D12CommandQueue *queue, REFIID iid, void **out)
Definition: device.c:630
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantF(IDirect3DDevice9Ex *iface, UINT start_idx, float *constants, UINT count)
Definition: device.c:4101
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantB(IDirect3DDevice9Ex *iface, UINT start_idx, BOOL *constants, UINT count)
Definition: device.c:3833
static const struct wined3d_device_parent_ops d3d9_wined3d_device_parent_ops
Definition: device.c:4689
static HRESULT d3d9_device_reset(struct d3d9_device *device, D3DPRESENT_PARAMETERS *present_parameters, D3DDISPLAYMODEEX *mode)
Definition: device.c:1119
static HRESULT WINAPI d3d9_device_SetTexture(IDirect3DDevice9Ex *iface, DWORD stage, IDirect3DBaseTexture9 *texture)
Definition: device.c:2827
static BOOL WINAPI d3d9_device_ShowCursor(IDirect3DDevice9Ex *iface, BOOL show)
Definition: device.c:945
static HRESULT WINAPI d3d9_device_SetCurrentTexturePalette(IDirect3DDevice9Ex *iface, UINT palette_idx)
Definition: device.c:3012
static HRESULT WINAPI d3d9_device_Clear(IDirect3DDevice9Ex *iface, DWORD rect_count, const D3DRECT *rects, DWORD flags, D3DCOLOR color, float z, DWORD stencil)
Definition: device.c:2358
static HRESULT d3d9_device_upload_sysmem_index_buffer(struct d3d9_device *device, unsigned int *start_idx, unsigned int idx_count)
Definition: device.c:3169
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_GetSwapChain(IDirect3DDevice9Ex *iface, UINT swapchain_idx, IDirect3DSwapChain9 **swapchain)
Definition: device.c:1014
static HRESULT WINAPI d3d9on12_QueryInterface(IDirect3DDevice9On12 *iface, REFIID iid, void **out)
Definition: device.c:601
static HRESULT WINAPI d3d9_device_GetTexture(IDirect3DDevice9Ex *iface, DWORD stage, IDirect3DBaseTexture9 **texture)
Definition: device.c:2788
static void d3d9_rts_flag_auto_gen_mipmap(struct d3d9_device *device)
Definition: device.c:2345
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurfaceEx(IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle, DWORD usage)
Definition: device.c:4403
static const struct IDirect3DDevice9On12Vtbl d3d9on12_vtbl
Definition: device.c:642
static HRESULT WINAPI d3d9_device_GetCreationParameters(IDirect3DDevice9Ex *iface, D3DDEVICE_CREATION_PARAMETERS *parameters)
Definition: device.c:872
static HRESULT WINAPI d3d9_device_CreateVertexBuffer(IDirect3DDevice9Ex *iface, UINT size, DWORD usage, DWORD fvf, D3DPOOL pool, IDirect3DVertexBuffer9 **buffer, HANDLE *shared_handle)
Definition: device.c:1620
static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD value)
Definition: device.c:2914
static HRESULT WINAPI d3d9_device_UpdateSurface(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *src_surface, const RECT *src_rect, IDirect3DSurface9 *dst_surface, const POINT *dst_point)
Definition: device.c:1851
static HRESULT WINAPI d3d9_device_BeginStateBlock(IDirect3DDevice9Ex *iface)
Definition: device.c:2694
static ULONG WINAPI d3d9on12_AddRef(IDirect3DDevice9On12 *iface)
Definition: device.c:607
static ULONG WINAPI DECLSPEC_HOTPATCH d3d9_device_Release(IDirect3DDevice9Ex *iface)
Definition: device.c:716
static HRESULT WINAPI d3d9_device_CreateCubeTexture(IDirect3DDevice9Ex *iface, UINT edge_length, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DCubeTexture9 **texture, HANDLE *shared_handle)
Definition: device.c:1564
static HRESULT WINAPI d3d9_device_GetRenderTarget(IDirect3DDevice9Ex *iface, DWORD idx, IDirect3DSurface9 **surface)
Definition: device.c:2228
static HRESULT WINAPI d3d9_device_SetCursorProperties(IDirect3DDevice9Ex *iface, UINT hotspot_x, UINT hotspot_y, IDirect3DSurface9 *bitmap)
Definition: device.c:888
static HRESULT WINAPI d3d9_device_GetVertexShaderConstantI(IDirect3DDevice9Ex *iface, UINT start_idx, int *constants, UINT count)
Definition: device.c:3803
static HRESULT WINAPI d3d9on12_GetD3D12Device(IDirect3DDevice9On12 *iface, REFIID iid, void **out)
Definition: device.c:619
static HRESULT WINAPI d3d9_device_GetStreamSource(IDirect3DDevice9Ex *iface, UINT stream_idx, IDirect3DVertexBuffer9 **buffer, UINT *offset, UINT *stride)
Definition: device.c:3897
static HRESULT WINAPI d3d9_device_SetLight(IDirect3DDevice9Ex *iface, DWORD index, const D3DLIGHT9 *light)
Definition: device.c:2502
static HRESULT WINAPI d3d9_device_SetSoftwareVertexProcessing(IDirect3DDevice9Ex *iface, BOOL software)
Definition: device.c:3052
static HRESULT WINAPI d3d9_device_EndStateBlock(IDirect3DDevice9Ex *iface, IDirect3DStateBlock9 **stateblock)
Definition: device.c:2717
static HRESULT WINAPI d3d9_device_CreatePixelShader(IDirect3DDevice9Ex *iface, const DWORD *byte_code, IDirect3DPixelShader9 **shader)
Definition: device.c:4013
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_Present(IDirect3DDevice9Ex *iface, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, const RGNDATA *dirty_region)
Definition: device.c:1325
static HRESULT WINAPI d3d9_device_GetPixelShaderConstantI(IDirect3DDevice9Ex *iface, UINT start_idx, int *constants, UINT count)
Definition: device.c:4132
static void STDMETHODCALLTYPE d3d9_null_wined3d_object_destroyed(void *parent)
Definition: device.c:27
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_CreateAdditionalSwapChain(IDirect3DDevice9Ex *iface, D3DPRESENT_PARAMETERS *present_parameters, IDirect3DSwapChain9 **swapchain)
Definition: device.c:959
static HRESULT WINAPI d3d9_device_GetVertexDeclaration(IDirect3DDevice9Ex *iface, IDirect3DVertexDeclaration9 **declaration)
Definition: device.c:3535
static HRESULT WINAPI d3d9_device_GetPixelShader(IDirect3DDevice9Ex *iface, IDirect3DPixelShader9 **shader)
Definition: device.c:4057
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_EndScene(IDirect3DDevice9Ex *iface)
Definition: device.c:2330
static HRESULT WINAPI d3d9_device_SetFVF(IDirect3DDevice9Ex *iface, DWORD fvf)
Definition: device.c:3630
static HRESULT WINAPI d3d9_device_CheckResourceResidency(IDirect3DDevice9Ex *iface, IDirect3DResource9 **resources, UINT32 resource_count)
Definition: device.c:4302
static HRESULT WINAPI d3d9_device_SetVertexShader(IDirect3DDevice9Ex *iface, IDirect3DVertexShader9 *shader)
Definition: device.c:3708
static ULONG WINAPI d3d9_device_AddRef(IDirect3DDevice9Ex *iface)
Definition: device.c:706
static HRESULT WINAPI d3d9_device_SetConvolutionMonoKernel(IDirect3DDevice9Ex *iface, UINT width, UINT height, float *rows, float *columns)
Definition: device.c:4225
static HRESULT WINAPI d3d9_device_CreateIndexBuffer(IDirect3DDevice9Ex *iface, UINT size, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DIndexBuffer9 **buffer, HANDLE *shared_handle)
Definition: device.c:1664
static HRESULT WINAPI d3d9_device_WaitForVBlank(IDirect3DDevice9Ex *iface, UINT swapchain_idx)
Definition: device.c:4295
static void WINAPI d3d9_device_GetGammaRamp(IDirect3DDevice9Ex *iface, UINT swapchain, D3DGAMMARAMP *ramp)
Definition: device.c:1432
static HRESULT WINAPI d3d9_device_GetTextureStageState(IDirect3DDevice9Ex *iface, DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
Definition: device.c:2894
static HRESULT WINAPI d3d9_device_ProcessVertices(IDirect3DDevice9Ex *iface, UINT src_start_idx, UINT dst_idx, UINT vertex_count, IDirect3DVertexBuffer9 *dst_buffer, IDirect3DVertexDeclaration9 *declaration, DWORD flags)
Definition: device.c:3441
static HRESULT WINAPI d3d9_device_GetPaletteEntries(IDirect3DDevice9Ex *iface, UINT palette_idx, PALETTEENTRY *entries)
Definition: device.c:3004
static HRESULT d3d9_device_create_surface(struct d3d9_device *device, unsigned int flags, enum wined3d_format_id format, enum wined3d_multisample_type multisample_type, unsigned int multisample_quality, unsigned int usage, unsigned int bind_flags, unsigned int access, unsigned int width, unsigned int height, void *user_mem, IDirect3DSurface9 **surface)
Definition: device.c:1708
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantI(IDirect3DDevice9Ex *iface, UINT reg_idx, const int *data, UINT count)
Definition: device.c:4116
static HRESULT WINAPI d3d9_device_CreateRenderTarget(IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL lockable, IDirect3DSurface9 **surface, HANDLE *shared_handle)
Definition: device.c:1786
static HRESULT WINAPI d3d9_device_CreateDepthStencilSurface(IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, BOOL discard, IDirect3DSurface9 **surface, HANDLE *shared_handle)
Definition: device.c:1818
static HRESULT WINAPI d3d9_device_QueryInterface(IDirect3DDevice9Ex *iface, REFIID riid, void **out)
Definition: device.c:654
static void wined3d_color_from_d3dcolor(struct wined3d_color *wined3d_colour, D3DCOLOR d3d_colour)
Definition: device.c:34
static struct wined3d_vertex_declaration * device_get_fvf_declaration(struct d3d9_device *device, DWORD fvf)
Definition: device.c:3563
static HRESULT WINAPI d3d9_device_SetClipPlane(IDirect3DDevice9Ex *iface, DWORD index, const float *plane)
Definition: device.c:2562
static HRESULT WINAPI d3d9_device_SetPixelShaderConstantF(IDirect3DDevice9Ex *iface, UINT reg_idx, const float *data, UINT count)
Definition: device.c:4085
static HRESULT WINAPI d3d9_device_GetTransform(IDirect3DDevice9Ex *iface, D3DTRANSFORMSTATETYPE state, D3DMATRIX *matrix)
Definition: device.c:2401
static HRESULT WINAPI d3d9_device_CreateTexture(IDirect3DDevice9Ex *iface, UINT width, UINT height, UINT levels, DWORD usage, D3DFORMAT format, D3DPOOL pool, IDirect3DTexture9 **texture, HANDLE *shared_handle)
Definition: device.c:1444
static HRESULT WINAPI d3d9_device_LightEnable(IDirect3DDevice9Ex *iface, DWORD index, BOOL enable)
Definition: device.c:2533
static HRESULT d3d9_device_get_swapchains(struct d3d9_device *device)
Definition: device.c:1103
static HRESULT WINAPI d3d9_device_DrawTriPatch(IDirect3DDevice9Ex *iface, UINT handle, const float *segment_count, const D3DTRIPATCH_INFO *patch_info)
Definition: device.c:4185
static HRESULT WINAPI d3d9_device_GetDepthStencilSurface(IDirect3DDevice9Ex *iface, IDirect3DSurface9 **depth_stencil)
Definition: device.c:2284
static HRESULT WINAPI d3d9_device_GetIndices(IDirect3DDevice9Ex *iface, IDirect3DIndexBuffer9 **buffer)
Definition: device.c:3986
static HRESULT WINAPI d3d9_device_SetStreamSource(IDirect3DDevice9Ex *iface, UINT stream_idx, IDirect3DVertexBuffer9 *buffer, UINT offset, UINT stride)
Definition: device.c:3848
static void WINAPI d3d9_device_SetGammaRamp(IDirect3DDevice9Ex *iface, UINT swapchain, DWORD flags, const D3DGAMMARAMP *ramp)
Definition: device.c:1419
static HRESULT WINAPI d3d9_device_ValidateDevice(IDirect3DDevice9Ex *iface, DWORD *pass_count)
Definition: device.c:2977
static UINT WINAPI d3d9_device_GetAvailableTextureMem(IDirect3DDevice9Ex *iface)
Definition: device.c:788
static HRESULT WINAPI d3d9_device_CreateOffscreenPlainSurface(IDirect3DDevice9Ex *iface, UINT width, UINT height, D3DFORMAT format, D3DPOOL pool, IDirect3DSurface9 **surface, HANDLE *shared_handle)
Definition: device.c:2136
static HRESULT WINAPI d3d9_device_GetMaximumFrameLatency(IDirect3DDevice9Ex *iface, UINT *max_latency)
Definition: device.c:4327
static HRESULT WINAPI d3d9_device_SetRenderTarget(IDirect3DDevice9Ex *iface, DWORD idx, IDirect3DSurface9 *surface)
Definition: device.c:2186
static HRESULT WINAPI d3d9_device_DrawRectPatch(IDirect3DDevice9Ex *iface, UINT handle, const float *segment_count, const D3DRECTPATCH_INFO *patch_info)
Definition: device.c:4177
static HRESULT WINAPI d3d9_device_GetRenderTargetData(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *render_target, IDirect3DSurface9 *dst_surface)
Definition: device.c:1933
static HRESULT WINAPI d3d9_device_SetVertexShaderConstantF(IDirect3DDevice9Ex *iface, UINT reg_idx, const float *data, UINT count)
Definition: device.c:3749
static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetRenderState(IDirect3DDevice9Ex *iface, D3DRENDERSTATETYPE state, DWORD value)
Definition: device.c:2621
static HRESULT WINAPI d3d9_device_EvictManagedResources(IDirect3DDevice9Ex *iface)
Definition: device.c:802
static HRESULT WINAPI d3d9_device_ColorFill(IDirect3DDevice9Ex *iface, IDirect3DSurface9 *surface, const RECT *rect, D3DCOLOR color)
Definition: device.c:2074
HRESULT CDECL wined3d_streaming_buffer_upload(struct wined3d_device *device, struct wined3d_streaming_buffer *buffer, const void *data, unsigned int size, unsigned int stride, unsigned int *ret_pos)
Definition: buffer.c:1422
void *CDECL wined3d_buffer_get_parent(const struct wined3d_buffer *buffer)
Definition: buffer.c:476
struct wined3d_resource *CDECL wined3d_buffer_get_resource(struct wined3d_buffer *buffer)
Definition: buffer.c:520
void CDECL wined3d_device_context_draw(struct wined3d_device_context *context, unsigned int start_vertex, unsigned int vertex_count, unsigned int start_instance, unsigned int instance_count)
Definition: device.c:2635
void CDECL wined3d_device_context_set_primitive_type(struct wined3d_device_context *context, enum wined3d_primitive_type primitive_type, unsigned int patch_vertex_count)
Definition: device.c:3779
void CDECL wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software)
Definition: device.c:4025
void CDECL wined3d_device_get_creation_parameters(const struct wined3d_device *device, struct wined3d_device_creation_parameters *parameters)
Definition: device.c:5274
BOOL CDECL wined3d_device_get_software_vertex_processing(const struct wined3d_device *device)
Definition: device.c:4040
void CDECL wined3d_device_set_max_frame_latency(struct wined3d_device *device, unsigned int latency)
Definition: device.c:2717
HRESULT CDECL wined3d_device_acquire_focus_window(struct wined3d_device *device, HWND window)
Definition: device.c:1133
HRESULT CDECL wined3d_device_get_clip_status(const struct wined3d_device *device, struct wined3d_clip_status *clip_status)
Definition: device.c:1820
void CDECL wined3d_device_context_resolve_sub_resource(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, enum wined3d_format_id format_id)
Definition: device.c:4417
HRESULT CDECL wined3d_device_context_set_rendertarget_views(struct wined3d_device_context *context, unsigned int start_idx, unsigned int count, struct wined3d_rendertarget_view *const *views, BOOL set_viewport)
Definition: device.c:2377
void CDECL wined3d_device_set_cursor_position(struct wined3d_device *device, int x_screen_space, int y_screen_space, uint32_t flags)
Definition: device.c:4845
void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
Definition: device.c:4923
struct wined3d_rendertarget_view *CDECL wined3d_device_context_get_depth_stencil_view(const struct wined3d_device_context *context)
Definition: device.c:4676
HRESULT CDECL wined3d_device_set_clip_status(struct wined3d_device *device, const struct wined3d_clip_status *clip_status)
Definition: device.c:1809
HRESULT CDECL wined3d_device_context_copy_sub_resource_region(struct wined3d_device_context *context, struct wined3d_resource *dst_resource, unsigned int dst_sub_resource_idx, unsigned int dst_x, unsigned int dst_y, unsigned int dst_z, struct wined3d_resource *src_resource, unsigned int src_sub_resource_idx, const struct wined3d_box *src_box, unsigned int flags)
Definition: device.c:4220
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1754
ULONG CDECL wined3d_device_decref(struct wined3d_device *device)
Definition: device.c:251
void CDECL wined3d_device_context_get_scissor_rects(const struct wined3d_device_context *context, unsigned int *rect_count, RECT *rects)
Definition: device.c:1890
HRESULT CDECL wined3d_device_clear(struct wined3d_device *device, unsigned int rect_count, const RECT *rects, uint32_t flags, const struct wined3d_color *color, float depth, unsigned int stencil)
Definition: device.c:3729
HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, const struct wined3d_swapchain_desc *swapchain_desc, const struct wined3d_display_mode *mode, wined3d_device_reset_cb callback, BOOL reset_state)
Definition: device.c:4970
HRESULT CDECL wined3d_device_set_cursor_properties(struct wined3d_device *device, UINT x_hotspot, UINT y_hotspot, struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: device.c:4752
HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, struct wined3d_texture *src_texture, struct wined3d_texture *dst_texture)
Definition: device.c:3808
struct wined3d_rendertarget_view *CDECL wined3d_device_context_get_rendertarget_view(const struct wined3d_device_context *context, unsigned int view_idx)
Definition: device.c:4659
unsigned int CDECL wined3d_device_get_max_frame_latency(const struct wined3d_device *device)
Definition: device.c:2729
HRESULT CDECL wined3d_device_set_dialog_box_mode(struct wined3d_device *device, BOOL enable_dialogs)
Definition: device.c:5264
void CDECL wined3d_device_set_multithreaded(struct wined3d_device *device)
Definition: device.c:1746
float CDECL wined3d_device_get_npatch_mode(const struct wined3d_device *device)
Definition: device.c:4087
void CDECL wined3d_device_set_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, uint32_t flags, const struct wined3d_gamma_ramp *ramp)
Definition: device.c:5289
HRESULT CDECL wined3d_device_end_scene(struct wined3d_device *device)
Definition: device.c:3715
HRESULT CDECL wined3d_device_context_clear_rendertarget_view(struct wined3d_device_context *context, struct wined3d_rendertarget_view *view, const RECT *rect, unsigned int flags, const struct wined3d_color *color, float depth, unsigned int stencil)
Definition: device.c:4468
void CDECL wined3d_device_context_get_viewports(const struct wined3d_device_context *context, unsigned int *viewport_count, struct wined3d_viewport *viewports)
Definition: device.c:1844
struct wined3d_device_context *CDECL wined3d_device_get_immediate_context(struct wined3d_device *device)
Definition: device.c:1969
BOOL CDECL wined3d_device_show_cursor(struct wined3d_device *device, BOOL show)
Definition: device.c:4874
void CDECL wined3d_device_release_focus_window(struct wined3d_device *device)
Definition: device.c:1154
HRESULT CDECL wined3d_device_validate_device(const struct wined3d_device *device, const struct wined3d_stateblock_state *state, DWORD *num_passes)
Definition: device.c:3963
struct wined3d_swapchain *CDECL wined3d_device_get_swapchain(const struct wined3d_device *device, UINT swapchain_idx)
Definition: device.c:501
void CDECL wined3d_device_context_draw_indexed(struct wined3d_device_context *context, int base_vertex_index, unsigned int start_index, unsigned int index_count, unsigned int start_instance, unsigned int instance_count)
Definition: device.c:2649
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, struct wined3d_caps *caps)
Definition: device.c:3679
void CDECL wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp)
Definition: device.c:5301
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)
Definition: device.c:3686
HRESULT CDECL wined3d_device_set_npatch_mode(struct wined3d_device *device, float segments)
Definition: device.c:4069
UINT CDECL wined3d_device_get_swapchain_count(const struct wined3d_device *device)
Definition: device.c:494
HRESULT CDECL wined3d_device_begin_scene(struct wined3d_device *device)
Definition: device.c:3700
HRESULT CDECL wined3d_device_context_set_depth_stencil_view(struct wined3d_device_context *context, struct wined3d_rendertarget_view *view)
Definition: device.c:2453
HRESULT CDECL wined3d_device_get_raster_status(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_raster_status *raster_status)
Definition: device.c:4055
HRESULT CDECL wined3d_device_process_vertices(struct wined3d_device *device, struct wined3d_stateblock *stateblock, UINT src_start_idx, UINT dst_idx, UINT vertex_count, struct wined3d_buffer *dst_buffer, const struct wined3d_vertex_declaration *declaration, uint32_t flags, uint32_t dst_fvf)
Definition: device.c:3598
void CDECL wined3d_device_context_set_index_buffer(struct wined3d_device_context *context, struct wined3d_buffer *buffer, enum wined3d_format_id format_id, unsigned int offset)
Definition: device.c:2557
HRESULT CDECL wined3d_resource_unmap(struct wined3d_resource *resource, unsigned int sub_resource_idx)
Definition: resource.c:304
void *CDECL wined3d_resource_get_parent(const struct wined3d_resource *resource)
Definition: resource.c:269
void CDECL wined3d_resource_get_desc(const struct wined3d_resource *resource, struct wined3d_resource_desc *desc)
Definition: resource.c:280
HRESULT CDECL wined3d_resource_map(struct wined3d_resource *resource, unsigned int sub_resource_idx, struct wined3d_map_desc *map_desc, const struct wined3d_box *box, uint32_t flags)
Definition: resource.c:295
void *CDECL wined3d_shader_get_parent(const struct wined3d_shader *shader)
Definition: shader.c:2605
void *CDECL wined3d_texture_get_parent(const struct wined3d_texture *texture)
Definition: texture.c:1690
HRESULT CDECL wined3d_texture_get_sub_resource_desc(const struct wined3d_texture *texture, unsigned int sub_resource_idx, struct wined3d_sub_resource_desc *desc)
Definition: texture.c:4055
struct wined3d_texture *__cdecl wined3d_texture_from_resource(struct wined3d_resource *resource)
Definition: texture.c:3343
HRESULT CDECL wined3d_texture_create(struct wined3d_device *device, const struct wined3d_resource_desc *desc, UINT layer_count, UINT level_count, uint32_t flags, const struct wined3d_sub_resource_data *data, void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_texture **texture)
Definition: texture.c:4158
void *CDECL wined3d_texture_get_sub_resource_parent(struct wined3d_texture *texture, unsigned int sub_resource_idx)
Definition: texture.c:4033
struct wined3d_resource *CDECL wined3d_texture_get_resource(struct wined3d_texture *texture)
Definition: texture.c:1649
ULONG CDECL wined3d_texture_decref(struct wined3d_texture *texture)
Definition: texture.c:1606
HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, unsigned int sub_resource_idx, void *mem, unsigned int pitch)
Definition: texture.c:1868
UINT CDECL wined3d_texture_get_level_count(const struct wined3d_texture *texture)
Definition: texture.c:1746
HRESULT CDECL wined3d_device_context_blt(struct wined3d_device_context *context, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, const RECT *dst_rect, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, const RECT *src_rect, unsigned int flags, const struct wined3d_blt_fx *fx, enum wined3d_texture_filter_type filter)
Definition: texture.c:3854
unsigned int idx
Definition: utils.c:40
void *CDECL wined3d_rendertarget_view_get_sub_resource_parent(const struct wined3d_rendertarget_view *view)
Definition: view.c:407
struct wined3d_resource *CDECL wined3d_rendertarget_view_get_resource(const struct wined3d_rendertarget_view *view)
Definition: view.c:430
#define CDECL
Definition: compat.h:29
return ret
Definition: mutex.c:147
r parent
Definition: btrfs.c:3010
#define D3DCAPS2_RESERVED
Definition: d3d8caps.h:23
#define D3DDEVCAPS_EXECUTESYSTEMMEMORY
Definition: d3d8caps.h:36
#define D3DPRESENT_INTERVAL_THREE
Definition: d3d8caps.h:31
#define D3DPTEXTURECAPS_CUBEMAP_POW2
Definition: d3d8caps.h:126
#define D3DDEVCAPS_CANRENDERAFTERFLIP
Definition: d3d8caps.h:43
#define D3DVTXPCAPS_LOCALVIEWER
Definition: d3d8caps.h:185
#define D3DPTEXTURECAPS_PROJECTED
Definition: d3d8caps.h:120
#define D3DPRASTERCAPS_WBUFFER
Definition: d3d8caps.h:83
#define D3DDEVCAPS_HWTRANSFORMANDLIGHT
Definition: d3d8caps.h:48
#define D3DPTFILTERCAPS_MIPFLINEAR
Definition: d3d8caps.h:132
#define D3DDEVCAPS_TEXTUREVIDEOMEMORY
Definition: d3d8caps.h:41
#define D3DDEVCAPS_DRAWPRIMITIVES2
Definition: d3d8caps.h:45
#define D3DDEVCAPS_TEXTURESYSTEMMEMORY
Definition: d3d8caps.h:40
#define D3DPTFILTERCAPS_MINFANISOTROPIC
Definition: d3d8caps.h:130
#define D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE
Definition: d3d8caps.h:117
#define D3DDEVCAPS_QUINTICRTPATCHES
Definition: d3d8caps.h:52
#define D3DVTXPCAPS_MATERIALSOURCE7
Definition: d3d8caps.h:182
#define D3DPTFILTERCAPS_MINFLINEAR
Definition: d3d8caps.h:129
#define D3DPTEXTURECAPS_SQUAREONLY
Definition: d3d8caps.h:116
#define D3DDEVCAPS_DRAWPRIMITIVES2EX
Definition: d3d8caps.h:47
#define D3DPTFILTERCAPS_MAGFANISOTROPIC
Definition: d3d8caps.h:135
#define D3DPTEXTURECAPS_ALPHAPALETTE
Definition: d3d8caps.h:118
#define D3DPSHADECAPS_COLORGOURAUDRGB
Definition: d3d8caps.h:109
#define D3DPRASTERCAPS_ZBUFFERLESSHSR
Definition: d3d8caps.h:80
#define D3DDEVCAPS_EXECUTEVIDEOMEMORY
Definition: d3d8caps.h:37
#define D3DPRASTERCAPS_WFOG
Definition: d3d8caps.h:84
#define D3DPSHADECAPS_FOGGOURAUD
Definition: d3d8caps.h:112
#define D3DPRESENT_INTERVAL_TWO
Definition: d3d8caps.h:30
#define D3DPTEXTURECAPS_ALPHA
Definition: d3d8caps.h:115
#define D3DDEVCAPS_SEPARATETEXTUREMEMORIES
Definition: d3d8caps.h:46
#define D3DPSHADECAPS_SPECULARGOURAUDRGB
Definition: d3d8caps.h:110
#define D3DPTEXTURECAPS_VOLUMEMAP
Definition: d3d8caps.h:122
#define D3DPRESENT_INTERVAL_FOUR
Definition: d3d8caps.h:32
#define D3DPTEXTURECAPS_VOLUMEMAP_POW2
Definition: d3d8caps.h:127
#define D3DPRESENT_INTERVAL_IMMEDIATE
Definition: d3d8caps.h:33
#define D3DDEVCAPS_DRAWPRIMTLVERTEX
Definition: d3d8caps.h:42
#define D3DPRASTERCAPS_ANISOTROPY
Definition: d3d8caps.h:82
#define D3DVTXPCAPS_DIRECTIONALLIGHTS
Definition: d3d8caps.h:183
#define D3DDEVCAPS_TLVERTEXSYSTEMMEMORY
Definition: d3d8caps.h:38
#define D3DPRASTERCAPS_COLORPERSPECTIVE
Definition: d3d8caps.h:86
#define D3DDEVCAPS_RTPATCHES
Definition: d3d8caps.h:53
#define D3DCAPS2_CANCALIBRATEGAMMA
Definition: d3d8caps.h:22
#define D3DDEVCAPS_NPATCHES
Definition: d3d8caps.h:55
#define D3DPRASTERCAPS_ZFOG
Definition: d3d8caps.h:85
#define D3DDEVCAPS_RTPATCHHANDLEZERO
Definition: d3d8caps.h:54
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL
Definition: d3d8caps.h:119
#define D3DPRESENT_INTERVAL_ONE
Definition: d3d8caps.h:29
#define D3DPRASTERCAPS_FOGRANGE
Definition: d3d8caps.h:81
#define D3DPSHADECAPS_ALPHAGOURAUDBLEND
Definition: d3d8caps.h:111
#define D3DPTEXTURECAPS_PERSPECTIVE
Definition: d3d8caps.h:113
#define D3DDEVCAPS_HWRASTERIZATION
Definition: d3d8caps.h:50
#define D3DVTXPCAPS_TWEENING
Definition: d3d8caps.h:186
#define D3DPRASTERCAPS_FOGVERTEX
Definition: d3d8caps.h:75
#define D3DPTFILTERCAPS_MAGFLINEAR
Definition: d3d8caps.h:134
#define D3DPTFILTERCAPS_MINFPOINT
Definition: d3d8caps.h:128
#define D3DPTEXTURECAPS_CUBEMAP
Definition: d3d8caps.h:121
#define D3DDEVCAPS_TEXTURENONLOCALVIDMEM
Definition: d3d8caps.h:44
#define D3DVTXPCAPS_TEXGEN
Definition: d3d8caps.h:181
#define D3DCAPS2_DYNAMICTEXTURES
Definition: d3d8caps.h:25
#define D3DDEVCAPS_CANBLTSYSTONONLOCAL
Definition: d3d8caps.h:49
#define D3DPRASTERCAPS_FOGTABLE
Definition: d3d8caps.h:76
#define D3DCAPS2_CANMANAGERESOURCE
Definition: d3d8caps.h:24
#define D3DPTEXTURECAPS_MIPCUBEMAP
Definition: d3d8caps.h:125
#define D3DPTFILTERCAPS_MIPFPOINT
Definition: d3d8caps.h:131
#define D3DDEVCAPS_TLVERTEXVIDEOMEMORY
Definition: d3d8caps.h:39
#define D3DPRASTERCAPS_ZTEST
Definition: d3d8caps.h:74
#define D3DVTXPCAPS_POSITIONALLIGHTS
Definition: d3d8caps.h:184
#define D3DDEVCAPS_PUREDEVICE
Definition: d3d8caps.h:51
#define D3DCAPS2_FULLSCREENGAMMA
Definition: d3d8caps.h:20
#define D3DPTEXTURECAPS_MIPMAP
Definition: d3d8caps.h:123
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
#define D3DPRESENT_INTERVAL_DEFAULT
Definition: d3d8caps.h:28
#define D3DPTFILTERCAPS_MAGFPOINT
Definition: d3d8caps.h:133
#define D3DPRASTERCAPS_MIPMAPLODBIAS
Definition: d3d8caps.h:78
#define D3DPTEXTURECAPS_MIPVOLUMEMAP
Definition: d3d8caps.h:124
#define D3DPRASTERCAPS_DITHER
Definition: d3d8caps.h:72
#define D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER
Definition: d3d9caps.h:200
#define D3DDEVCAPS2_ADAPTIVETESSNPATCH
Definition: d3d9caps.h:204
#define D3DDEVCAPS2_ADAPTIVETESSRTPATCH
Definition: d3d9caps.h:203
#define D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS
Definition: d3d9caps.h:92
#define D3DPTEXTURECAPS_NOPROJECTEDBUMPENV
Definition: d3d9caps.h:136
#define D3DDEVCAPS2_DMAPNPATCH
Definition: d3d9caps.h:202
#define D3DPRASTERCAPS_SCISSORTEST
Definition: d3d9caps.h:91
#define D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES
Definition: d3d9caps.h:205
#define D3DPRASTERCAPS_DEPTHBIAS
Definition: d3d9caps.h:93
#define D3DDEVCAPS2_STREAMOFFSET
Definition: d3d9caps.h:201
#define D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH
Definition: d3d9caps.h:206
#define D3DPTFILTERCAPS_MINFGAUSSIANQUAD
Definition: d3d9caps.h:141
#define D3DPTFILTERCAPS_MINFPYRAMIDALQUAD
Definition: d3d9caps.h:140
#define D3DCAPS2_CANAUTOGENMIPMAP
Definition: d3d9caps.h:22
#define D3DPRASTERCAPS_MULTISAMPLE_TOGGLE
Definition: d3d9caps.h:94
#define D3DPTFILTERCAPS_MAGFGAUSSIANQUAD
Definition: d3d9caps.h:148
#define D3DVTXPCAPS_TEXGEN_SPHEREMAP
Definition: d3d9caps.h:199
#define D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET
Definition: d3d9caps.h:207
#define D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD
Definition: d3d9caps.h:147
DWORD IDirect3DSurface9
Definition: dxva2api.idl:23
DWORD IDirect3DDevice9Ex
Definition: dxvahd.idl:22
static void depth_stencil(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
Definition: ffp_gl.c:766
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
FxCmResList * resources
return adapter
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum GLenum GLsizei const GLuint GLboolean enabled
Definition: glext.h:7750
GLenum GLuint texture
Definition: glext.h:6295
GLsizei stride
Definition: glext.h:5848
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
GLintptr offset
Definition: glext.h:5920
GLuint color
Definition: glext.h:6243
const GLubyte * c
Definition: glext.h:8905
GLuint sampler
Definition: glext.h:7283
GLuint shader
Definition: glext.h:6030
GLuint index
Definition: glext.h:6031
GLuint GLenum matrix
Definition: glext.h:9407
GLenum mode
Definition: glext.h:6217
GLenum GLenum dst
Definition: glext.h:6340
GLbitfield flags
Definition: glext.h:7161
const GLuint * fences
Definition: glext.h:9249
GLsizei levels
Definition: glext.h:7884
GLuint GLint GLboolean GLint GLenum access
Definition: glext.h:7866
GLfloat GLfloat p
Definition: glext.h:8902
GLboolean enable
Definition: glext.h:11120
GLsizeiptr const GLvoid GLenum usage
Definition: glext.h:5919
GLint GLfloat GLint stencil
Definition: glext.h:6260
GLdouble GLdouble z
Definition: glext.h:5874
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
unsigned int UINT
Definition: sysinfo.c:13
static D3D_DRIVER_TYPE HMODULE UINT const D3D_FEATURE_LEVEL * feature_levels
Definition: hlsl_d3d11.c:28
REFIID riid
Definition: atlbase.h:39
#define InterlockedCompareExchange
Definition: interlocked.h:119
#define S_OK
Definition: intsafe.h:52
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define d
Definition: ke_i.h:81
#define debugstr_guid
Definition: kernel32.h:35
if(dx< 0)
Definition: linetemp.h:194
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
struct task_struct * current
Definition: linux.c:32
D3D11_SHADER_VARIABLE_DESC desc
Definition: reflection.c:1683
int vertex_count
Definition: d3drm.c:3528
static const BYTE ramp[17]
Definition: dib.c:2957
constants
Definition: resource.c:30
static int priority
Definition: timer.c:163
static BYTE parameters[]
Definition: asn.c:558
#define min(a, b)
Definition: monoChain.cc:55
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tsub %rbp, %rax\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tpush %rbx\n" "\t.seh_pushreg %rbx\n" "\tpush %rdi\n" "\t.seh_pushreg %rdi\n" "\tpush %rsi\n" "\t.seh_pushreg %rsi\n" "\tpush %r12\n" "\t.seh_pushreg %r12\n" "\tpush %r13\n" "\t.seh_pushreg %r13\n" "\tpush %r14\n" "\t.seh_pushreg %r14\n" "\tpush %r15\n" "\t.seh_pushreg %r15\n" "\tsub $40, %rsp\n" "\t.seh_stackalloc 40\n" "\t.seh_endprologue\n" "\tsub %rax, %rdx\n" "\tmov %rdx, %rbp\n" "\tjmp *%r8\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $40, %rsp\n" "\tpop %r15\n" "\tpop %r14\n" "\tpop %r13\n" "\tpop %r12\n" "\tpop %rsi\n" "\tpop %rdi\n" "\tpop %rbx\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
#define calloc
Definition: rosglue.h:14
#define D3DERR_NOTAVAILABLE
Definition: d3d8.h:80
#define D3DCREATE_MULTITHREADED
Definition: d3d8.h:38
#define D3DERR_DRIVERINTERNALERROR
Definition: d3d8.h:74
#define D3DERR_DEVICENOTRESET
Definition: d3d8.h:79
#define D3DCREATE_FPU_PRESERVE
Definition: d3d8.h:37
#define D3DERR_OUTOFVIDEOMEMORY
Definition: d3d8.h:81
#define D3DERR_DEVICELOST
Definition: d3d8.h:78
#define D3DERR_NOTFOUND
Definition: d3d8.h:76
#define memset(x, y, z)
Definition: compat.h:39
#define major(rdev)
Definition: propsheet.cpp:928
#define TRACE(s)
Definition: solgame.cpp:4
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95
long y
Definition: dcommon.idl:24
long x
Definition: dcommon.idl:24
Definition: dcommon.idl:28
long bottom
Definition: dcommon.idl:29
long right
Definition: dcommon.idl:29
long left
Definition: dcommon.idl:29
long top
Definition: dcommon.idl:29
D3DDEVTYPE DeviceType
Definition: d3d9caps.h:264
float MaxVertexW
Definition: d3d9caps.h:292
DWORD TextureOpCaps
Definition: d3d9caps.h:300
DWORD DevCaps2
Definition: d3d9caps.h:317
DWORD MaxTextureWidth
Definition: d3d9caps.h:286
DWORD Caps3
Definition: d3d9caps.h:268
DWORD MaxVertexBlendMatrixIndex
Definition: d3d9caps.h:307
DWORD MaxTextureHeight
Definition: d3d9caps.h:287
DWORD VertexProcessingCaps
Definition: d3d9caps.h:303
DWORD DevCaps
Definition: d3d9caps.h:271
float GuardBandBottom
Definition: d3d9caps.h:296
DWORD DestBlendCaps
Definition: d3d9caps.h:276
DWORD RasterCaps
Definition: d3d9caps.h:273
DWORD MaxUserClipPlanes
Definition: d3d9caps.h:305
UINT MasterAdapterOrdinal
Definition: d3d9caps.h:320
DWORD Caps2
Definition: d3d9caps.h:267
DWORD MaxVertexIndex
Definition: d3d9caps.h:310
DWORD TextureFilterCaps
Definition: d3d9caps.h:280
DWORD MaxAnisotropy
Definition: d3d9caps.h:291
DWORD PixelShaderVersion
Definition: d3d9caps.h:315
DWORD ShadeCaps
Definition: d3d9caps.h:278
DWORD StretchRectFilterCaps
Definition: d3d9caps.h:325
DWORD PrimitiveMiscCaps
Definition: d3d9caps.h:272
DWORD LineCaps
Definition: d3d9caps.h:285
DWORD MaxPShaderInstructionsExecuted
Definition: d3d9caps.h:330
UINT AdapterOrdinalInGroup
Definition: d3d9caps.h:321
D3DVSHADERCAPS2_0 VS20Caps
Definition: d3d9caps.h:326
float GuardBandRight
Definition: d3d9caps.h:295
DWORD VolumeTextureAddressCaps
Definition: d3d9caps.h:284
DWORD MaxVolumeExtent
Definition: d3d9caps.h:288
DWORD MaxTextureAspectRatio
Definition: d3d9caps.h:290
DWORD FVFCaps
Definition: d3d9caps.h:299
DWORD ZCmpCaps
Definition: d3d9caps.h:274
float PixelShader1xMaxValue
Definition: d3d9caps.h:316
UINT AdapterOrdinal
Definition: d3d9caps.h:265
DWORD CursorCaps
Definition: d3d9caps.h:270
DWORD VertexShaderVersion
Definition: d3d9caps.h:313
DWORD MaxTextureRepeat
Definition: d3d9caps.h:289
DWORD Caps
Definition: d3d9caps.h:266
DWORD MaxVertexBlendMatrices
Definition: d3d9caps.h:306
float GuardBandLeft
Definition: d3d9caps.h:293
float MaxPointSize
Definition: d3d9caps.h:308
float ExtentsAdjust
Definition: d3d9caps.h:297
DWORD MaxPrimitiveCount
Definition: d3d9caps.h:309
DWORD CubeTextureFilterCaps
Definition: d3d9caps.h:281
DWORD MaxPixelShader30InstructionSlots
Definition: d3d9caps.h:332
DWORD MaxTextureBlendStages
Definition: d3d9caps.h:301
DWORD PresentationIntervals
Definition: d3d9caps.h:269
UINT NumberOfAdaptersInGroup
Definition: d3d9caps.h:322
D3DPSHADERCAPS2_0 PS20Caps
Definition: d3d9caps.h:327
DWORD MaxVertexShader30InstructionSlots
Definition: d3d9caps.h:331
DWORD TextureAddressCaps
Definition: d3d9caps.h:283
DWORD MaxSimultaneousTextures
Definition: d3d9caps.h:302
DWORD MaxVertexShaderConst
Definition: d3d9caps.h:314
DWORD MaxActiveLights
Definition: d3d9caps.h:304
float GuardBandTop
Definition: d3d9caps.h:294
DWORD MaxStreams
Definition: d3d9caps.h:311
float MaxNpatchTessellationLevel
Definition: d3d9caps.h:318
DWORD MaxVShaderInstructionsExecuted
Definition: d3d9caps.h:329
DWORD SrcBlendCaps
Definition: d3d9caps.h:275
DWORD NumSimultaneousRTs
Definition: d3d9caps.h:324
DWORD AlphaCmpCaps
Definition: d3d9caps.h:277
DWORD StencilCaps
Definition: d3d9caps.h:298
DWORD TextureCaps
Definition: d3d9caps.h:279
DWORD VertexTextureFilterCaps
Definition: d3d9caps.h:328
DWORD DeclTypes
Definition: d3d9caps.h:323
DWORD VolumeTextureFilterCaps
Definition: d3d9caps.h:282
DWORD MaxStreamStride
Definition: d3d9caps.h:312
D3DSWAPEFFECT SwapEffect
Definition: d3d8types.h:1128
D3DMULTISAMPLE_TYPE MultiSampleType
Definition: d3d8types.h:1126
D3DFORMAT BackBufferFormat
Definition: d3d8types.h:1123
D3DFORMAT AutoDepthStencilFormat
Definition: d3d8types.h:1132
INT StaticFlowControlDepth
Definition: d3d9caps.h:257
INT DynamicFlowControlDepth
Definition: d3d9caps.h:255
INT DynamicFlowControlDepth
Definition: d3d9caps.h:246
INT StaticFlowControlDepth
Definition: d3d9caps.h:248
Definition: uimain.c:89
Definition: palette.c:466
IDirect3DDevice9On12 IDirect3DDevice9On12_iface
Definition: d3d9_private.h:92
struct wined3d_device_parent device_parent
Definition: d3d9_private.h:93
enum wined3d_format_id format
Definition: d3d9_private.h:210
struct wined3d_buffer * wined3d_buffer
Definition: d3d9_private.h:208
IDirect3DIndexBuffer9 IDirect3DIndexBuffer9_iface
Definition: d3d9_private.h:206
struct wined3d_shader * wined3d_shader
Definition: d3d9_private.h:291
IDirect3DPixelShader9 IDirect3DPixelShader9_iface
Definition: d3d9_private.h:289
IUnknown * container
Definition: d3d9_private.h:177
IDirect3DDevice9Ex * parent_device
Definition: d3d9_private.h:176
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:172
struct wined3d_swapchain * swapchain
Definition: d3d9_private.h:179
IDirect3DSurface9 IDirect3DSurface9_iface
Definition: d3d9_private.h:170
struct d3d9_resource resource
Definition: d3d9_private.h:171
struct wined3d_rendertarget_view * wined3d_rtv
Definition: d3d9_private.h:175
struct d3d9_texture * texture
Definition: d3d9_private.h:178
unsigned int sub_resource_idx
Definition: d3d9_private.h:173
IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex_iface
Definition: d3d9_private.h:157
struct wined3d_swapchain * wined3d_swapchain
Definition: d3d9_private.h:159
unsigned int swap_interval
Definition: d3d9_private.h:162
struct wined3d_texture * draw_texture
Definition: d3d9_private.h:223
struct wined3d_texture * wined3d_texture
Definition: d3d9_private.h:223
IDirect3DBaseTexture9 IDirect3DBaseTexture9_iface
Definition: d3d9_private.h:221
IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9_iface
Definition: d3d9_private.h:260
D3DVERTEXELEMENT9 * elements
Definition: d3d9_private.h:262
struct wined3d_vertex_declaration * wined3d_declaration
Definition: d3d9_private.h:265
IDirect3DVertexBuffer9 IDirect3DVertexBuffer9_iface
Definition: d3d9_private.h:192
struct wined3d_buffer * draw_buffer
Definition: d3d9_private.h:196
struct wined3d_buffer * wined3d_buffer
Definition: d3d9_private.h:194
struct wined3d_shader * wined3d_shader
Definition: d3d9_private.h:279
IDirect3DVertexShader9 IDirect3DVertexShader9_iface
Definition: d3d9_private.h:277
unsigned int sub_resource_idx
Definition: d3d9_private.h:148
struct wined3d_output ** wined3d_outputs
Definition: d3d9_private.h:66
Definition: devices.h:37
Definition: filter.c:165
struct wined3d_vertex_declaration * decl
Definition: d3d9_private.h:78
Definition: queue.c:179
Definition: parse.h:23
DWORD MaxPShaderInstructionsExecuted
Definition: wined3d.h:1995
DWORD MaxVertexBlendMatrices
Definition: wined3d.h:1967
DWORD MaxVertexShader30InstructionSlots
Definition: wined3d.h:1996
DWORD MaxTextureBlendStages
Definition: wined3d.h:1961
struct wined3d_vertex_shader_caps VS20Caps
Definition: wined3d.h:1991
DWORD StretchRectFilterCaps
Definition: wined3d.h:1990
DWORD VolumeTextureAddressCaps
Definition: wined3d.h:1940
float GuardBandTop
Definition: wined3d.h:1952
float PixelShader1xMaxValue
Definition: wined3d.h:1981
DWORD FVFCaps
Definition: wined3d.h:1959
DWORD PrimitiveMiscCaps
Definition: wined3d.h:1928
DWORD MaxVertexBlendMatrixIndex
Definition: wined3d.h:1968
DWORD VertexProcessingCaps
Definition: wined3d.h:1964
DWORD TextureAddressCaps
Definition: wined3d.h:1939
DWORD TextureCaps
Definition: wined3d.h:1935
DWORD ShadeCaps
Definition: wined3d.h:1934
DWORD TextureOpCaps
Definition: wined3d.h:1960
DWORD MaxTextureRepeat
Definition: wined3d.h:1946
DWORD MaxAnisotropy
Definition: wined3d.h:1948
DWORD MaxPixelShader30InstructionSlots
Definition: wined3d.h:1997
DWORD MaxVolumeExtent
Definition: wined3d.h:1945
float ExtentsAdjust
Definition: wined3d.h:1956
float MaxNpatchTessellationLevel
Definition: wined3d.h:1986
float GuardBandLeft
Definition: wined3d.h:1951
DWORD VolumeTextureFilterCaps
Definition: wined3d.h:1938
DWORD DevCaps
Definition: wined3d.h:1927
DWORD ZCmpCaps
Definition: wined3d.h:1930
DWORD MaxTextureHeight
Definition: wined3d.h:1944
DWORD CursorCaps
Definition: wined3d.h:1926
DWORD Caps
Definition: wined3d.h:1922
DWORD Caps3
Definition: wined3d.h:1924
DWORD MaxStreams
Definition: wined3d.h:1974
DWORD NumSimultaneousRTs
Definition: wined3d.h:1989
DWORD AlphaCmpCaps
Definition: wined3d.h:1933
DWORD DestBlendCaps
Definition: wined3d.h:1932
DWORD RasterCaps
Definition: wined3d.h:1929
DWORD DevCaps2
Definition: wined3d.h:1984
struct wined3d_pixel_shader_caps PS20Caps
Definition: wined3d.h:1992
float MaxVertexW
Definition: wined3d.h:1949
float MaxPointSize
Definition: wined3d.h:1970
DWORD Caps2
Definition: wined3d.h:1923
DWORD MaxPrimitiveCount
Definition: wined3d.h:1972
DWORD VertexShaderVersion
Definition: wined3d.h:1977
enum wined3d_device_type DeviceType
Definition: wined3d.h:1920
DWORD MaxTextureWidth
Definition: wined3d.h:1943
DWORD LineCaps
Definition: wined3d.h:1941
DWORD MaxUserClipPlanes
Definition: wined3d.h:1966
DWORD VertexTextureFilterCaps
Definition: wined3d.h:1993
DWORD PixelShaderVersion
Definition: wined3d.h:1980
float GuardBandBottom
Definition: wined3d.h:1954
float GuardBandRight
Definition: wined3d.h:1953
DWORD MaxVertexIndex
Definition: wined3d.h:1973
DWORD CubeTextureFilterCaps
Definition: wined3d.h:1937
DWORD MaxTextureAspectRatio
Definition: wined3d.h:1947
DWORD MaxStreamStride
Definition: wined3d.h:1975
DWORD MaxSimultaneousTextures
Definition: wined3d.h:1962
DWORD MaxActiveLights
Definition: wined3d.h:1965
DWORD StencilCaps
Definition: wined3d.h:1957
DWORD SrcBlendCaps
Definition: wined3d.h:1931
DWORD DeclTypes
Definition: wined3d.h:1988
DWORD TextureFilterCaps
Definition: wined3d.h:1936
DWORD MaxVertexShaderConst
Definition: wined3d.h:1978
DWORD MaxVShaderInstructionsExecuted
Definition: wined3d.h:1994
enum wined3d_format_id format_id
Definition: wined3d.h:1614
enum wined3d_scanline_ordering scanline_ordering
Definition: wined3d.h:1615
unsigned int ordinal
Definition: wined3d.h:2151
unsigned int size
Definition: wined3d.h:1801
enum wined3d_format_id format
Definition: wined3d.h:1806
unsigned int bind_flags
Definition: wined3d.h:1810
enum wined3d_multisample_type multisample_type
Definition: wined3d.h:1807
unsigned int multisample_quality
Definition: wined3d.h:1778
unsigned int backbuffer_height
Definition: wined3d.h:1773
BOOL auto_restore_display_mode
Definition: wined3d.h:1786
enum wined3d_multisample_type multisample_type
Definition: wined3d.h:1777
enum wined3d_format_id auto_depth_stencil_format
Definition: wined3d.h:1783
struct wined3d_output * output
Definition: wined3d.h:1771
unsigned int backbuffer_width
Definition: wined3d.h:1772
unsigned int backbuffer_count
Definition: wined3d.h:1775
enum wined3d_format_id backbuffer_format
Definition: wined3d.h:1774
enum wined3d_swap_effect swap_effect
Definition: wined3d.h:1779
BOOL enable_auto_depth_stencil
Definition: wined3d.h:1782
unsigned int refresh_rate
Definition: wined3d.h:1785
unsigned int backbuffer_bind_flags
Definition: wined3d.h:1776
unsigned int swap_interval
#define max(a, b)
Definition: svc.c:63
int32_t INT
Definition: typedefs.h:58
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t UINT32
Definition: typedefs.h:59
uint32_t ULONG
Definition: typedefs.h:59
Definition: pdh_main.c:64
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
Definition: wcsftime.cpp:383
#define WINAPI
Definition: msvc.h:6
static struct wined3d_texture * d3d9_texture_get_draw_texture(struct d3d9_texture *texture)
Definition: d3d9_private.h:238
void d3d9_surface_release_rendertarget_view(struct d3d9_surface *surface, struct wined3d_rendertarget_view *rtv)
Definition: surface.c:443
static struct d3d9_device * impl_from_IDirect3DDevice9Ex(IDirect3DDevice9Ex *iface)
Definition: d3d9_private.h:310
struct d3d9_device * d3d9_surface_get_device(const struct d3d9_surface *surface)
Definition: surface.c:410
HRESULT vertexshader_init(struct d3d9_vertexshader *shader, struct d3d9_device *device, const DWORD *byte_code)
Definition: shader.c:130
HRESULT query_init(struct d3d9_query *query, struct d3d9_device *device, D3DQUERYTYPE type)
Definition: query.c:182
HRESULT d3d9_texture_cube_init(struct d3d9_texture *texture, struct d3d9_device *device, unsigned int edge_length, unsigned int level_count, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: texture.c:1380
struct d3d9_vertex_declaration * unsafe_impl_from_IDirect3DVertexDeclaration9(IDirect3DVertexDeclaration9 *iface)
HRESULT d3d9_swapchain_create(struct d3d9_device *device, struct wined3d_swapchain_desc *desc, unsigned int swap_interval, struct d3d9_swapchain **swapchain)
Definition: swapchain.c:399
struct d3d9_vertexshader * unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface)
Definition: shader.c:157
struct d3d9_texture * unsafe_impl_from_IDirect3DBaseTexture9(IDirect3DBaseTexture9 *iface)
Definition: texture.c:1204
void d3d9_texture_gen_auto_mipmap(struct d3d9_texture *texture)
Definition: texture.c:94
#define D3D9_RESZ_CODE
Definition: d3d9_private.h:49
struct d3d9_surface * d3d9_surface_create(struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, IUnknown *container)
Definition: surface.c:356
HRESULT d3d9_texture_3d_init(struct d3d9_texture *texture, struct d3d9_device *device, unsigned int width, unsigned int height, unsigned int depth, unsigned int level_count, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: texture.c:1404
#define D3D9_MAX_TEXTURE_UNITS
Definition: d3d9_private.h:41
void d3d9_texture_flag_auto_gen_mipmap(struct d3d9_texture *texture)
Definition: texture.c:106
HRESULT vdecl_convert_fvf(DWORD FVF, D3DVERTEXELEMENT9 **ppVertexElements)
struct d3d9_pixelshader * unsafe_impl_from_IDirect3DPixelShader9(IDirect3DPixelShader9 *iface)
Definition: shader.c:300
HRESULT d3d9_vertex_declaration_create(struct d3d9_device *device, const D3DVERTEXELEMENT9 *elements, struct d3d9_vertex_declaration **declaration)
struct wined3d_rendertarget_view * d3d9_surface_acquire_rendertarget_view(struct d3d9_surface *surface)
Definition: surface.c:417
struct d3d9_surface * unsafe_impl_from_IDirect3DSurface9(IDirect3DSurface9 *iface)
Definition: surface.c:450
HRESULT d3d9_texture_2d_init(struct d3d9_texture *texture, struct d3d9_device *device, unsigned int width, unsigned int height, unsigned int level_count, DWORD usage, D3DFORMAT format, D3DPOOL pool)
Definition: texture.c:1356
static enum wined3d_scanline_ordering wined3d_scanline_ordering_from_d3d(D3DSCANLINEORDERING ordering)
Definition: d3d9_private.h:417
HRESULT stateblock_init(struct d3d9_stateblock *stateblock, struct d3d9_device *device, D3DSTATEBLOCKTYPE type, struct wined3d_stateblock *wined3d_stateblock)
Definition: stateblock.c:175
HRESULT pixelshader_init(struct d3d9_pixelshader *shader, struct d3d9_device *device, const DWORD *byte_code)
Definition: shader.c:273
@ D3D9_DEVICE_STATE_OK
Definition: d3d9_private.h:84
@ D3D9_DEVICE_STATE_NOT_RESET
Definition: d3d9_private.h:86
@ D3D9_DEVICE_STATE_LOST
Definition: d3d9_private.h:85
static D3DSCANLINEORDERING d3dscanlineordering_from_wined3d(enum wined3d_scanline_ordering ordering)
Definition: d3d9_private.h:349
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF
Definition: d3d9_private.h:40
unsigned int CDECL wined3d_adapter_get_output_count(const struct wined3d_adapter *adapter)
Definition: directx.c:1038
struct wined3d_adapter *CDECL wined3d_output_get_adapter(const struct wined3d_output *output)
Definition: directx.c:1508
HRESULT CDECL wined3d_output_get_desc(const struct wined3d_output *output, struct wined3d_output_desc *desc)
Definition: directx.c:1256
HRESULT CDECL wined3d_get_device_caps(const struct wined3d_adapter *adapter, enum wined3d_device_type device_type, struct wined3d_caps *caps)
Definition: directx.c:2366
HRESULT CDECL wined3d_device_create(struct wined3d *wined3d, struct wined3d_adapter *adapter, enum wined3d_device_type device_type, HWND focus_window, uint32_t flags, BYTE surface_alignment, const enum wined3d_feature_level *feature_levels, unsigned int feature_level_count, struct wined3d_device_parent *device_parent, struct wined3d_device **device)
Definition: directx.c:2777
HRESULT CDECL wined3d_stateblock_set_vs_consts_b(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const BOOL *constants)
Definition: stateblock.c:1396
HRESULT CDECL wined3d_stateblock_set_vs_consts_f(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
Definition: stateblock.c:1360
void CDECL wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock, struct wined3d_vertex_declaration *declaration)
Definition: stateblock.c:1571
HRESULT CDECL wined3d_stateblock_set_vs_consts_i(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants)
Definition: stateblock.c:1376
HRESULT CDECL wined3d_stateblock_create(struct wined3d_device *device, const struct wined3d_stateblock *device_state, enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock)
Definition: stateblock.c:2508
void CDECL wined3d_stateblock_set_material(struct wined3d_stateblock *stateblock, const struct wined3d_material *material)
Definition: stateblock.c:1891
void CDECL wined3d_stateblock_reset(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:2534
void CDECL wined3d_stateblock_set_texture(struct wined3d_stateblock *stateblock, UINT stage, struct wined3d_texture *texture)
Definition: stateblock.c:1816
void CDECL wined3d_stateblock_init_contained_states(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:393
HRESULT CDECL wined3d_stateblock_set_stream_source_freq(struct wined3d_stateblock *stateblock, UINT stream_idx, UINT divider)
Definition: stateblock.c:1966
HRESULT CDECL wined3d_stateblock_set_light(struct wined3d_stateblock *stateblock, UINT light_idx, const struct wined3d_light *light)
Definition: stateblock.c:1996
HRESULT CDECL wined3d_stateblock_get_vs_consts_i(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, struct wined3d_ivec4 *constants)
Definition: stateblock.c:1430
void CDECL wined3d_stateblock_depth_buffer_changed(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:4043
HRESULT CDECL wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock, UINT plane_idx, const struct wined3d_vec4 *plane)
Definition: stateblock.c:1875
HRESULT CDECL wined3d_stateblock_set_ps_consts_b(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const BOOL *constants)
Definition: stateblock.c:1509
HRESULT CDECL wined3d_stateblock_set_ps_consts_i(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants)
Definition: stateblock.c:1489
HRESULT CDECL wined3d_stateblock_set_light_enable(struct wined3d_stateblock *stateblock, UINT light_idx, BOOL enable)
Definition: stateblock.c:2042
void CDECL wined3d_stateblock_set_pixel_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader)
Definition: stateblock.c:1460
HRESULT CDECL wined3d_stateblock_get_vs_consts_f(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
Definition: stateblock.c:1416
HRESULT CDECL wined3d_stateblock_set_ps_consts_f(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants)
Definition: stateblock.c:1473
HRESULT CDECL wined3d_stateblock_get_ps_consts_i(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, struct wined3d_ivec4 *constants)
Definition: stateblock.c:1541
void CDECL wined3d_stateblock_set_sampler_state(struct wined3d_stateblock *stateblock, UINT sampler_idx, enum wined3d_sampler_state state, unsigned int value)
Definition: stateblock.c:1702
void CDECL wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader)
Definition: stateblock.c:1319
const struct wined3d_stateblock_state *CDECL wined3d_stateblock_get_state(const struct wined3d_stateblock *stateblock)
Definition: stateblock.c:2064
HRESULT CDECL wined3d_stateblock_get_vs_consts_b(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, BOOL *constants)
Definition: stateblock.c:1445
ULONG CDECL wined3d_stateblock_decref(struct wined3d_stateblock *stateblock)
Definition: stateblock.c:670
void CDECL wined3d_stateblock_set_transform(struct wined3d_stateblock *stateblock, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: stateblock.c:1840
void CDECL wined3d_stateblock_multiply_transform(struct wined3d_stateblock *stateblock, enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
Definition: stateblock.c:1859
void CDECL wined3d_stateblock_set_index_buffer(struct wined3d_stateblock *stateblock, struct wined3d_buffer *buffer, enum wined3d_format_id format_id)
Definition: stateblock.c:1918
void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock, enum wined3d_render_state state, unsigned int value)
Definition: stateblock.c:1623
void CDECL wined3d_stateblock_set_scissor_rect(struct wined3d_stateblock *stateblock, const RECT *rect)
Definition: stateblock.c:1910
HRESULT CDECL wined3d_stateblock_get_ps_consts_b(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, BOOL *constants)
Definition: stateblock.c:1556
void CDECL wined3d_stateblock_apply_clear_state(struct wined3d_stateblock *stateblock, struct wined3d_device *device)
Definition: stateblock.c:2917
HRESULT CDECL wined3d_stateblock_get_ps_consts_f(struct wined3d_stateblock *stateblock, unsigned int start_idx, unsigned int count, struct wined3d_vec4 *constants)
Definition: stateblock.c:1529
HRESULT CDECL wined3d_stateblock_set_stream_source(struct wined3d_stateblock *stateblock, UINT stream_idx, struct wined3d_buffer *buffer, UINT offset, UINT stride)
Definition: stateblock.c:1939
HRESULT CDECL wined3d_stateblock_get_light(const struct wined3d_stateblock *stateblock, UINT light_idx, struct wined3d_light *light, BOOL *enabled)
Definition: stateblock.c:2069
void CDECL wined3d_stateblock_set_texture_stage_state(struct wined3d_stateblock *stateblock, UINT stage, enum wined3d_texture_stage_state state, unsigned int value)
Definition: stateblock.c:1718
void CDECL wined3d_stateblock_set_viewport(struct wined3d_stateblock *stateblock, const struct wined3d_viewport *viewport)
Definition: stateblock.c:1900
void CDECL wined3d_device_apply_stateblock(struct wined3d_device *device, struct wined3d_stateblock *stateblock)
Definition: stateblock.c:3038
struct wined3d_texture *CDECL wined3d_swapchain_get_back_buffer(const struct wined3d_swapchain *swapchain, UINT back_buffer_idx)
Definition: swapchain.c:256
void CDECL wined3d_swapchain_get_desc(const struct wined3d_swapchain *swapchain, struct wined3d_swapchain_desc *desc)
Definition: swapchain.c:345
void *CDECL wined3d_swapchain_get_parent(const struct wined3d_swapchain *swapchain)
Definition: swapchain.c:170
ULONG CDECL wined3d_swapchain_decref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:144
ULONG CDECL wined3d_swapchain_incref(struct wined3d_swapchain *swapchain)
Definition: swapchain.c:135
HRESULT CDECL wined3d_swapchain_get_front_buffer_data(const struct wined3d_swapchain *swapchain, struct wined3d_texture *dst_texture, unsigned int sub_resource_idx)
Definition: swapchain.c:235
HRESULT CDECL wined3d_swapchain_present(struct wined3d_swapchain *swapchain, const RECT *src_rect, const RECT *dst_rect, HWND dst_window_override, unsigned int swap_interval, uint32_t flags)
Definition: swapchain.c:192
ULONG CDECL wined3d_vertex_declaration_incref(struct wined3d_vertex_declaration *declaration)
void *CDECL wined3d_vertex_declaration_get_parent(const struct wined3d_vertex_declaration *declaration)
ULONG CDECL wined3d_vertex_declaration_decref(struct wined3d_vertex_declaration *declaration)
@ WINED3D_SBT_PRIMARY
Definition: wined3d.h:791
@ WINED3D_SBT_RECORDED
Definition: wined3d.h:790
#define WINED3DCLEAR_TARGET
Definition: wined3d.h:1008
#define WINED3D_TEXTURE_CREATE_DISCARD
Definition: wined3d.h:1563
wined3d_multisample_type
Definition: wined3d.h:572
@ WINED3D_MULTISAMPLE_NONE
Definition: wined3d.h:573
#define WINED3D_MAX_COMBINED_SAMPLERS
Definition: wined3d.h:1600
wined3d_swap_interval
Definition: wined3d.h:544
@ WINED3D_SWAP_INTERVAL_TWO
Definition: wined3d.h:547
@ WINED3D_SWAP_INTERVAL_FOUR
Definition: wined3d.h:549
@ WINED3D_SWAP_INTERVAL_ONE
Definition: wined3d.h:546
@ WINED3D_SWAP_INTERVAL_DEFAULT
Definition: wined3d.h:550
@ WINED3D_SWAP_INTERVAL_THREE
Definition: wined3d.h:548
@ WINED3D_SWAP_INTERVAL_IMMEDIATE
Definition: wined3d.h:545
wined3d_render_state
Definition: wined3d.h:288
@ WINED3D_RS_ZENABLE
Definition: wined3d.h:293
#define WINED3D_SWAPCHAIN_ALLOW_MODE_SWITCH
Definition: wined3d.h:897
wined3d_primitive_type
Definition: wined3d.h:74
static int wined3d_bit_scan(unsigned int *x)
Definition: wined3d.h:2982
#define WINED3D_SWAPCHAIN_IMPLICIT
Definition: wined3d.h:901
wined3d_swap_effect
Definition: wined3d.h:533
@ WINED3D_SWAP_EFFECT_COPY
Definition: wined3d.h:538
@ WINED3D_SWAP_EFFECT_SEQUENTIAL
Definition: wined3d.h:535
@ WINED3D_SWAP_EFFECT_DISCARD
Definition: wined3d.h:534
@ WINED3D_SWAP_EFFECT_OVERLAY
Definition: wined3d.h:540
@ WINED3D_SWAP_EFFECT_FLIP_SEQUENTIAL
Definition: wined3d.h:537
#define WINED3D_BIND_VERTEX_BUFFER
Definition: wined3d.h:909
wined3d_sampler_state
Definition: wined3d.h:554
#define WINED3D_RESOURCE_ACCESS_GPU
Definition: wined3d.h:51
#define WINED3D_RESOURCE_ACCESS_CPU
Definition: wined3d.h:52
wined3d_resource_type
Definition: wined3d.h:716
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:720
@ WINED3D_RTYPE_TEXTURE_3D
Definition: wined3d.h:721
static void wined3d_streaming_buffer_init(struct wined3d_streaming_buffer *buffer, unsigned int bind_flags)
Definition: wined3d.h:2937
#define WINED3DERR_NOTAVAILABLE
Definition: wined3d.h:42
wined3d_texture_filter_type
Definition: wined3d.h:704
@ WINED3D_TEXF_POINT
Definition: wined3d.h:706
#define WINED3D_SWAPCHAIN_GDI_COMPATIBLE
Definition: wined3d.h:900
wined3d_texture_stage_state
Definition: wined3d.h:593
@ WINED3D_TSS_COLOR_ARG2
Definition: wined3d.h:596
@ WINED3D_TSS_BUMPENV_LOFFSET
Definition: wined3d.h:606
@ WINED3D_TSS_ALPHA_OP
Definition: wined3d.h:597
@ WINED3D_TSS_BUMPENV_MAT11
Definition: wined3d.h:603
@ WINED3D_TSS_COLOR_OP
Definition: wined3d.h:594
@ WINED3D_TSS_INVALID
Definition: wined3d.h:612
@ WINED3D_TSS_BUMPENV_MAT10
Definition: wined3d.h:602
@ WINED3D_TSS_TEXCOORD_INDEX
Definition: wined3d.h:604
@ WINED3D_TSS_ALPHA_ARG2
Definition: wined3d.h:599
@ WINED3D_TSS_CONSTANT
Definition: wined3d.h:611
@ WINED3D_TSS_BUMPENV_MAT01
Definition: wined3d.h:601
@ WINED3D_TSS_ALPHA_ARG0
Definition: wined3d.h:609
@ WINED3D_TSS_BUMPENV_LSCALE
Definition: wined3d.h:605
@ WINED3D_TSS_COLOR_ARG0
Definition: wined3d.h:608
@ WINED3D_TSS_COLOR_ARG1
Definition: wined3d.h:595
@ WINED3D_TSS_ALPHA_ARG1
Definition: wined3d.h:598
@ WINED3D_TSS_RESULT_ARG
Definition: wined3d.h:610
@ WINED3D_TSS_BUMPENV_MAT00
Definition: wined3d.h:600
@ WINED3D_TSS_TEXTURE_TRANSFORM_FLAGS
Definition: wined3d.h:607
#define WINED3DUSAGE_MASK
Definition: wined3d.h:930
#define WINED3D_MAP_READ
Definition: wined3d.h:957
#define WINED3DCREATE_NOWINDOWCHANGES
Definition: wined3d.h:1029
#define WINED3D_BIND_SHADER_RESOURCE
Definition: wined3d.h:912
#define WINED3DUSAGE_VIDMEM_ACCOUNTING
Definition: wined3d.h:939
wined3d_format_id
Definition: wined3d.h:126
@ WINED3DFMT_B2G3R3_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_DF16
Definition: wined3d.h:280
@ WINED3DFMT_INTZ
Definition: wined3d.h:274
@ WINED3DFMT_B4G4R4A4_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_R16G16_UNORM
Definition: wined3d.h:192
@ WINED3DFMT_X8D24_UNORM
Definition: wined3d.h:151
@ WINED3DFMT_D32_FLOAT
Definition: wined3d.h:197
@ WINED3DFMT_R10G10B10A2_UNORM
Definition: wined3d.h:179
@ WINED3DFMT_R8G8_SNORM_Cx
Definition: wined3d.h:155
@ WINED3DFMT_R32G32_FLOAT
Definition: wined3d.h:171
@ WINED3DFMT_R16G16_SNORM
Definition: wined3d.h:194
@ WINED3DFMT_B8G8R8A8_UNORM
Definition: wined3d.h:244
@ WINED3DFMT_R8G8B8A8_SNORM
Definition: wined3d.h:188
@ WINED3DFMT_S8_UINT_D24_FLOAT
Definition: wined3d.h:154
@ WINED3DFMT_D16_LOCKABLE
Definition: wined3d.h:148
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:150
@ WINED3DFMT_B2G3R3A8_UNORM
Definition: wined3d.h:132
@ WINED3DFMT_L8A8_UNORM
Definition: wined3d.h:139
@ WINED3DFMT_L4A4_UNORM
Definition: wined3d.h:140
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:245
@ WINED3DFMT_R8G8B8X8_UNORM
Definition: wined3d.h:134
@ WINED3DFMT_B5G5R5X1_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_B10G10R10A2_UNORM
Definition: wined3d.h:135
@ WINED3DFMT_R16G16B16A16_FLOAT
Definition: wined3d.h:165
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:212
@ WINED3DFMT_L8_UNORM
Definition: wined3d.h:138
@ WINED3DFMT_R8G8_SNORM
Definition: wined3d.h:208
@ WINED3DFMT_UNKNOWN
Definition: wined3d.h:127
@ WINED3DFMT_R5G5_SNORM_L6_UNORM
Definition: wined3d.h:141
@ WINED3DFMT_B8G8R8_UNORM
Definition: wined3d.h:128
@ WINED3DFMT_R32_UINT
Definition: wined3d.h:199
@ WINED3DFMT_B5G5R5A1_UNORM
Definition: wined3d.h:243
@ WINED3DFMT_R10G10B10_SNORM_A2_UNORM
Definition: wined3d.h:147
@ WINED3DFMT_R16_FLOAT
Definition: wined3d.h:211
@ WINED3DFMT_D32_UNORM
Definition: wined3d.h:149
@ WINED3DFMT_R8G8B8A8_UNORM
Definition: wined3d.h:185
@ WINED3DFMT_R16G16B16A16_UNORM
Definition: wined3d.h:166
@ WINED3DFMT_R32_FLOAT
Definition: wined3d.h:198
@ WINED3DFMT_R8G8_SNORM_L8X8_UNORM
Definition: wined3d.h:142
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:242
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:152
@ WINED3DFMT_R16G16_FLOAT
Definition: wined3d.h:191
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:137
@ WINED3DFMT_L16_UNORM
Definition: wined3d.h:153
@ WINED3DFMT_R16_UINT
Definition: wined3d.h:214
@ WINED3DFMT_DF24
Definition: wined3d.h:281
@ WINED3DFMT_A8_UNORM
Definition: wined3d.h:222
@ WINED3DFMT_R32G32B32A32_FLOAT
Definition: wined3d.h:157
@ WINED3DFMT_B4G4R4X4_UNORM
Definition: wined3d.h:133
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:202
@ WINED3DFMT_P8_UINT_A8_UNORM
Definition: wined3d.h:136
@ WINED3DFMT_R16G16B16A16_SNORM
Definition: wined3d.h:168
#define WINED3D_MAX_STREAMS
Definition: wined3d.h:1596
#define WINED3D_VERTEX_SAMPLER_OFFSET
Definition: wined3d.h:1037
#define WINED3D_SWAPCHAIN_RESTORE_WINDOW_STATE
Definition: wined3d.h:904
#define WINED3D_BIND_DEPTH_STENCIL
Definition: wined3d.h:915
static void wined3d_box_set(struct wined3d_box *box, unsigned int left, unsigned int top, unsigned int right, unsigned int bottom, unsigned int front, unsigned int back)
Definition: wined3d.h:3006
#define WINED3D_RESOURCE_ACCESS_MAP_R
Definition: wined3d.h:53
#define WINED3DUSAGE_MANAGED
Definition: wined3d.h:938
#define WINED3D_MAP_WRITE
Definition: wined3d.h:956
wined3d_feature_level
Definition: wined3d.h:98
@ WINED3D_FEATURE_LEVEL_8
Definition: wined3d.h:103
@ WINED3D_FEATURE_LEVEL_7
Definition: wined3d.h:102
@ WINED3D_FEATURE_LEVEL_6
Definition: wined3d.h:101
@ WINED3D_FEATURE_LEVEL_9_3
Definition: wined3d.h:106
@ WINED3D_FEATURE_LEVEL_5
Definition: wined3d.h:100
@ WINED3D_FEATURE_LEVEL_9_1
Definition: wined3d.h:104
@ WINED3D_FEATURE_LEVEL_9_2
Definition: wined3d.h:105
#define WINED3D_BIND_RENDER_TARGET
Definition: wined3d.h:914
wined3d_display_rotation
Definition: wined3d.h:831
static void wined3d_streaming_buffer_cleanup(struct wined3d_streaming_buffer *buffer)
Definition: wined3d.h:2943
wined3d_transform_state
Definition: wined3d.h:666
#define WINEDDERR_INVALIDRECT
Definition: wined3d.h:48
#define WINED3DERR_INVALIDCALL
Definition: wined3d.h:44
#define WINED3D_TEXTURE_CREATE_GET_DC
Definition: wined3d.h:1565
#define WINED3D_BIND_INDEX_BUFFER
Definition: wined3d.h:910
#define WINED3D_RESOURCE_ACCESS_MAP_W
Definition: wined3d.h:54
#define WINED3D_SWAPCHAIN_NO_WINDOW_CHANGES
Definition: wined3d.h:903
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:544
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:539
#define E_NOINTERFACE
Definition: winerror.h:3479
unsigned char BYTE
Definition: xxhash.c:193