Guest User

The Witcher 3 - portal pixel shader (assembly)

a guest
May 16th, 2020
47
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ps_5_0
  2. dcl_globalFlags refactoringAllowed
  3. dcl_constantbuffer cb0[3], immediateIndexed
  4. dcl_constantbuffer cb2[3], immediateIndexed
  5. dcl_constantbuffer cb12[228], immediateIndexed
  6. dcl_constantbuffer cb4[14], immediateIndexed
  7. dcl_sampler s0, mode_default
  8. dcl_sampler s6, mode_default
  9. dcl_sampler s15, mode_default
  10. dcl_resource_texture2d (float,float,float,float) t0
  11. dcl_resource_texture2d (float,float,float,float) t1
  12. dcl_resource_texture2d (float,float,float,float) t6
  13. dcl_resource_texture2d (float,float,float,float) t15
  14. dcl_input_ps linear v0.xyz
  15. dcl_input_ps linear v1.xyz
  16. dcl_input_ps linear v2.xyz
  17. dcl_input_ps linear v3.xyz
  18. dcl_input_ps_siv v4.xy, position
  19. dcl_output o0.xyzw
  20. dcl_temps 6
  21. 0: mul r0.xy, v4.xyxx, cb0[1].zwzz
  22. 1: sample_l(texture2d)(float,float,float,float) r0.z, r0.xyxx, t15.yzxw, s15, l(0)
  23. 2: mad r0.z, r0.z, cb12[22].x, cb12[22].y
  24. 3: mad r0.z, r0.z, cb12[21].x, cb12[21].y
  25. 4: max r0.z, r0.z, l(0.000100)
  26. 5: div r0.z, l(1.000000, 1.000000, 1.000000, 1.000000), r0.z
  27. 6: add r0.z, r0.z, -v0.z
  28. 7: mul_sat r0.z, r0.z, cb4[0].x
  29. 8: add r0.w, r0.z, r0.z
  30. 9: mad r0.z, r0.z, l(2.000000), l(-1.000000)
  31. 10: max r0.z, r0.z, l(0)
  32. 11: dp3 r1.x, v3.xyzx, v3.xyzx
  33. 12: rsq r1.x, r1.x
  34. 13: mul r1.xyz, r1.xxxx, v3.xyzx
  35. 14: mul r1.yw, r1.yyyy, cb12[2].xxxy
  36. 15: mad r1.xy, cb12[1].xyxx, r1.xxxx, r1.ywyy
  37. 16: mad r1.xy, cb12[3].xyxx, r1.zzzz, r1.xyxx
  38. 17: mul r1.xy, r1.xyxx, l(-1.000000, 1.000000, 0.000000, 0.000000)
  39. 18: div r1.z, cb4[1].x, v0.z
  40. 19: mul r1.xy, r1.zzzz, r1.xyxx
  41. 20: mul r1.xy, r1.xyxx, v1.xxxx
  42. 21: add r1.z, v0.y, l(-0.200000)
  43. 22: log r1.z, r1.z
  44. 23: mul r1.z, r1.z, cb4[4].x
  45. 24: exp r1.z, r1.z
  46. 25: round_ni r1.w, cb4[2].x
  47. 26: mad r2.y, cb4[3].x, cb0[0].x, r1.z
  48. 27: mov r2.x, v0.x
  49. 28: mul r2.xy, r1.wwww, r2.xyxx
  50. 29: sample_indexable(texture2d)(float,float,float,float) r1.w, r2.xyxx, t0.yzwx, s0
  51. 30: log r2.x, r1.w
  52. 31: mul r2.x, r2.x, l(0.200000)
  53. 32: exp r2.x, r2.x
  54. 33: mul r1.xy, r1.xyxx, r2.xxxx
  55. 34: mul r1.xy, r0.zzzz, r1.xyxx
  56. 35: add r2.xyz, v2.xyzx, -cb12[0].xyzx
  57. 36: dp3 r0.z, r2.xyzx, r2.xyzx
  58. 37: sqrt r0.z, r0.z
  59. 38: div r2.xyz, r2.xyzx, r0.zzzz
  60. 39: add r0.z, r0.z, -cb12[22].z
  61. 40: max r0.z, r0.z, l(0)
  62. 41: min r0.z, r0.z, cb12[42].z
  63. 42: dp3 r2.x, cb12[38].xyzx, r2.xyzx
  64. 43: mul r2.y, abs(r2.x), abs(r2.x)
  65. 44: mad_sat r2.w, r0.z, l(0.002000), l(-0.300000)
  66. 45: mul r2.y, r2.w, r2.y
  67. 46: lt r2.w, l(0), r2.x
  68. 47: movc r3.xyz, r2.wwww, cb12[39].xyzx, cb12[41].xyzx
  69. 48: add r3.xyz, r3.xyzx, -cb12[40].xyzx
  70. 49: mad r3.xyz, r2.yyyy, r3.xyzx, cb12[40].xyzx
  71. 50: ge r2.y, r0.z, cb12[48].y
  72. 51: if_nz r2.y
  73. 52: mad r2.y, r2.z, cb12[22].z, cb12[0].z
  74. 53: mul r2.z, r0.z, r2.z
  75. 54: mul r2.w, r0.z, cb12[43].x
  76. 55: mul r2.zw, r2.zzzw, l(0.000000, 0.000000, 0.062500, 0.062500)
  77. 56: add r2.x, r2.x, cb12[42].x
  78. 57: add r3.w, cb12[42].x, l(1.000000)
  79. 58: div_sat r2.x, r2.x, r3.w
  80. 59: add r3.w, -cb12[43].z, cb12[43].y
  81. 60: mad r2.x, r2.x, r3.w, cb12[43].z
  82. 61: add r2.y, r2.y, cb12[42].y
  83. 62: mul r3.w, r2.x, r2.y
  84. 63: mul r2.z, r2.x, r2.z
  85. 64: mad r4.xyzw, r2.zzzz, l(16.000000, 15.000000, 14.000000, 13.000000), r3.wwww
  86. 65: max r4.xyzw, r4.xyzw, l(0, 0, 0, 0)
  87. 66: add r4.xyzw, r4.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  88. 67: div_sat r4.xyzw, r2.wwww, r4.xyzw
  89. 68: add r4.xyzw, -r4.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  90. 69: mul r4.x, r4.y, r4.x
  91. 70: mul r4.x, r4.z, r4.x
  92. 71: mul r4.x, r4.w, r4.x
  93. 72: mad r5.xyzw, r2.zzzz, l(12.000000, 11.000000, 10.000000, 9.000000), r3.wwww
  94. 73: max r5.xyzw, r5.xyzw, l(0, 0, 0, 0)
  95. 74: add r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  96. 75: div_sat r5.xyzw, r2.wwww, r5.xyzw
  97. 76: add r5.xyzw, -r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  98. 77: mul r4.x, r4.x, r5.x
  99. 78: mul r4.x, r5.y, r4.x
  100. 79: mul r4.x, r5.z, r4.x
  101. 80: mul r4.x, r5.w, r4.x
  102. 81: mad r5.xyzw, r2.zzzz, l(8.000000, 7.000000, 6.000000, 5.000000), r3.wwww
  103. 82: max r5.xyzw, r5.xyzw, l(0, 0, 0, 0)
  104. 83: add r5.xyzw, r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  105. 84: div_sat r5.xyzw, r2.wwww, r5.xyzw
  106. 85: add r5.xyzw, -r5.xyzw, l(1.000000, 1.000000, 1.000000, 1.000000)
  107. 86: mul r4.x, r4.x, r5.x
  108. 87: mul r4.x, r5.y, r4.x
  109. 88: mul r4.x, r5.z, r4.x
  110. 89: mul r4.x, r5.w, r4.x
  111. 90: mad r4.yz, r2.zzzz, l(0.000000, 4.000000, 3.000000, 0.000000), r3.wwww
  112. 91: max r4.yz, r4.yyzy, l(0, 0, 0, 0)
  113. 92: add r4.yz, r4.yyzy, l(0.000000, 1.000000, 1.000000, 0.000000)
  114. 93: div_sat r4.yz, r2.wwww, r4.yyzy
  115. 94: add r4.yz, -r4.yyzy, l(0.000000, 1.000000, 1.000000, 0.000000)
  116. 95: mul r4.x, r4.y, r4.x
  117. 96: mul r4.x, r4.z, r4.x
  118. 97: mad r3.w, r2.z, l(2.000000), r3.w
  119. 98: max r3.w, r3.w, l(0)
  120. 99: add r3.w, r3.w, l(1.000000)
  121. 100: div_sat r3.w, r2.w, r3.w
  122. 101: add r3.w, -r3.w, l(1.000000)
  123. 102: mul r3.w, r3.w, r4.x
  124. 103: mad r2.x, r2.y, r2.x, r2.z
  125. 104: max r2.x, r2.x, l(0)
  126. 105: add r2.x, r2.x, l(1.000000)
  127. 106: div_sat r2.x, r2.w, r2.x
  128. 107: add r2.x, -r2.x, l(1.000000)
  129. 108: mad r2.x, -r3.w, r2.x, l(1.000000)
  130. 109: add r0.z, r0.z, -cb12[48].y
  131. 110: mul_sat r0.z, r0.z, cb12[48].z
  132. 111: else
  133. 112: mov r2.x, l(1.000000)
  134. 113: mov r0.z, l(0)
  135. 114: endif
  136. 115: log r2.x, r2.x
  137. 116: mul r2.x, r2.x, cb12[42].w
  138. 117: exp r2.x, r2.x
  139. 118: mul r0.z, r0.z, r2.x
  140. 119: mad_sat r2.xy, r0.zzzz, cb12[189].xzxx, cb12[189].ywyy
  141. 120: add r4.xyz, -r3.xyzx, cb12[188].xyzx
  142. 121: mad r4.xyz, r2.xxxx, r4.xyzx, r3.xyzx
  143. 122: add r2.x, cb12[188].w, l(-1.000000)
  144. 123: mad r2.x, r2.y, r2.x, l(1.000000)
  145. 124: mul_sat r4.w, r0.z, r2.x
  146. 125: lt r2.x, l(0), cb12[192].x
  147. 126: if_nz r2.x
  148. 127: mad_sat r2.xy, r0.zzzz, cb12[191].xzxx, cb12[191].ywyy
  149. 128: add r5.xyz, -r3.xyzx, cb12[190].xyzx
  150. 129: mad r3.xyz, r2.xxxx, r5.xyzx, r3.xyzx
  151. 130: add r2.x, cb12[190].w, l(-1.000000)
  152. 131: mad r2.x, r2.y, r2.x, l(1.000000)
  153. 132: mul_sat r3.w, r0.z, r2.x
  154. 133: add r2.xyzw, -r4.xyzw, r3.xyzw
  155. 134: mad r4.xyzw, cb12[192].xxxx, r2.xyzw, r4.xyzw
  156. 135: endif
  157. 136: min r0.z, r0.w, l(1.000000)
  158. 137: dp2 r0.w, v1.zzzz, r0.zzzz
  159. 138: mul r2.xy, cb0[0].xxxx, l(0.000000, 0.200000, 0.000000, 0.000000)
  160. 139: mad r2.xy, v0.xyxx, l(4.000000, 1.000000, 0.000000, 0.000000), r2.xyxx
  161. 140: sample_indexable(texture2d)(float,float,float,float) r2.x, r2.xyxx, t1.xyzw, s0
  162. 141: add r0.w, r0.w, r2.x
  163. 142: add_sat r0.w, r0.w, l(-1.000000)
  164. 143: mul r0.w, r0.w, r0.w
  165. 144: mad r2.x, -cb0[0].x, cb4[6].x, v0.x
  166. 145: mad r2.y, cb0[0].x, cb4[6].x, r1.z
  167. 146: round_ni r1.z, cb4[7].x
  168. 147: mul r2.xy, r1.zzzz, r2.xyxx
  169. 148: sample_indexable(texture2d)(float,float,float,float) r1.z, r2.xyxx, t0.yzxw, s0
  170. 149: mad r1.z, r1.w, r1.z, v1.y
  171. 150: add_sat r1.z, r1.z, l(-1.000000)
  172. 151: log r1.z, r1.z
  173. 152: mul r1.z, r1.z, cb4[8].x
  174. 153: exp r1.z, r1.z
  175. 154: mul r1.z, r1.z, cb4[9].x
  176. 155: log r2.xyz, cb4[5].xyzx
  177. 156: mul r2.xyz, r2.xyzx, l(2.200000, 2.200000, 2.200000, 0.000000)
  178. 157: exp r2.xyz, r2.xyzx
  179. 158: add r2.w, -v1.z, l(1.000000)
  180. 159: mul r2.w, r2.w, v1.y
  181. 160: mul r1.w, r1.w, r1.w
  182. 161: add r3.x, l(1.000000), -cb4[10].x
  183. 162: add r3.y, -r3.x, l(1.000000)
  184. 163: mad r1.w, r1.w, r3.y, r3.x
  185. 164: mul r1.w, r1.w, r2.w
  186. 165: mul r1.w, r1.w, cb4[11].x
  187. 166: log r3.xyz, cb4[12].xyzx
  188. 167: mul r3.xyz, r3.xyzx, l(2.200000, 2.200000, 2.200000, 0.000000)
  189. 168: exp r3.xyz, r3.xyzx
  190. 169: mul r3.xyz, r1.wwww, r3.xyzx
  191. 170: mad r2.xyz, r2.xyzx, r1.zzzz, r3.xyzx
  192. 171: mul r2.xyz, r0.zzzz, r2.xyzx
  193. 172: mul r2.xyz, r2.xyzx, cb12[227].xyzx
  194. 173: add r0.z, -cb2[0].x, l(1.000000)
  195. 174: mad_sat r0.z, cb4[13].x, r0.z, cb2[0].x
  196. 175: mad r0.xy, cb0[2].zwzz, r1.xyxx, r0.xyxx
  197. 176: mad r1.xy, -cb0[1].zwzz, l(0.500000, 0.500000, 0.000000, 0.000000), cb0[2].zwzz
  198. 177: min r0.xy, r0.xyxx, r1.xyxx
  199. 178: sample_l(texture2d)(float,float,float,float) r1.xyz, r0.xyxx, t6.xyzw, s6, l(0)
  200. 179: mad r3.xyz, r4.wwww, r4.xyzx, -r1.xyzx
  201. 180: mad r0.xyw, r0.wwww, r3.xyxz, r1.xyxz
  202. 181: mad r0.xyw, r2.xyxz, cb2[0].xxxx, r0.xyxw
  203. 182: mul r0.xyw, r0.xyxw, cb2[2].xyxz
  204. 183: mul r0.z, r0.z, cb2[2].w
  205. 184: mul o0.xyz, r0.zzzz, r0.xywx
  206. 185: mov o0.w, r0.z
  207. 186: ret
RAW Paste Data