d3d10core: Implement d3d10_pixel_shader_SetPrivateData().

This commit is contained in:
Henri Verbeet 2015-02-27 12:29:43 +01:00 committed by Alexandre Julliard
parent 6cd05c38a8
commit cae40a1653
2 changed files with 11 additions and 2 deletions

View File

@ -229,6 +229,7 @@ struct d3d10_pixel_shader
ID3D10PixelShader ID3D10PixelShader_iface;
LONG refcount;
struct wined3d_private_store private_store;
struct wined3d_shader *wined3d_shader;
ID3D10Device1 *device;
};

View File

@ -560,10 +560,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_GetPrivateData(ID3D10PixelSh
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateData(ID3D10PixelShader *iface,
REFGUID guid, UINT data_size, const void *data)
{
FIXME("iface %p, guid %s, data_size %u, data %p stub!\n",
struct d3d10_pixel_shader *shader = impl_from_ID3D10PixelShader(iface);
TRACE("iface %p, guid %s, data_size %u, data %p.\n",
iface, debugstr_guid(guid), data_size, data);
return E_NOTIMPL;
return d3d10_set_private_data(&shader->private_store, guid, data_size, data);
}
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_SetPrivateDataInterface(ID3D10PixelShader *iface,
@ -589,6 +591,9 @@ static const struct ID3D10PixelShaderVtbl d3d10_pixel_shader_vtbl =
static void STDMETHODCALLTYPE d3d10_pixel_shader_wined3d_object_destroyed(void *parent)
{
struct d3d10_pixel_shader *shader = parent;
wined3d_private_store_cleanup(&shader->private_store);
HeapFree(GetProcessHeap(), 0, parent);
}
@ -608,12 +613,14 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
shader->ID3D10PixelShader_iface.lpVtbl = &d3d10_pixel_shader_vtbl;
shader->refcount = 1;
wined3d_private_store_init(&shader->private_store);
shader_info.input_signature = &input_signature;
shader_info.output_signature = &output_signature;
if (FAILED(hr = shader_extract_from_dxbc(byte_code, byte_code_length, &shader_info)))
{
ERR("Failed to extract shader, hr %#x.\n", hr);
wined3d_private_store_cleanup(&shader->private_store);
return hr;
}
@ -629,6 +636,7 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
if (FAILED(hr))
{
WARN("Failed to create wined3d pixel shader, hr %#x.\n", hr);
wined3d_private_store_cleanup(&shader->private_store);
return E_INVALIDARG;
}