Commit 565f7b44 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

d3d8: Fix texture stage index checks.

parent e1926af2
......@@ -2159,10 +2159,7 @@ static HRESULT WINAPI d3d8_device_GetTexture(IDirect3DDevice8 *iface, DWORD stag
if (!texture)
return D3DERR_INVALIDCALL;
if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3)
stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (stage >= WINED3D_MAX_COMBINED_SAMPLERS)
if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS)
{
WARN("Ignoring invalid stage %u.\n", stage);
*texture = NULL;
......@@ -2253,10 +2250,7 @@ static HRESULT WINAPI d3d8_device_GetTextureStageState(IDirect3DDevice8 *iface,
TRACE("iface %p, stage %u, state %#x, value %p.\n", iface, stage, state, value);
if (stage >= WINED3DVERTEXTEXTURESAMPLER0 && stage <= WINED3DVERTEXTEXTURESAMPLER3)
stage -= (WINED3DVERTEXTEXTURESAMPLER0 - WINED3D_MAX_FRAGMENT_SAMPLERS);
if (stage >= WINED3D_MAX_COMBINED_SAMPLERS)
if (stage >= WINED3D_MAX_FRAGMENT_SAMPLERS)
{
WARN("Invalid stage %u.\n", stage);
*value = 0;
......
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