GOOD r300: Initial fragment program FRAG PROPERTY FS_COLOR0_WRITES_ALL_CBUFS 1 DCL IN[0], FOG, PERSPECTIVE DCL IN[1], GENERIC[0], PERSPECTIVE DCL OUT[0], COLOR DCL CONST[0..1] DCL TEMP[0..1] 0: MOV_SAT TEMP[0], IN[1] 1: MAD_SAT TEMP[1].x, IN[0].xxxx, CONST[0].xxxx, CONST[0].yyyy 2: LRP OUT[0].xyz, TEMP[1].xxxx, TEMP[0], CONST[1] 3: MOV OUT[0].w, TEMP[0] 4: END Fragment Program: before compilation # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: LRP output[0].xyz, temp[1].xxxx, temp[0], const[1]; 3: MOV output[0].w, temp[0]; Fragment Program: after 'rewrite depth out' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: LRP output[0].xyz, temp[1].xxxx, temp[0], const[1]; 3: MOV output[0].w, temp[0]; Fragment Program: after 'transform KILP' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: LRP output[0].xyz, temp[1].xxxx, temp[0], const[1]; 3: MOV output[0].w, temp[0]; Fragment Program: after 'unroll loops' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: LRP output[0].xyz, temp[1].xxxx, temp[0], const[1]; 3: MOV output[0].w, temp[0]; Fragment Program: after 'saturate output writes' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: LRP_SAT output[0].xyz, temp[1].xxxx, temp[0], const[1]; 3: MOV_SAT output[0].w, temp[0]; Fragment Program: after 'transform TEX' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: LRP_SAT output[0].xyz, temp[1].xxxx, temp[0], const[1]; 3: MOV_SAT output[0].w, temp[0]; Fragment Program: after 'native rewrite' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].xxxx, const[0].xxxx, const[0].yyyy; 2: ADD temp[2].xyz, temp[0], -const[1]; 3: MAD_SAT output[0].xyz, temp[1].xxxx, temp[2], const[1]; 4: MOV_SAT output[0].w, temp[0]; Fragment Program: after 'deadcode' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].x___, const[0].x___, const[0].y___; 2: ADD temp[2].xyz, temp[0].xyz_, -const[1].xyz_; 3: MAD_SAT output[0].xyz, temp[1].xxx_, temp[2].xyz_, const[1].xyz_; 4: MOV_SAT output[0].w, temp[0].___w; Fragment Program: after 'dataflow optimize' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].x___, const[0].x___, const[0].y___; 2: ADD temp[2].xyz, temp[0].xyz_, -const[1].xyz_; 3: MAD_SAT output[0].xyz, temp[1].xxx_, (temp[0] - const[1]).xyz_, const[1].xyz_; 4: MOV_SAT output[0].w, temp[0].___w; Fragment Program: after 'dataflow swizzles' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].x___, const[0].x___, const[0].y___; 2: ADD temp[2].xyz, temp[0].xyz_, -const[1].xyz_; 3: MAD_SAT output[0].xyz, temp[1].xxx_, (temp[0] - const[1]).xyz_, const[1].xyz_; 4: MOV_SAT output[0].w, temp[0].___w; Fragment Program: after 'dead constants' # Radeon Compiler Program 0: MOV_SAT temp[0], input[1]; 1: MAD_SAT temp[1].x, input[0].x___, const[0].x___, const[0].y___; 2: ADD temp[2].xyz, temp[0].xyz_, -const[1].xyz_; 3: MAD_SAT output[0].xyz, temp[1].xxx_, (temp[0] - const[1]).xyz_, const[1].xyz_; 4: MOV_SAT output[0].w, temp[0].___w; Fragment Program: after 'pair translate' # Radeon Compiler Program 0: src0.xyz = input[1], src0.w = input[1] MAD_SAT temp[0].xyz, src0.xyz, src0.111, src0.000 MAD_SAT temp[0].w, src0.w, src0.1, src0.0 1: src0.xyz = input[0], src1.xyz = const[0] MAD_SAT temp[1].x, src0.x__, src1.x__, src1.y__ 2: src0.xyz = temp[0], src1.xyz = const[1] MAD temp[2].xyz, src0.xyz, src0.111, -src1.xyz 3: src0.xyz = const[1], src1.xyz = temp[0], src2.xyz = temp[1], srcp.xyz = (src1 - src0) MAD_SAT color[0].xyz, src2.xxx, srcp.xyz, src0.xyz 4: src0.w = temp[0] MAD_SAT color[0].w, src0.w, src0.1, src0.0 Fragment Program: after 'pair scheduling' # Radeon Compiler Program 0: src0.xyz = input[1], src0.w = input[1] MAD_SAT temp[0].xyz, src0.xyz, src0.111, src0.000 MAD_SAT temp[0].w, src0.w, src0.1, src0.0 1: src0.xyz = temp[0], src0.w = temp[0], src1.xyz = const[1] MAD temp[2].xyz, src0.xyz, src0.111, -src1.xyz MAD_SAT color[0].w, src0.w, src0.1, src0.0 2: src0.xyz = input[0], src1.xyz = const[0] MAD_SAT temp[1].x, src0.x__, src1.x__, src1.y__ 3: src0.xyz = const[1], src1.xyz = temp[0], src2.xyz = temp[1], srcp.xyz = (src1 - src0) MAD_SAT color[0].xyz, src2.xxx, srcp.xyz, src0.xyz Fragment Program: after 'register allocation' # Radeon Compiler Program 0: src0.xyz = temp[0], src0.w = temp[0] MAD_SAT temp[0].xyz, src0.xyz, src0.111, src0.000 MAD_SAT temp[0].w, src0.w, src0.1, src0.0 1: src0.xyz = temp[0], src0.w = temp[0], src1.xyz = const[1] MAD temp[2].xyz, src0.xyz, src0.111, -src1.xyz MAD_SAT color[0].w, src0.w, src0.1, src0.0 2: src0.xyz = temp[1], src1.xyz = const[0] MAD_SAT temp[1].x, src0.x__, src1.x__, src1.y__ 3: src0.xyz = const[1], src1.xyz = temp[0], src2.xyz = temp[1], srcp.xyz = (src1 - src0) MAD_SAT color[0].xyz, src2.xxx, srcp.xyz, src0.xyz R500 Fragment Program: -------- 0 0:CMN_INST 0x00187804:ALU TEX_WAIT wmask: ARGB omask: NONE 1:RGB_ADDR 0x08020000:Addr0: 0t, Addr1: 128t, Addr2: 128t, srcp:0 2:ALPHA_ADDR 0x08020000:Addr0: 0t, Addr1: 128t, Addr2: 128t, srcp:0 3 RGB_INST: 0x00db0220:rgb_A_src:0 R/G/B 0 rgb_B_src:0 1/1/1 0 targ: 0 4 ALPHA_INST:0x00c0c000:MAD dest:0 alp_A_src:0 A 0 alp_B_src:0 1 0 targ 0 w:0 5 RGBA_INST: 0x20490000:MAD dest:0 rgb_C_src:0 0/0/0 0 alp_C_src:0 0 0 1 0:CMN_INST 0x00143805:OUT TEX_WAIT wmask: RGB omask: A 1:RGB_ADDR 0x08040400:Addr0: 0t, Addr1: 1c, Addr2: 128t, srcp:0 2:ALPHA_ADDR 0x08020000:Addr0: 0t, Addr1: 128t, Addr2: 128t, srcp:0 3 RGB_INST: 0x00db0220:rgb_A_src:0 R/G/B 0 rgb_B_src:0 1/1/1 0 targ: 0 4 ALPHA_INST:0x00c0c000:MAD dest:0 alp_A_src:0 A 0 alp_B_src:0 1 0 targ 0 w:0 5 RGBA_INST: 0x20a21020:MAD dest:2 rgb_C_src:1 R/G/B 1 alp_C_src:0 0 0 2 0:CMN_INST 0x00080804:ALU TEX_WAIT wmask: R omask: NONE 1:RGB_ADDR 0x08040001:Addr0: 1t, Addr1: 0c, Addr2: 128t, srcp:0 2:ALPHA_ADDR 0x08020080:Addr0: 128t, Addr1: 128t, Addr2: 128t, srcp:0 3 RGB_INST: 0x00902480:rgb_A_src:0 R/0/0 0 rgb_B_src:1 R/0/0 0 targ: 0 4 ALPHA_INST:0x00000000:MAD dest:0 alp_A_src:0 R 0 alp_B_src:0 R 0 targ 0 w:0 5 RGBA_INST: 0x00485010:MAD dest:1 rgb_C_src:1 G/0/0 0 alp_C_src:0 R 0 3 0:CMN_INST 0x000b8005:OUT TEX_WAIT wmask: NONE omask: RGB 1:RGB_ADDR 0x40100101:Addr0: 1c, Addr1: 0t, Addr2: 1t, srcp:1 2:ALPHA_ADDR 0x08020080:Addr0: 128t, Addr1: 128t, Addr2: 128t, srcp:0 3 RGB_INST: 0x00446002:rgb_A_src:2 R/R/R 0 rgb_B_src:3 R/G/B 0 targ: 0 4 ALPHA_INST:0x00000000:MAD dest:0 alp_A_src:0 R 0 alp_B_src:0 R 0 targ 0 w:0 5 RGBA_INST: 0x00220000:MAD dest:0 rgb_C_src:0 R/G/B 0 alp_C_src:0 R 0