d3d10core: Implement d3d10_device_VSGetSamplers().

This commit is contained in:
Henri Verbeet 2012-12-05 21:01:48 +01:00 committed by Alexandre Julliard
parent e5805c316c
commit c98767a425
4 changed files with 35 additions and 1 deletions

View File

@ -772,8 +772,27 @@ static void STDMETHODCALLTYPE d3d10_device_VSGetShaderResources(ID3D10Device *if
static void STDMETHODCALLTYPE d3d10_device_VSGetSamplers(ID3D10Device *iface,
UINT start_slot, UINT sampler_count, ID3D10SamplerState **samplers)
{
FIXME("iface %p, start_slot %u, sampler_count %u, samplers %p stub!\n",
struct d3d10_device *device = impl_from_ID3D10Device(iface);
unsigned int i;
TRACE("iface %p, start_slot %u, sampler_count %u, samplers %p.\n",
iface, start_slot, sampler_count, samplers);
for (i = 0; i < sampler_count; ++i)
{
struct d3d10_sampler_state *sampler_impl;
struct wined3d_sampler *wined3d_sampler;
if (!(wined3d_sampler = wined3d_device_get_vs_sampler(device->wined3d_device, start_slot + i)))
{
samplers[i] = NULL;
continue;
}
sampler_impl = wined3d_sampler_get_parent(wined3d_sampler);
samplers[i] = &sampler_impl->ID3D10SamplerState_iface;
ID3D10SamplerState_AddRef(samplers[i]);
}
}
static void STDMETHODCALLTYPE d3d10_device_GetPredication(ID3D10Device *iface,

View File

@ -2605,6 +2605,19 @@ void CDECL wined3d_device_set_vs_sampler(struct wined3d_device *device, UINT idx
wined3d_sampler_decref(prev);
}
struct wined3d_sampler * CDECL wined3d_device_get_vs_sampler(const struct wined3d_device *device, UINT idx)
{
TRACE("device %p, idx %u.\n", device, idx);
if (idx >= MAX_SAMPLER_OBJECTS)
{
WARN("Invalid sampler index %u.\n", idx);
return NULL;
}
return device->stateBlock->state.vs_sampler[idx];
}
HRESULT CDECL wined3d_device_set_vs_consts_b(struct wined3d_device *device,
UINT start_register, const BOOL *constants, UINT bool_count)
{

View File

@ -100,6 +100,7 @@
@ cdecl wined3d_device_get_vs_consts_b(ptr long ptr long)
@ cdecl wined3d_device_get_vs_consts_f(ptr long ptr long)
@ cdecl wined3d_device_get_vs_consts_i(ptr long ptr long)
@ cdecl wined3d_device_get_vs_sampler(ptr long)
@ cdecl wined3d_device_incref(ptr)
@ cdecl wined3d_device_init_3d(ptr ptr)
@ cdecl wined3d_device_init_gdi(ptr ptr)

View File

@ -2180,6 +2180,7 @@ HRESULT __cdecl wined3d_device_get_vs_consts_f(const struct wined3d_device *devi
UINT start_register, float *constants, UINT vector4f_count);
HRESULT __cdecl wined3d_device_get_vs_consts_i(const struct wined3d_device *device,
UINT start_register, int *constants, UINT vector4i_count);
struct wined3d_sampler * __cdecl wined3d_device_get_vs_sampler(const struct wined3d_device *device, UINT idx);
ULONG __cdecl wined3d_device_incref(struct wined3d_device *device);
HRESULT __cdecl wined3d_device_init_3d(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc);
HRESULT __cdecl wined3d_device_init_gdi(struct wined3d_device *device, struct wined3d_swapchain_desc *swapchain_desc);