diff --git a/dlls/d3d10core/device.c b/dlls/d3d10core/device.c index 0f30a1373e6..84fff724a80 100644 --- a/dlls/d3d10core/device.c +++ b/dlls/d3d10core/device.c @@ -546,7 +546,21 @@ static void STDMETHODCALLTYPE d3d10_device_GSGetConstantBuffers(ID3D10Device *if static void STDMETHODCALLTYPE d3d10_device_GSGetShader(ID3D10Device *iface, ID3D10GeometryShader **shader) { - FIXME("iface %p, shader %p stub!\n", iface, shader); + struct d3d10_device *device = impl_from_ID3D10Device(iface); + struct d3d10_geometry_shader *shader_impl; + struct wined3d_shader *wined3d_shader; + + TRACE("iface %p, shader %p.\n", iface, shader); + + if (!(wined3d_shader = wined3d_device_get_geometry_shader(device->wined3d_device))) + { + *shader = NULL; + return; + } + + shader_impl = wined3d_shader_get_parent(wined3d_shader); + *shader = &shader_impl->ID3D10GeometryShader_iface; + ID3D10GeometryShader_AddRef(*shader); } static void STDMETHODCALLTYPE d3d10_device_IAGetPrimitiveTopology(ID3D10Device *iface, diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 979a248ab5a..2242cc3ab24 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3012,6 +3012,13 @@ void CDECL wined3d_device_set_geometry_shader(struct wined3d_device *device, str device_invalidate_state(device, STATE_GEOMETRY_SHADER); } +struct wined3d_shader * CDECL wined3d_device_get_geometry_shader(const struct wined3d_device *device) +{ + TRACE("device %p.\n", device); + + return device->stateBlock->state.geometry_shader; +} + /* Context activation is done by the caller. */ /* Do not call while under the GL lock. */ #define copy_and_next(dest, src, size) memcpy(dest, src, size); dest += (size) diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 3bfa239c675..f8364e13d47 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -64,6 +64,7 @@ @ cdecl wined3d_device_get_display_mode(ptr long ptr ptr) @ cdecl wined3d_device_get_front_buffer_data(ptr long ptr) @ cdecl wined3d_device_get_gamma_ramp(ptr long ptr) +@ cdecl wined3d_device_get_geometry_shader(ptr) @ cdecl wined3d_device_get_index_buffer(ptr) @ cdecl wined3d_device_get_light(ptr long ptr) @ cdecl wined3d_device_get_light_enable(ptr long ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index fff8bd9b2bb..7169a25f259 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2124,6 +2124,7 @@ HRESULT __cdecl wined3d_device_get_front_buffer_data(const struct wined3d_device UINT swapchain_idx, struct wined3d_surface *dst_surface); void __cdecl wined3d_device_get_gamma_ramp(const struct wined3d_device *device, UINT swapchain_idx, struct wined3d_gamma_ramp *ramp); +struct wined3d_shader * __cdecl wined3d_device_get_geometry_shader(const struct wined3d_device *device); struct wined3d_buffer * __cdecl wined3d_device_get_index_buffer(const struct wined3d_device *device); HRESULT __cdecl wined3d_device_get_light(const struct wined3d_device *device, UINT light_idx, struct wined3d_light *light);