wined3d: Keep track of textures projection state in compiled pixel shaders. [try 2]

Matteo Bruni matteo.mystral at gmail.com
Tue Sep 28 16:07:44 CDT 2010


-------------- next part --------------
From 2eb425af7a7ad6558465196d4dda4042d4a6fadd Mon Sep 17 00:00:00 2001
From: Matteo Bruni <matteo.mystral at gmail.com>
Date: Sat, 25 Sep 2010 19:37:47 +0200
Subject: wined3d: Keep track of textures projection state in compiled pixel shaders.

---
 dlls/wined3d/shader.c          |   10 +++++++++-
 dlls/wined3d/wined3d_private.h |    4 ++--
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index 8d380b7..e4fbe0d 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2082,7 +2082,15 @@ void find_ps_compile_args(IWineD3DPixelShaderImpl *shader,
         if(rt->resource.format->Flags & WINED3DFMT_FLAG_SRGB_WRITE) args->srgb_correction = 1;
     }
 
-    args->np2_fixup = 0;
+    if (shader->baseShader.reg_maps.shader_version.major == 1
+            && shader->baseShader.reg_maps.shader_version.minor <= 3)
+    {
+        for (i = 0; i < 4; ++i)
+        {
+            if (stateblock->state.texture_states[i][WINED3DTSS_TEXTURETRANSFORMFLAGS] & WINED3DTTFF_PROJECTED)
+                args->projected |= 1 << i;
+        }
+    }
 
     for (i = 0; i < MAX_FRAGMENT_SAMPLERS; ++i)
     {
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 8adcc35..3581b7b 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -681,9 +681,9 @@ struct ps_compile_args {
     struct color_fixup_desc     color_fixup[MAX_FRAGMENT_SAMPLERS];
     enum vertexprocessing_mode  vp_mode;
     enum fogmode                fog;
-    /* Projected textures(ps 1.0-1.3) */
+    WORD                        projected; /* ps 1.0-1.3, 4 textures */
     /* Texture types(2D, Cube, 3D) in ps 1.x */
-    BOOL                        srgb_correction;
+    WORD                        srgb_correction;
     WORD                        np2_fixup;
     /* Bitmap for NP2 texcoord fixups (16 samplers max currently).
        D3D9 has a limit of 16 samplers and the fixup is superfluous
-- 
1.7.2.2


More information about the wine-patches mailing list