[PATCH] wined3d: Do not try to use not available texture stages in set_tex_op_nvr

Christian Costa titan.costa at wanadoo.fr
Fri Jan 1 08:47:45 CST 2010


---

 dlls/wined3d/nvidia_texture_shader.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
-------------- next part --------------
diff --git a/dlls/wined3d/nvidia_texture_shader.c b/dlls/wined3d/nvidia_texture_shader.c
index 82a71da..60e40f6 100644
--- a/dlls/wined3d/nvidia_texture_shader.c
+++ b/dlls/wined3d/nvidia_texture_shader.c
@@ -142,6 +142,12 @@ void set_tex_op_nvrc(IWineD3DDevice *iface, BOOL is_alpha, int stage, WINED3DTEX
     TRACE("stage %d, is_alpha %d, op %s, arg1 %#x, arg2 %#x, arg3 %#x, texture_idx %d\n",
           stage, is_alpha, debug_d3dtop(op), arg1, arg2, arg3, texture_idx);
 
+    if (stage > (gl_info->limits.texture_stages-1))
+    {
+         ERR("Texture stage %d invalid (only %d availables)\n", stage, gl_info->limits.texture_stages);
+         return;
+    }
+
     /* If a texture stage references an invalid texture unit the stage just
     * passes through the result from the previous stage */
     if (is_invalid_op(This, stage, op, arg1, arg2, arg3)) {


More information about the wine-patches mailing list