[PATCH 4/5] wined3d: Translate LOGP to LG2 in the ARB shader backend.

Stefan Dösinger stefan at codeweavers.com
Thu Mar 27 05:46:13 CDT 2014


The outputs of d3d's LOGP and ARB's EXP are different. This is according
to the DirectX 9 sdk docs and confirmed by the test_scalar_instructions
test in dlls/d3d8/tests/visual.c

The issues section in ARB_vertex_program suggest LOG was retained for
compatibility with d3d8. It would be interesting to check the behavior
of LOGP and LOG on Shader Model 1 hardware. Unfortunately I no longer
have such hardware since my r200 laptop died.
---
 dlls/wined3d/arb_program_shader.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index 5a76332..14e11da 100644
--- a/dlls/wined3d/arb_program_shader.c
+++ b/dlls/wined3d/arb_program_shader.c
@@ -2518,12 +2518,12 @@ static void shader_hw_scalar_op(const struct wined3d_shader_instruction *ins)
         case WINED3DSIH_EXP:  instruction = "EX2"; break;
         case WINED3DSIH_EXPP: instruction = "EXP"; break;
         case WINED3DSIH_LOG:
-            src0_copy.modifiers = abs_modifier(src0_copy.modifiers, &need_abs);
-            instruction = "LG2";
-            break;
         case WINED3DSIH_LOGP:
+            /* The precision requirements suggest that LOGP matches ARBvp's LOG
+             * instruction, but notice that the output of those instructions is
+             * different. */
             src0_copy.modifiers = abs_modifier(src0_copy.modifiers, &need_abs);
-            instruction = "LOG";
+            instruction = "LG2";
             break;
         default: instruction = "";
             FIXME("Unhandled opcode %#x\n", ins->handler_idx);
-- 
1.8.3.2




More information about the wine-patches mailing list