wined3d: Support the full amount of constants in GLSL.
[wine/hacks.git] / dlls / d3d10core / buffer.c
bloba4198c163517a8c17c6430ac65448ad4a68bbc8e
1 /*
2 * Copyright 2009 Henri Verbeet for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "config.h"
21 #include "wine/port.h"
23 #include "d3d10core_private.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
27 /* IUnknown methods */
29 static HRESULT STDMETHODCALLTYPE d3d10_buffer_QueryInterface(ID3D10Buffer *iface, REFIID riid, void **object)
31 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
33 if (IsEqualGUID(riid, &IID_ID3D10Buffer)
34 || IsEqualGUID(riid, &IID_ID3D10Resource)
35 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
36 || IsEqualGUID(riid, &IID_IUnknown))
38 IUnknown_AddRef(iface);
39 *object = iface;
40 return S_OK;
43 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
45 *object = NULL;
46 return E_NOINTERFACE;
49 static ULONG STDMETHODCALLTYPE d3d10_buffer_AddRef(ID3D10Buffer *iface)
51 struct d3d10_buffer *This = (struct d3d10_buffer *)iface;
52 ULONG refcount = InterlockedIncrement(&This->refcount);
54 TRACE("%p increasing refcount to %u\n", This, refcount);
56 return refcount;
59 static ULONG STDMETHODCALLTYPE d3d10_buffer_Release(ID3D10Buffer *iface)
61 struct d3d10_buffer *This = (struct d3d10_buffer *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
66 if (!refcount)
68 IWineD3DBuffer_Release(This->wined3d_buffer);
69 HeapFree(GetProcessHeap(), 0, This);
72 return refcount;
75 /* ID3D10DeviceChild methods */
77 static void STDMETHODCALLTYPE d3d10_buffer_GetDevice(ID3D10Buffer *iface, ID3D10Device **device)
79 FIXME("iface %p, device %p stub!\n", iface, device);
82 static HRESULT STDMETHODCALLTYPE d3d10_buffer_GetPrivateData(ID3D10Buffer *iface,
83 REFGUID guid, UINT *data_size, void *data)
85 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
86 iface, debugstr_guid(guid), data_size, data);
88 return E_NOTIMPL;
91 static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateData(ID3D10Buffer *iface,
92 REFGUID guid, UINT data_size, const void *data)
94 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
95 iface, debugstr_guid(guid), data_size, data);
97 return E_NOTIMPL;
100 static HRESULT STDMETHODCALLTYPE d3d10_buffer_SetPrivateDataInterface(ID3D10Buffer *iface,
101 REFGUID guid, const IUnknown *data)
103 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
105 return E_NOTIMPL;
108 /* ID3D10Resource methods */
110 static void STDMETHODCALLTYPE d3d10_buffer_GetType(ID3D10Buffer *iface, D3D10_RESOURCE_DIMENSION *resource_dimension)
112 TRACE("iface %p, resource_dimension %p\n", iface, resource_dimension);
114 *resource_dimension = D3D10_RESOURCE_DIMENSION_BUFFER;
117 static void STDMETHODCALLTYPE d3d10_buffer_SetEvictionPriority(ID3D10Buffer *iface, UINT eviction_priority)
119 FIXME("iface %p, eviction_priority %u stub!\n", iface, eviction_priority);
122 static UINT STDMETHODCALLTYPE d3d10_buffer_GetEvictionPriority(ID3D10Buffer *iface)
124 FIXME("iface %p stub!\n", iface);
126 return 0;
129 /* ID3D10Buffer methods */
131 static HRESULT STDMETHODCALLTYPE d3d10_buffer_Map(ID3D10Buffer *iface, D3D10_MAP map_type, UINT map_flags, void **data)
133 FIXME("iface %p, map_type %u, map_flags %#x, data %p stub!\n", iface, map_type, map_flags, data);
135 return E_NOTIMPL;
138 static void STDMETHODCALLTYPE d3d10_buffer_Unmap(ID3D10Buffer *iface)
140 FIXME("iface %p stub!\n", iface);
143 static void STDMETHODCALLTYPE d3d10_buffer_GetDesc(ID3D10Buffer *iface, D3D10_BUFFER_DESC *desc)
145 FIXME("iface %p, desc %p stub!\n", iface, desc);
148 const struct ID3D10BufferVtbl d3d10_buffer_vtbl =
150 /* IUnknown methods */
151 d3d10_buffer_QueryInterface,
152 d3d10_buffer_AddRef,
153 d3d10_buffer_Release,
154 /* ID3D10DeviceChild methods */
155 d3d10_buffer_GetDevice,
156 d3d10_buffer_GetPrivateData,
157 d3d10_buffer_SetPrivateData,
158 d3d10_buffer_SetPrivateDataInterface,
159 /* ID3D10Resource methods */
160 d3d10_buffer_GetType,
161 d3d10_buffer_SetEvictionPriority,
162 d3d10_buffer_GetEvictionPriority,
163 /* ID3D10Buffer methods */
164 d3d10_buffer_Map,
165 d3d10_buffer_Unmap,
166 d3d10_buffer_GetDesc,