d3d8: Fix texture stage index checks.
Signed-off-by: Matteo Bruni <mbruni@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
e1926af200
commit
565f7b4494
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue