Matteo Bruni : d3d8: Fix texture stage index checks.
Alexandre Julliard
julliard at winehq.org
Thu Feb 27 17:15:10 CST 2020
Module: wine
Branch: master
Commit: 565f7b4494785b24efc60220c05b9c5e5b5c9930
URL: https://source.winehq.org/git/wine.git/?a=commit;h=565f7b4494785b24efc60220c05b9c5e5b5c9930
Author: Matteo Bruni <mbruni at codeweavers.com>
Date: Thu Feb 27 13:31:09 2020 +0100
d3d8: Fix texture stage index checks.
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d8/device.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 869a6a2dd0..9793eda0c3 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -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;
More information about the wine-cvs
mailing list