Commit f06a57f6 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10core: Implement d3d10_device_PSGetShaderResources().

parent 8080212f
......@@ -678,8 +678,27 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetConstantBuffers(ID3D10Device1 *i
static void STDMETHODCALLTYPE d3d10_device_PSGetShaderResources(ID3D10Device1 *iface,
UINT start_slot, UINT view_count, ID3D10ShaderResourceView **views)
{
FIXME("iface %p, start_slot %u, view_count %u, views %p stub!\n",
struct d3d10_device *device = impl_from_ID3D10Device(iface);
unsigned int i;
TRACE("iface %p, start_slot %u, view_count %u, views %p.\n",
iface, start_slot, view_count, views);
for (i = 0; i < view_count; ++i)
{
struct wined3d_shader_resource_view *wined3d_view;
struct d3d10_shader_resource_view *view_impl;
if (!(wined3d_view = wined3d_device_get_ps_resource_view(device->wined3d_device, start_slot + i)))
{
views[i] = NULL;
continue;
}
view_impl = wined3d_shader_resource_view_get_parent(wined3d_view);
views[i] = &view_impl->ID3D10ShaderResourceView_iface;
ID3D10ShaderResourceView_AddRef(views[i]);
}
}
static void STDMETHODCALLTYPE d3d10_device_PSGetShader(ID3D10Device1 *iface, ID3D10PixelShader **shader)
......
......@@ -2440,6 +2440,20 @@ void CDECL wined3d_device_set_ps_resource_view(struct wined3d_device *device,
wined3d_device_set_shader_resource_view(device, WINED3D_SHADER_TYPE_PIXEL, idx, view);
}
struct wined3d_shader_resource_view * CDECL wined3d_device_get_ps_resource_view(const struct wined3d_device *device,
UINT idx)
{
TRACE("device %p, idx %u.\n", device, idx);
if (idx >= MAX_SHADER_RESOURCE_VIEWS)
{
WARN("Invalid view index %u.\n", idx);
return NULL;
}
return device->state.shader_resource_view[WINED3D_SHADER_TYPE_PIXEL][idx];
}
void CDECL wined3d_device_set_ps_sampler(struct wined3d_device *device, UINT idx, struct wined3d_sampler *sampler)
{
TRACE("device %p, idx %u, sampler %p.\n", device, idx, sampler);
......
......@@ -72,6 +72,7 @@
@ cdecl wined3d_device_get_ps_consts_b(ptr long ptr long)
@ cdecl wined3d_device_get_ps_consts_f(ptr long ptr long)
@ cdecl wined3d_device_get_ps_consts_i(ptr long ptr long)
@ cdecl wined3d_device_get_ps_resource_view(ptr long)
@ cdecl wined3d_device_get_ps_sampler(ptr long)
@ cdecl wined3d_device_get_raster_status(ptr long ptr)
@ cdecl wined3d_device_get_render_state(ptr long)
......
......@@ -2151,6 +2151,8 @@ HRESULT __cdecl wined3d_device_get_ps_consts_f(const struct wined3d_device *devi
UINT start_register, float *constants, UINT vector4f_count);
HRESULT __cdecl wined3d_device_get_ps_consts_i(const struct wined3d_device *device,
UINT start_register, int *constants, UINT vector4i_count);
struct wined3d_shader_resource_view * __cdecl wined3d_device_get_ps_resource_view(const struct wined3d_device *device,
UINT idx);
struct wined3d_sampler * __cdecl wined3d_device_get_ps_sampler(const struct wined3d_device *device, UINT idx);
HRESULT __cdecl wined3d_device_get_raster_status(const struct wined3d_device *device,
UINT swapchain_idx, struct wined3d_raster_status *raster_status);
......
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