Commit 39d6f648 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10core: Add a separate function for d3d10_geometry_shader initialization.

parent bf10dbe8
......@@ -145,13 +145,14 @@ HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d1
const void *byte_code, SIZE_T byte_code_length) DECLSPEC_HIDDEN;
/* ID3D10GeometryShader */
extern const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl DECLSPEC_HIDDEN;
struct d3d10_geometry_shader
{
const struct ID3D10GeometryShaderVtbl *vtbl;
LONG refcount;
};
HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader);
/* ID3D10PixelShader */
struct d3d10_pixel_shader
{
......
......@@ -965,6 +965,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device
const void *byte_code, SIZE_T byte_code_length, ID3D10GeometryShader **shader)
{
struct d3d10_geometry_shader *object;
HRESULT hr;
FIXME("iface %p, byte_code %p, byte_code_length %lu, shader %p stub!\n",
iface, byte_code, byte_code_length, shader);
......@@ -976,9 +977,14 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShader(ID3D10Device
return E_OUTOFMEMORY;
}
object->vtbl = &d3d10_geometry_shader_vtbl;
object->refcount = 1;
hr = d3d10_geometry_shader_init(object);
if (FAILED(hr))
{
WARN("Failed to initialize geometry shader, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
}
TRACE("Created geometry shader %p.\n", object);
*shader = (ID3D10GeometryShader *)object;
return S_OK;
......
......@@ -352,7 +352,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_geometry_shader_SetPrivateDataInterface(I
return E_NOTIMPL;
}
const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl =
static const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl =
{
/* IUnknown methods */
d3d10_geometry_shader_QueryInterface,
......@@ -365,6 +365,14 @@ const struct ID3D10GeometryShaderVtbl d3d10_geometry_shader_vtbl =
d3d10_geometry_shader_SetPrivateDataInterface,
};
HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader)
{
shader->vtbl = &d3d10_geometry_shader_vtbl;
shader->refcount = 1;
return S_OK;
}
/* IUnknown methods */
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface(ID3D10PixelShader *iface,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment