[PATCH] Replace MUL + ADD with MAD. This optimizes the P8 fragment shader.

Roderick Colenbrander thunderbird2k at gmx.net
Fri Oct 12 06:34:43 CDT 2007


---
 dlls/wined3d/surface.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index fc1b10d..ade950e 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1980,8 +1980,7 @@ const char *fragment_palette_conversion =
     "TEMP index;\n"
     "PARAM constants = { 0.996, 0.00195, 0, 0 };\n" /* { 255/256, 0.5/255*255/256, 0, 0 } */
     "TEX index.x, fragment.texcoord[0], texture[0], 2D;\n" /* store the red-component of the current pixel */
-    "MUL index.x, index.x, constants.x;\n" /* Scale the index by 255/256 */
-    "ADD index.x, index.x, constants.y;\n" /* Add a bias of '0.5' in order to sample in the middle */
+    "MAD index.x, index.x, constants.x, constants.y;\n" /* Scale the index by 255/256 and add a bias of '0.5' in order to sample in the middle */
     "TEX result.color, index, texture[1], 1D;\n" /* use the red-component as a index in the palette to get the final color */
     "END";
 
-- 
1.5.2.4


--========GMX117751192188297503162--



More information about the wine-patches mailing list