wined3d: Move frontend specfic constants to baseshader.c.
[wine/hacks.git] / dlls / d3d10core / shader.c
blobb614779bec16ae660228f854d41150df15153c75
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_vertex_shader_QueryInterface(ID3D10VertexShader *iface,
30 REFIID riid, void **object)
32 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
34 if (IsEqualGUID(riid, &IID_ID3D10VertexShader)
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_vertex_shader_AddRef(ID3D10VertexShader *iface)
51 struct d3d10_vertex_shader *This = (struct d3d10_vertex_shader *)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_vertex_shader_Release(ID3D10VertexShader *iface)
61 struct d3d10_vertex_shader *This = (struct d3d10_vertex_shader *)iface;
62 ULONG refcount = InterlockedDecrement(&This->refcount);
64 TRACE("%p decreasing refcount to %u\n", This, refcount);
66 if (!refcount)
68 HeapFree(GetProcessHeap(), 0, This);
71 return refcount;
74 /* ID3D10DeviceChild methods */
76 static void STDMETHODCALLTYPE d3d10_vertex_shader_GetDevice(ID3D10VertexShader *iface, ID3D10Device **device)
78 FIXME("iface %p, device %p stub!\n", iface, device);
81 static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_GetPrivateData(ID3D10VertexShader *iface,
82 REFGUID guid, UINT *data_size, void *data)
84 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
85 iface, debugstr_guid(guid), data_size, data);
87 return E_NOTIMPL;
90 static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateData(ID3D10VertexShader *iface,
91 REFGUID guid, UINT data_size, const void *data)
93 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
94 iface, debugstr_guid(guid), data_size, data);
96 return E_NOTIMPL;
99 static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_SetPrivateDataInterface(ID3D10VertexShader *iface,
100 REFGUID guid, const IUnknown *data)
102 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
104 return E_NOTIMPL;
107 const struct ID3D10VertexShaderVtbl d3d10_vertex_shader_vtbl =
109 /* IUnknown methods */
110 d3d10_vertex_shader_QueryInterface,
111 d3d10_vertex_shader_AddRef,
112 d3d10_vertex_shader_Release,
113 /* ID3D10DeviceChild methods */
114 d3d10_vertex_shader_GetDevice,
115 d3d10_vertex_shader_GetPrivateData,
116 d3d10_vertex_shader_SetPrivateData,
117 d3d10_vertex_shader_SetPrivateDataInterface,
120 /* IUnknown methods */
122 static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_QueryInterface(ID3D10GeometryShader *iface,
123 REFIID riid, void **object)
125 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
127 if (IsEqualGUID(riid, &IID_ID3D10GeometryShader)
128 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
129 || IsEqualGUID(riid, &IID_IUnknown))
131 IUnknown_AddRef(iface);
132 *object = iface;
133 return S_OK;
136 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
138 *object = NULL;
139 return E_NOINTERFACE;
142 static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_AddRef(ID3D10GeometryShader *iface)
144 struct d3d10_geometry_shader *This = (struct d3d10_geometry_shader *)iface;
145 ULONG refcount = InterlockedIncrement(&This->refcount);
147 TRACE("%p increasing refcount to %u\n", This, refcount);
149 return refcount;
152 static ULONG STDMETHODCALLTYPE d3d10_geometry_shader_Release(ID3D10GeometryShader *iface)
154 struct d3d10_geometry_shader *This = (struct d3d10_geometry_shader *)iface;
155 ULONG refcount = InterlockedDecrement(&This->refcount);
157 TRACE("%p decreasing refcount to %u\n", This, refcount);
159 if (!refcount)
161 HeapFree(GetProcessHeap(), 0, This);
164 return refcount;
167 /* ID3D10DeviceChild methods */
169 static void STDMETHODCALLTYPE d3d10_geometry_shader_GetDevice(ID3D10GeometryShader *iface, ID3D10Device **device)
171 FIXME("iface %p, device %p stub!\n", iface, device);
174 static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_GetPrivateData(ID3D10GeometryShader *iface,
175 REFGUID guid, UINT *data_size, void *data)
177 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
178 iface, debugstr_guid(guid), data_size, data);
180 return E_NOTIMPL;
183 static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateData(ID3D10GeometryShader *iface,
184 REFGUID guid, UINT data_size, const void *data)
186 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
187 iface, debugstr_guid(guid), data_size, data);
189 return E_NOTIMPL;
192 static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateDataInterface(ID3D10GeometryShader *iface,
193 REFGUID guid, const IUnknown *data)
195 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
197 return E_NOTIMPL;
200 const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl =
202 /* IUnknown methods */
203 d3d10_geometry_shader_QueryInterface,
204 d3d10_geometry_shader_AddRef,
205 d3d10_geometry_shader_Release,
206 /* ID3D10DeviceChild methods */
207 d3d10_geometry_shader_GetDevice,
208 d3d10_geometry_shader_GetPrivateData,
209 d3d10_geometry_shader_SetPrivateData,
210 d3d10_geometry_shader_SetPrivateDataInterface,
213 /* IUnknown methods */
215 static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface(ID3D10PixelShader *iface,
216 REFIID riid, void **object)
218 TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
220 if (IsEqualGUID(riid, &IID_ID3D10PixelShader)
221 || IsEqualGUID(riid, &IID_ID3D10DeviceChild)
222 || IsEqualGUID(riid, &IID_IUnknown))
224 IUnknown_AddRef(iface);
225 *object = iface;
226 return S_OK;
229 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
231 *object = NULL;
232 return E_NOINTERFACE;
235 static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_AddRef(ID3D10PixelShader *iface)
237 struct d3d10_pixel_shader *This = (struct d3d10_pixel_shader *)iface;
238 ULONG refcount = InterlockedIncrement(&This->refcount);
240 TRACE("%p increasing refcount to %u\n", This, refcount);
242 return refcount;
245 static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *iface)
247 struct d3d10_pixel_shader *This = (struct d3d10_pixel_shader *)iface;
248 ULONG refcount = InterlockedDecrement(&This->refcount);
250 TRACE("%p decreasing refcount to %u\n", This, refcount);
252 if (!refcount)
254 HeapFree(GetProcessHeap(), 0, This);
257 return refcount;
260 /* ID3D10DeviceChild methods */
262 static void STDMETHODCALLTYPE d3d10_pixel_shader_GetDevice(ID3D10PixelShader *iface, ID3D10Device **device)
264 FIXME("iface %p, device %p stub!\n", iface, device);
267 static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData(ID3D10PixelShader *iface,
268 REFGUID guid, UINT *data_size, void *data)
270 FIXME("iface %p, guid %s, data_size %p, data %p stub!\n",
271 iface, debugstr_guid(guid), data_size, data);
273 return E_NOTIMPL;
276 static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateData(ID3D10PixelShader *iface,
277 REFGUID guid, UINT data_size, const void *data)
279 FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
280 iface, debugstr_guid(guid), data_size, data);
282 return E_NOTIMPL;
285 static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateDataInterface(ID3D10PixelShader *iface,
286 REFGUID guid, const IUnknown *data)
288 FIXME("iface %p, guid %s, data %p stub!\n", iface, debugstr_guid(guid), data);
290 return E_NOTIMPL;
293 const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl =
295 /* IUnknown methods */
296 d3d10_pixel_shader_QueryInterface,
297 d3d10_pixel_shader_AddRef,
298 d3d10_pixel_shader_Release,
299 /* ID3D10DeviceChild methods */
300 d3d10_pixel_shader_GetDevice,
301 d3d10_pixel_shader_GetPrivateData,
302 d3d10_pixel_shader_SetPrivateData,
303 d3d10_pixel_shader_SetPrivateDataInterface,