Changeset 472 for GraphicTest/Packages/bgrabitmap/perspectivescan2.inc
- Timestamp:
- Apr 9, 2015, 9:58:36 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/Packages/bgrabitmap/perspectivescan2.inc
r452 r472 1 {$asmmode intel} 1 {$i bgrasse.inc} 2 3 {$ifdef BGRASSE_AVAILABLE}{$asmmode intel}{$endif} 2 4 {$IFDEF PARAM_USESSE} 3 5 asm 4 6 {$IFDEF PARAM_USESHADER} 5 mov eax, ShaderContext 6 movaps xmm2, [eax+32] //positionInvZ 7 movaps xmm3, [eax+48] //normalInvZ 7 {$IFDEF cpux86_64} 8 mov rax, ShaderContext 9 movaps xmm2, [rax+32] //positionInvZ 10 movaps xmm3, [rax+48] //normalInvZ 11 {$ELSE} 12 mov eax, ShaderContext 13 movaps xmm2, [eax+32] //positionInvZ 14 movaps xmm3, [eax+48] //normalInvZ 15 {$ENDIF} 8 16 {$ENDIF} 9 17 {$IFNDEF PARAM_USESOLIDCOLOR} … … 27 35 28 36 {$IFDEF PARAM_USESHADER} 37 {$ifdef cpux86_64} 38 mov rax, ShaderContext 39 {$else} 29 40 mov eax, ShaderContext 41 {$endif} 30 42 31 43 mulps xmm2, xmm4 //positionInvZ*zPos (A) 32 33 44 mulps xmm3, xmm4 //normalInvZ*zPos 34 45 {$ifdef cpux86_64} 46 movaps [rax+0], xmm2 //(A) Position 47 {$else} 35 48 movaps [eax+0], xmm2 //(A) Position 49 {$endif} 36 50 37 51 //normalize … … 53 67 {$ENDIF} 54 68 69 xorps xmm7,xmm7 70 comiss xmm3,xmm7 71 jna @skipnormal 72 55 73 rsqrtps xmm3,xmm3 56 57 74 mulps xmm3, xmm1 //apply 58 75 @skipnormal: 76 77 {$ifdef cpux86_64} 78 movaps [rax+16], xmm3 //Normal 79 {$else} 59 80 movaps [eax+16], xmm3 //Normal 81 {$endif} 60 82 {$ENDIF} 61 83 … … 142 164 {$IFDEF PARAM_USESHADER} 143 165 {$IFDEF PARAM_USESSE} 166 {$ifdef cpux86_64} 144 167 asm 145 mov eax, ShaderContext146 movaps xmm2, [ eax+32] //PositionInvZ147 movaps xmm1, [ eax+64] //PositionStepInvZ148 movaps xmm3, [ eax+48] //NormalInvZ149 movaps xmm0, [ eax+80] //NormalStepInvZ168 mov rax, ShaderContext 169 movaps xmm2, [rax+32] //PositionInvZ 170 movaps xmm1, [rax+64] //PositionStepInvZ 171 movaps xmm3, [rax+48] //NormalInvZ 172 movaps xmm0, [rax+80] //NormalStepInvZ 150 173 addps xmm2, xmm1 151 174 addps xmm3, xmm0 152 movaps [ eax+32], xmm2153 movaps [ eax+48], xmm3175 movaps [rax+32], xmm2 176 movaps [rax+48], xmm3 154 177 end; 155 {asm 156 mov eax, ShaderContext 157 movaps xmm2, [eax+32] //PositionInvZ 158 movaps xmm1, [eax+64] //PositionStepInvZ 159 addps xmm2, xmm1 160 movaps [eax+32], xmm2 161 162 movaps xmm3, [eax+48] //NormalInvZ 163 movaps xmm1, [eax+80] //NormalStepInvZ 164 addps xmm3, xmm1 165 movaps [eax+48], xmm3 166 end;} 178 {$else} 179 asm 180 mov eax, ShaderContext 181 movaps xmm2, [eax+32] //PositionInvZ 182 movaps xmm1, [eax+64] //PositionStepInvZ 183 movaps xmm3, [eax+48] //NormalInvZ 184 movaps xmm0, [eax+80] //NormalStepInvZ 185 addps xmm2, xmm1 186 addps xmm3, xmm0 187 movaps [eax+32], xmm2 188 movaps [eax+48], xmm3 189 end; 190 {$endif} 167 191 {$ELSE} 168 192 with ShaderContext^ do
Note:
See TracChangeset
for help on using the changeset viewer.