log - ps

Full precision log₂(x).


log dst, src



  • dst is the destination register.
  • src is a source register. Source register requires explicit use of replicate swizzle; that is, exactly one of the .x, .y, .z, .w swizzle components (or the .r, .g, .b, .a equivalents) must be specified.


Pixel shader versions 1_1 1_2 1_3 1_4 2_0 2_x 2_sw 3_0 3_sw
log x x x x x


The following code snippet shows the operations performed.

float v = abs(src);
if (v != 0)
    dest.x = dest.y = dest.z = dest.w = 
    dest.x = dest.y = dest.z = dest.w = -FLT_MAX;

This instruction accepts a scalar source whose sign bit is ignored. The result is replicated to all four channels.

Pixel Shader Instructions