wined3d: wined3d_device_set_sampler_state() never fails.

This commit is contained in:
Henri Verbeet 2012-09-18 22:13:57 +02:00 committed by Alexandre Julliard
parent b0795aafd3
commit 0d96be2c20
5 changed files with 16 additions and 21 deletions

View File

@ -1812,7 +1812,7 @@ static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface,
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
const struct tss_lookup *l;
HRESULT hr;
HRESULT hr = D3D_OK;
TRACE("iface %p, stage %u, state %#x, value %#x.\n", iface, stage, type, value);
@ -1826,7 +1826,7 @@ static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface,
wined3d_mutex_lock();
if (l->sampler_state)
hr = wined3d_device_set_sampler_state(device->wined3d_device, stage, l->state, value);
wined3d_device_set_sampler_state(device->wined3d_device, stage, l->state, value);
else
hr = wined3d_device_set_texture_stage_state(device->wined3d_device, stage, l->state, value);
wined3d_mutex_unlock();

View File

@ -1809,15 +1809,14 @@ static HRESULT WINAPI DECLSPEC_HOTPATCH d3d9_device_SetSamplerState(IDirect3DDev
DWORD sampler, D3DSAMPLERSTATETYPE state, DWORD value)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
HRESULT hr;
TRACE("iface %p, sampler %u, state %#x, value %#x.\n", iface, sampler, state, value);
wined3d_mutex_lock();
hr = wined3d_device_set_sampler_state(device->wined3d_device, sampler, state, value);
wined3d_device_set_sampler_state(device->wined3d_device, sampler, state, value);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d9_device_ValidateDevice(IDirect3DDevice9Ex *iface, DWORD *pass_count)

View File

@ -2509,7 +2509,7 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
D3DRENDERSTATETYPE state, DWORD value)
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
HRESULT hr;
HRESULT hr = D3D_OK;
TRACE("iface %p, state %#x, value %#x.\n", iface, state, value);
@ -2552,7 +2552,7 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
break;
}
hr = wined3d_device_set_sampler_state(device->wined3d_device, 0, WINED3D_SAMP_MAG_FILTER, tex_mag);
wined3d_device_set_sampler_state(device->wined3d_device, 0, WINED3D_SAMP_MAG_FILTER, tex_mag);
break;
}
@ -2597,7 +2597,7 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
wined3d_device_set_sampler_state(device->wined3d_device,
0, WINED3D_SAMP_MIP_FILTER, tex_mip);
hr = wined3d_device_set_sampler_state(device->wined3d_device,
wined3d_device_set_sampler_state(device->wined3d_device,
0, WINED3D_SAMP_MIN_FILTER, tex_min);
break;
}
@ -2607,11 +2607,11 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
0, WINED3D_SAMP_ADDRESS_V, value);
/* Drop through */
case D3DRENDERSTATE_TEXTUREADDRESSU:
hr = wined3d_device_set_sampler_state(device->wined3d_device,
wined3d_device_set_sampler_state(device->wined3d_device,
0, WINED3D_SAMP_ADDRESS_U, value);
break;
case D3DRENDERSTATE_TEXTUREADDRESSV:
hr = wined3d_device_set_sampler_state(device->wined3d_device,
wined3d_device_set_sampler_state(device->wined3d_device,
0, WINED3D_SAMP_ADDRESS_V, value);
break;
@ -2630,7 +2630,6 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
case D3DRENDERSTATE_ZBIAS:
wined3d_device_set_render_state(device->wined3d_device, WINED3D_RS_DEPTHBIAS, value);
hr = D3D_OK;
break;
default:
@ -2643,7 +2642,6 @@ static HRESULT d3d_device7_SetRenderState(IDirect3DDevice7 *iface,
}
wined3d_device_set_render_state(device->wined3d_device, state, value);
hr = D3D_OK;
break;
}
wined3d_mutex_unlock();
@ -4728,7 +4726,7 @@ static HRESULT d3d_device7_SetTextureStageState(IDirect3DDevice7 *iface,
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
const struct tss_lookup *l;
HRESULT hr;
HRESULT hr = D3D_OK;
TRACE("iface %p, stage %u, state %#x, value %#x.\n",
iface, stage, state, value);
@ -4806,7 +4804,7 @@ static HRESULT d3d_device7_SetTextureStageState(IDirect3DDevice7 *iface,
break;
}
hr = wined3d_device_set_sampler_state(device->wined3d_device, stage, l->state, value);
wined3d_device_set_sampler_state(device->wined3d_device, stage, l->state, value);
}
else
{

View File

@ -2325,7 +2325,7 @@ DWORD CDECL wined3d_device_get_render_state(const struct wined3d_device *device,
return device->stateBlock->state.render_states[state];
}
HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
void CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
UINT sampler_idx, enum wined3d_sampler_state state, DWORD value)
{
DWORD old_value;
@ -2340,7 +2340,7 @@ HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
/ sizeof(*device->stateBlock->state.sampler_states))
{
WARN("Invalid sampler %u.\n", sampler_idx);
return WINED3D_OK; /* Windows accepts overflowing this array ... we do not. */
return; /* Windows accepts overflowing this array ... we do not. */
}
old_value = device->stateBlock->state.sampler_states[sampler_idx][state];
@ -2351,18 +2351,16 @@ HRESULT CDECL wined3d_device_set_sampler_state(struct wined3d_device *device,
if (device->isRecordingState)
{
TRACE("Recording... not performing anything.\n");
return WINED3D_OK;
return;
}
if (old_value == value)
{
TRACE("Application is setting the old value over, nothing to do.\n");
return WINED3D_OK;
return;
}
device_invalidate_state(device, STATE_SAMPLER(sampler_idx));
return WINED3D_OK;
}
HRESULT CDECL wined3d_device_get_sampler_state(const struct wined3d_device *device,

View File

@ -2223,7 +2223,7 @@ void __cdecl wined3d_device_set_render_state(struct wined3d_device *device,
enum wined3d_render_state state, DWORD value);
HRESULT __cdecl wined3d_device_set_render_target(struct wined3d_device *device,
UINT render_target_idx, struct wined3d_surface *render_target, BOOL set_viewport);
HRESULT __cdecl wined3d_device_set_sampler_state(struct wined3d_device *device,
void __cdecl wined3d_device_set_sampler_state(struct wined3d_device *device,
UINT sampler_idx, enum wined3d_sampler_state state, DWORD value);
HRESULT __cdecl wined3d_device_set_scissor_rect(struct wined3d_device *device, const RECT *rect);
HRESULT __cdecl wined3d_device_set_software_vertex_processing(struct wined3d_device *device, BOOL software);