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

wined3d: wined3d_device_get_texture_stage_state() never fails.

parent 26c07140
......@@ -1785,7 +1785,6 @@ static HRESULT WINAPI d3d8_device_GetTextureStageState(IDirect3DDevice8 *iface,
{
struct d3d8_device *device = impl_from_IDirect3DDevice8(iface);
const struct tss_lookup *l;
HRESULT hr = D3D_OK;
TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, Type, value);
......@@ -1801,10 +1800,10 @@ static HRESULT WINAPI d3d8_device_GetTextureStageState(IDirect3DDevice8 *iface,
if (l->sampler_state)
*value = wined3d_device_get_sampler_state(device->wined3d_device, stage, l->state);
else
hr = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->state, value);
*value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->state);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d8_device_SetTextureStageState(IDirect3DDevice8 *iface,
......
......@@ -1752,7 +1752,6 @@ static HRESULT WINAPI d3d9_device_GetTextureStageState(IDirect3DDevice9Ex *iface
DWORD stage, D3DTEXTURESTAGESTATETYPE state, DWORD *value)
{
struct d3d9_device *device = impl_from_IDirect3DDevice9Ex(iface);
HRESULT hr;
TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, state, value);
......@@ -1763,10 +1762,10 @@ static HRESULT WINAPI d3d9_device_GetTextureStageState(IDirect3DDevice9Ex *iface
}
wined3d_mutex_lock();
hr = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, tss_lookup[state], value);
*value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, tss_lookup[state]);
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d9_device_SetTextureStageState(IDirect3DDevice9Ex *iface,
......
......@@ -2401,12 +2401,12 @@ static HRESULT WINAPI d3d_device3_GetRenderState(IDirect3DDevice3 *iface,
device->legacyTextureBlending = TRUE;
wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_OP, &colorop);
wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG1, &colorarg1);
wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG2, &colorarg2);
wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_OP, &alphaop);
wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG1, &alphaarg1);
wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG2, &alphaarg2);
colorop = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_OP);
colorarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG1);
colorarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_COLOR_ARG2);
alphaop = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_OP);
alphaarg1 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG1);
alphaarg2 = wined3d_device_get_texture_stage_state(device->wined3d_device, 0, WINED3D_TSS_ALPHA_ARG2);
if (colorop == WINED3D_TOP_SELECT_ARG1 && colorarg1 == WINED3DTA_TEXTURE
&& alphaop == WINED3D_TOP_SELECT_ARG1 && alphaarg1 == WINED3DTA_TEXTURE)
......@@ -4543,7 +4543,6 @@ static HRESULT d3d_device7_GetTextureStageState(IDirect3DDevice7 *iface,
{
struct d3d_device *device = impl_from_IDirect3DDevice7(iface);
const struct tss_lookup *l;
HRESULT hr = D3D_OK;
TRACE("iface %p, stage %u, state %#x, value %p.\n",
iface, stage, state, value);
......@@ -4623,12 +4622,12 @@ static HRESULT d3d_device7_GetTextureStageState(IDirect3DDevice7 *iface,
}
else
{
hr = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->state, value);
*value = wined3d_device_get_texture_stage_state(device->wined3d_device, stage, l->state);
}
wined3d_mutex_unlock();
return hr;
return D3D_OK;
}
static HRESULT WINAPI d3d_device7_GetTextureStageState_FPUSetup(IDirect3DDevice7 *iface,
......
......@@ -3435,22 +3435,19 @@ void CDECL wined3d_device_set_texture_stage_state(struct wined3d_device *device,
device_invalidate_state(device, STATE_TEXTURESTAGE(stage, state));
}
HRESULT CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, enum wined3d_texture_stage_state state, DWORD *value)
DWORD CDECL wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, enum wined3d_texture_stage_state state)
{
TRACE("device %p, stage %u, state %s, value %p.\n",
device, stage, debug_d3dtexturestate(state), value);
TRACE("device %p, stage %u, state %s.\n",
device, stage, debug_d3dtexturestate(state));
if (state > WINED3D_HIGHEST_TEXTURE_STATE)
{
WARN("Invalid state %#x passed.\n", state);
return WINED3D_OK;
return 0;
}
*value = device->updateStateBlock->state.texture_states[stage][state];
TRACE("Returning %#x.\n", *value);
return WINED3D_OK;
return device->updateStateBlock->state.texture_states[stage][state];
}
HRESULT CDECL wined3d_device_set_texture(struct wined3d_device *device,
......
......@@ -86,7 +86,7 @@
@ cdecl wined3d_device_get_swapchain(ptr long)
@ cdecl wined3d_device_get_swapchain_count(ptr)
@ cdecl wined3d_device_get_texture(ptr long ptr)
@ cdecl wined3d_device_get_texture_stage_state(ptr long long ptr)
@ cdecl wined3d_device_get_texture_stage_state(ptr long long)
@ cdecl wined3d_device_get_transform(ptr long ptr)
@ cdecl wined3d_device_get_vertex_declaration(ptr)
@ cdecl wined3d_device_get_vertex_shader(ptr)
......
......@@ -2160,8 +2160,8 @@ struct wined3d_swapchain * __cdecl wined3d_device_get_swapchain(const struct win
UINT __cdecl wined3d_device_get_swapchain_count(const struct wined3d_device *device);
HRESULT __cdecl wined3d_device_get_texture(const struct wined3d_device *device,
UINT stage, struct wined3d_texture **texture);
HRESULT __cdecl wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, enum wined3d_texture_stage_state state, DWORD *value);
DWORD __cdecl wined3d_device_get_texture_stage_state(const struct wined3d_device *device,
UINT stage, enum wined3d_texture_stage_state state);
void __cdecl wined3d_device_get_transform(const struct wined3d_device *device,
enum wined3d_transform_state state, struct wined3d_matrix *matrix);
struct wined3d_vertex_declaration * __cdecl wined3d_device_get_vertex_declaration(const struct wined3d_device *device);
......
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