[PATCH 1/5] d3d8: Fix texture stage index checks.

Matteo Bruni mbruni at codeweavers.com
Thu Feb 27 06:31:09 CST 2020


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
In d3d8 there was no vertex shader texture fetch.

 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 869a6a2dd0d..9793eda0c36 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;
-- 
2.24.1




More information about the wine-devel mailing list