Commit ec415eaf authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

d3d10core: Use unsafe_impl_from_ID3D10VertexShader for an app provided iface.

parent d67d7ebb
......@@ -176,6 +176,7 @@ struct d3d10_vertex_shader
HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d10_device *device,
const void *byte_code, SIZE_T byte_code_length) DECLSPEC_HIDDEN;
struct d3d10_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface) DECLSPEC_HIDDEN;
/* ID3D10GeometryShader */
struct d3d10_geometry_shader
......
......@@ -151,7 +151,7 @@ static void STDMETHODCALLTYPE d3d10_device_VSSetShader(ID3D10Device *iface,
ID3D10VertexShader *shader)
{
struct d3d10_device *This = impl_from_ID3D10Device(iface);
struct d3d10_vertex_shader *vs = (struct d3d10_vertex_shader *)shader;
struct d3d10_vertex_shader *vs = unsafe_impl_from_ID3D10VertexShader(shader);
TRACE("iface %p, shader %p\n", iface, shader);
......
......@@ -19,6 +19,7 @@
#include "config.h"
#include "wine/port.h"
#include <assert.h>
#include "d3d10core_private.h"
......@@ -132,6 +133,11 @@ void shader_free_signature(struct wined3d_shader_signature *s)
HeapFree(GetProcessHeap(), 0, s->elements);
}
static inline struct d3d10_vertex_shader *impl_from_ID3D10VertexShader(ID3D10VertexShader *iface)
{
return CONTAINING_RECORD(iface, struct d3d10_vertex_shader, vtbl);
}
/* IUnknown methods */
static HRESULT STDMETHODCALLTYPE d3d10_vertex_shader_QueryInterface(ID3D10VertexShader *iface,
......@@ -267,6 +273,15 @@ HRESULT d3d10_vertex_shader_init(struct d3d10_vertex_shader *shader, struct d3d1
return S_OK;
}
struct d3d10_vertex_shader *unsafe_impl_from_ID3D10VertexShader(ID3D10VertexShader *iface)
{
if (!iface)
return NULL;
assert(iface->lpVtbl == &d3d10_vertex_shader_vtbl);
return impl_from_ID3D10VertexShader(iface);
}
static inline struct d3d10_geometry_shader *impl_from_ID3D10GeometryShader(ID3D10GeometryShader *iface)
{
return CONTAINING_RECORD(iface, struct d3d10_geometry_shader, ID3D10GeometryShader_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