d3d10core: Use unsafe_impl_from_ID3D10PixelShader for an app provided iface.
This commit is contained in:
parent
cc0cc6a80f
commit
887a4ff3cc
|
@ -203,6 +203,7 @@ struct d3d10_pixel_shader
|
|||
|
||||
HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_device *device,
|
||||
const void *byte_code, SIZE_T byte_code_length) DECLSPEC_HIDDEN;
|
||||
struct d3d10_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *iface) DECLSPEC_HIDDEN;
|
||||
|
||||
HRESULT shader_parse_signature(const char *data, DWORD data_size, struct wined3d_shader_signature *s) DECLSPEC_HIDDEN;
|
||||
void shader_free_signature(struct wined3d_shader_signature *s) DECLSPEC_HIDDEN;
|
||||
|
|
|
@ -133,7 +133,7 @@ static void STDMETHODCALLTYPE d3d10_device_PSSetShader(ID3D10Device *iface,
|
|||
ID3D10PixelShader *shader)
|
||||
{
|
||||
struct d3d10_device *This = impl_from_ID3D10Device(iface);
|
||||
struct d3d10_pixel_shader *ps = (struct d3d10_pixel_shader *)shader;
|
||||
struct d3d10_pixel_shader *ps = unsafe_impl_from_ID3D10PixelShader(shader);
|
||||
|
||||
TRACE("iface %p, shader %p\n", iface, shader);
|
||||
|
||||
|
|
|
@ -419,6 +419,11 @@ HRESULT d3d10_geometry_shader_init(struct d3d10_geometry_shader *shader, struct
|
|||
return S_OK;
|
||||
}
|
||||
|
||||
static inline struct d3d10_pixel_shader *impl_from_ID3D10PixelShader(ID3D10PixelShader *iface)
|
||||
{
|
||||
return CONTAINING_RECORD(iface, struct d3d10_pixel_shader, vtbl);
|
||||
}
|
||||
|
||||
/* IUnknown methods */
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_pixel_shader_QueryInterface(ID3D10PixelShader *iface,
|
||||
|
@ -553,3 +558,12 @@ HRESULT d3d10_pixel_shader_init(struct d3d10_pixel_shader *shader, struct d3d10_
|
|||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
struct d3d10_pixel_shader *unsafe_impl_from_ID3D10PixelShader(ID3D10PixelShader *iface)
|
||||
{
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == &d3d10_pixel_shader_vtbl);
|
||||
|
||||
return impl_from_ID3D10PixelShader(iface);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue