fPostProcessingD.dfm 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808
  1. object FormPP: TFormPP
  2. Left = 0
  3. Top = 0
  4. BorderStyle = bsDialog
  5. Caption = 'GLScene CUDA Post Processing'
  6. ClientHeight = 403
  7. ClientWidth = 644
  8. Color = clBtnFace
  9. Font.Charset = DEFAULT_CHARSET
  10. Font.Color = clWindowText
  11. Font.Height = -14
  12. Font.Name = 'Tahoma'
  13. Font.Style = []
  14. Position = poScreenCenter
  15. OnCreate = FormCreate
  16. OnResize = FormResize
  17. PixelsPerInch = 120
  18. TextHeight = 17
  19. object GLSceneViewer1: TGLSceneViewer
  20. Left = 0
  21. Top = 0
  22. Width = 644
  23. Height = 361
  24. Margins.Left = 5
  25. Margins.Top = 5
  26. Margins.Right = 5
  27. Margins.Bottom = 5
  28. Camera = GLCamera1
  29. Buffer.AntiAliasing = aaNone
  30. FieldOfView = 149.033645629882800000
  31. PenAsTouch = False
  32. Align = alClient
  33. TabOrder = 0
  34. end
  35. object TrackBar1: TTrackBar
  36. Left = 0
  37. Top = 361
  38. Width = 644
  39. Height = 42
  40. Margins.Left = 5
  41. Margins.Top = 5
  42. Margins.Right = 5
  43. Margins.Bottom = 5
  44. Align = alBottom
  45. Max = 16
  46. Min = 1
  47. Position = 8
  48. ShowSelRange = False
  49. TabOrder = 1
  50. ThumbLength = 31
  51. OnChange = TrackBar1Change
  52. end
  53. object GLScene1: TGLScene
  54. Left = 32
  55. Top = 24
  56. object GLCamera1: TGLCamera
  57. DepthOfView = 100.000000000000000000
  58. FocalLength = 50.000000000000000000
  59. TargetObject = GLTeapot1
  60. Position.Coordinates = {0000803F0000803F000000400000803F}
  61. object GLLightSource1: TGLLightSource
  62. ConstAttenuation = 1.000000000000000000
  63. Specular.Color = {0000803F0000803F0000803F0000803F}
  64. SpotCutOff = 180.000000000000000000
  65. end
  66. end
  67. object RenderToTexture: TGLFBORenderer
  68. ForceTextureDimensions = False
  69. Width = 512
  70. Height = 512
  71. ColorTextureName = 'processedTexture'
  72. MaterialLibrary = GLMaterialLibrary1
  73. BackgroundColor.Color = {00000000000000000000000000000000}
  74. ClearOptions = [coColorBufferClear, coDepthBufferClear]
  75. RootObject = RenderRoot
  76. TargetVisibility = tvFBOOnly
  77. EnabledRenderBuffers = [erbDepth]
  78. BeforeRender = RenderToTextureBeforeRender
  79. AfterRender = RenderToTextureAfterRender
  80. PostGenerateMipmap = False
  81. end
  82. object RenderRoot: TGLDummyCube
  83. CubeSize = 1.000000000000000000
  84. object GLSphere1: TGLSphere
  85. Material.FrontProperties.Diffuse.Color = {9A99593F9A99593FCDCCCC3D0000803F}
  86. NormalDirection = ndInside
  87. Radius = 20.000000000000000000
  88. Slices = 128
  89. Stacks = 128
  90. end
  91. object GLTeapot1: TGLTeapot
  92. Material.FrontProperties.Diffuse.Color = {0000803F00000000000000000000803F}
  93. Material.FrontProperties.Shininess = 16
  94. Material.FrontProperties.Specular.Color = {3333733F3333733F3333733F0000803F}
  95. Material.DepthProperties.DepthClamp = True
  96. end
  97. object GLCylinder1: TGLCylinder
  98. Material.FrontProperties.Diffuse.Color = {9A99193FCDCC4C3FACC8483E0000803F}
  99. Material.FrontProperties.Shininess = 64
  100. Material.FrontProperties.Specular.Color = {3333333F3333333F3333333F0000803F}
  101. Material.DepthProperties.DepthClamp = True
  102. Position.Coordinates = {0000003F00000000000040BF0000803F}
  103. BottomRadius = 0.250000000000000000
  104. Height = 1.000000000000000000
  105. Slices = 32
  106. Loops = 10
  107. TopRadius = 0.250000000000000000
  108. end
  109. object GLCapsule1: TGLCapsule
  110. Material.FrontProperties.Diffuse.Color = {EBE0E03E9A93133FE4DB5B3F0000803F}
  111. Material.FrontProperties.Shininess = 16
  112. Material.FrontProperties.Specular.Color = {938C0C3E938C0C3E938E0E3F0000803F}
  113. Material.DepthProperties.DepthClamp = True
  114. Direction.Coordinates = {00000000010000330000803F00000000}
  115. Position.Coordinates = {000080BF00000000000000000000803F}
  116. Up.Coordinates = {000000000000803F010000B300000000}
  117. Height = 0.750000000000000000
  118. Slices = 16
  119. Stacks = 4
  120. Radius = 0.250000000000000000
  121. end
  122. end
  123. object CallPostProcess: TGLDirectOpenGL
  124. UseBuildList = False
  125. OnRender = CallPostProcessRender
  126. Blend = False
  127. end
  128. object GLHUDSprite1: TGLHUDSprite
  129. Material.MaterialLibrary = GLMaterialLibrary1
  130. Material.LibMaterialName = 'processedTexture'
  131. Visible = False
  132. Width = 1.000000000000000000
  133. Height = 1.000000000000000000
  134. Rotation = 0.000000000000000000
  135. end
  136. end
  137. object GLCadencer1: TGLCadencer
  138. Scene = GLScene1
  139. OnProgress = GLCadencer1Progress
  140. Left = 152
  141. Top = 24
  142. end
  143. object GLSimpleNavigation1: TGLSimpleNavigation
  144. Form = Owner
  145. GLSceneViewer = GLSceneViewer1
  146. FormCaption = 'GLScene CUDA Post Processing - %FPS'
  147. KeyCombinations = <
  148. item
  149. ShiftState = [ssLeft, ssRight]
  150. Action = snaZoom
  151. end
  152. item
  153. ShiftState = [ssLeft]
  154. Action = snaMoveAroundTarget
  155. end
  156. item
  157. ShiftState = [ssRight]
  158. Action = snaMoveAroundTarget
  159. end>
  160. Left = 32
  161. Top = 112
  162. end
  163. object GLMaterialLibrary1: TGLMaterialLibrary
  164. Materials = <
  165. item
  166. Name = 'processedTexture'
  167. Tag = 0
  168. Material.DepthProperties.DepthTest = False
  169. Material.DepthProperties.DepthWrite = False
  170. Material.MaterialOptions = [moNoLighting]
  171. Material.Texture.ImageClassName = 'TGLBlankImage'
  172. Material.Texture.Image.Width = 512
  173. Material.Texture.Image.Height = 512
  174. Material.Texture.Image.ColorFormat = 6408
  175. Material.Texture.MagFilter = maNearest
  176. Material.Texture.MinFilter = miNearest
  177. Material.Texture.TextureMode = tmReplace
  178. Material.Texture.TextureFormat = tfExtended
  179. Material.Texture.TextureFormatEx = tfRGBA8UI
  180. Shader = ResultShader
  181. end>
  182. Left = 272
  183. Top = 24
  184. end
  185. object GLCUDADevice1: TGLCUDADevice
  186. SelectDevice = 'GeForce GTX 1050 Ti (1)'
  187. Left = 512
  188. Top = 96
  189. end
  190. object GLCUDA1: TGLCUDA
  191. ComputingDevice = GLCUDADevice1
  192. OnOpenGLInteropInit = GLCUDA1OpenGLInteropInit
  193. Left = 512
  194. Top = 16
  195. object MainModule: TCUDAModule
  196. Code.Strings = (
  197. #9'.version 1.4'
  198. #9'.target sm_13'
  199. #9'// compiled with C:\Program Files\NVIDIA GPU Computing Toolkit\' +
  200. 'CUDA\v3.2\\bin/../open64/lib//be.exe'
  201. #9'// nvopencc 3.2 built on 2010-11-06'
  202. ''
  203. #9'//-----------------------------------------------------------'
  204. #9'// Compiling C:/Users/YARUNA~1/AppData/Local/Temp/tmpxft_000009' +
  205. '94_00000000-11_temp.cpp3.i (C:/Users/YARUNA~1/AppData/Local/Temp' +
  206. '/ccBI#.a00744)'
  207. #9'//-----------------------------------------------------------'
  208. ''
  209. #9'//-----------------------------------------------------------'
  210. #9'// Options:'
  211. #9'//-----------------------------------------------------------'
  212. #9'// Target:ptx, ISA:sm_13, Endian:little, Pointer Size:32'
  213. #9'// -O3'#9'(Optimization level)'
  214. #9'// -g0'#9'(Debug level)'
  215. #9'// -m2'#9'(Report advisories)'
  216. #9'//-----------------------------------------------------------'
  217. ''
  218. #9'.file'#9'1'#9'"C:/Users/YARUNA~1/AppData/Local/Temp/tmpxft_00000994_0' +
  219. '0000000-10_temp.cudafe2.gpu"'
  220. #9'.file'#9'2'#9'"C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUD' +
  221. 'E\crtdefs.h"'
  222. #9'.file'#9'3'#9'"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.' +
  223. '2\include\crt/device_runtime.h"'
  224. #9'.file'#9'4'#9'"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.' +
  225. '2\include\host_defines.h"'
  226. #9'.file'#9'5'#9'"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.' +
  227. '2\include\builtin_types.h"'
  228. #9'.file'#9'6'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3.' +
  229. '2\include\device_types.h"'
  230. #9'.file'#9'7'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3.' +
  231. '2\include\driver_types.h"'
  232. #9'.file'#9'8'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3.' +
  233. '2\include\surface_types.h"'
  234. #9'.file'#9'9'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3.' +
  235. '2\include\texture_types.h"'
  236. #9'.file'#9'10'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  237. '.2\include\vector_types.h"'
  238. #9'.file'#9'11'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  239. '.2\include\builtin_types.h"'
  240. #9'.file'#9'12'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  241. '.2\include\host_defines.h"'
  242. #9'.file'#9'13'#9'"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3' +
  243. '.2\include\device_launch_parameters.h"'
  244. #9'.file'#9'14'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  245. '.2\include\crt\storage_class.h"'
  246. #9'.file'#9'15'#9'"C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLU' +
  247. 'DE\time.h"'
  248. #9'.file'#9'16'#9'"C:/Users/YARUNA~1/AppData/Local/Temp/temp.cu"'
  249. #9'.file'#9'17'#9'"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3' +
  250. '.2\include\common_functions.h"'
  251. #9'.file'#9'18'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  252. '.2\include\math_functions.h"'
  253. #9'.file'#9'19'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  254. '.2\include\math_constants.h"'
  255. #9'.file'#9'20'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  256. '.2\include\device_functions.h"'
  257. #9'.file'#9'21'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  258. '.2\include\sm_11_atomic_functions.h"'
  259. #9'.file'#9'22'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  260. '.2\include\sm_12_atomic_functions.h"'
  261. #9'.file'#9'23'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  262. '.2\include\sm_13_double_functions.h"'
  263. #9'.file'#9'24'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  264. '.2\include\sm_20_atomic_functions.h"'
  265. #9'.file'#9'25'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  266. '.2\include\sm_20_intrinsics.h"'
  267. #9'.file'#9'26'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  268. '.2\include\surface_functions.h"'
  269. #9'.file'#9'27'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  270. '.2\include\texture_fetch_functions.h"'
  271. #9'.file'#9'28'#9'"c:\program files\nvidia gpu computing toolkit\cuda\v3' +
  272. '.2\include\math_functions_dbl_ptx3.h"'
  273. ''
  274. #9'.extern'#9'.shared .align 4 .b8 sdata[];'
  275. ''
  276. #9'.entry cudaProcess_k ('
  277. #9#9'.param .u32 __cudaparm_cudaProcess_k_g_data,'
  278. #9#9'.param .u32 __cudaparm_cudaProcess_k_g_odata,'
  279. #9#9'.param .s32 __cudaparm_cudaProcess_k_imgw,'
  280. #9#9'.param .s32 __cudaparm_cudaProcess_k_imgh,'
  281. #9#9'.param .s32 __cudaparm_cudaProcess_k_tilew,'
  282. #9#9'.param .s32 __cudaparm_cudaProcess_k_r,'
  283. #9#9'.param .f32 __cudaparm_cudaProcess_k_threshold,'
  284. #9#9'.param .f32 __cudaparm_cudaProcess_k_highlight)'
  285. #9'{'
  286. #9'.reg .u32 %r<205>;'
  287. #9'.reg .f32 %f<17>;'
  288. #9'.reg .f64 %fd<5>;'
  289. #9'.reg .pred %p<9>;'
  290. #9'.loc'#9'16'#9'62'#9'0'
  291. '$LDWbegin_cudaProcess_k:'
  292. #9'mov.u32 '#9'%r1, sdata;'
  293. #9'.loc'#9'16'#9'75'#9'0'
  294. #9'ld.param.s32 '#9'%r2, [__cudaparm_cudaProcess_k_imgw];'
  295. #9'sub.s32 '#9'%r3, %r2, 1;'
  296. #9'cvt.s32.u16 '#9'%r4, %ntid.x;'
  297. #9'cvt.u32.u16 '#9'%r5, %ctaid.x;'
  298. #9'mul.lo.u32 '#9'%r6, %r4, %r5;'
  299. #9'ld.param.s32 '#9'%r7, [__cudaparm_cudaProcess_k_imgh];'
  300. #9'sub.s32 '#9'%r8, %r7, 1;'
  301. #9'cvt.s32.u16 '#9'%r9, %ntid.y;'
  302. #9'cvt.u32.u16 '#9'%r10, %ctaid.y;'
  303. #9'mul.lo.u32 '#9'%r11, %r9, %r10;'
  304. #9'cvt.s32.u16 '#9'%r12, %tid.x;'
  305. #9'ld.param.s32 '#9'%r13, [__cudaparm_cudaProcess_k_r];'
  306. #9'add.s32 '#9'%r14, %r12, %r13;'
  307. #9'cvt.s32.u16 '#9'%r15, %tid.y;'
  308. #9'add.s32 '#9'%r16, %r15, %r13;'
  309. #9'add.u32 '#9'%r17, %r12, %r6;'
  310. #9'add.u32 '#9'%r18, %r15, %r11;'
  311. #9'ld.param.s32 '#9'%r19, [__cudaparm_cudaProcess_k_tilew];'
  312. #9'mul.lo.s32 '#9'%r20, %r16, %r19;'
  313. #9'min.s32 '#9'%r21, %r3, %r17;'
  314. #9'min.s32 '#9'%r22, %r8, %r18;'
  315. #9'mov.s32 '#9'%r23, 0;'
  316. #9'max.s32 '#9'%r24, %r21, %r23;'
  317. #9'mov.s32 '#9'%r25, 0;'
  318. #9'max.s32 '#9'%r26, %r22, %r25;'
  319. #9'mul.lo.s32 '#9'%r27, %r26, %r2;'
  320. #9'ld.param.u32 '#9'%r28, [__cudaparm_cudaProcess_k_g_data];'
  321. #9'add.s32 '#9'%r29, %r24, %r27;'
  322. #9'mul.lo.u32 '#9'%r30, %r29, 4;'
  323. #9'add.u32 '#9'%r31, %r28, %r30;'
  324. #9'ld.global.s32 '#9'%r32, [%r31+0];'
  325. #9'add.s32 '#9'%r33, %r14, %r20;'
  326. #9'mul.lo.u32 '#9'%r34, %r33, 4;'
  327. #9'add.u32 '#9'%r35, %r1, %r34;'
  328. #9'st.shared.s32 '#9'[%r35+0], %r32;'
  329. #9'setp.lt.u32 '#9'%p1, %r12, %r13;'
  330. #9'@!%p1 bra '#9'$Lt_0_5634;'
  331. #9'ld.param.s32 '#9'%r13, [__cudaparm_cudaProcess_k_r];'
  332. #9'.loc'#9'16'#9'80'#9'0'
  333. #9'sub.s32 '#9'%r36, %r17, %r13;'
  334. #9'min.s32 '#9'%r37, %r3, %r36;'
  335. #9'mov.s32 '#9'%r38, 0;'
  336. #9'max.s32 '#9'%r39, %r37, %r38;'
  337. #9'add.s32 '#9'%r40, %r27, %r39;'
  338. #9'mul.lo.u32 '#9'%r41, %r40, 4;'
  339. #9'.loc'#9'16'#9'75'#9'0'
  340. #9'ld.param.u32 '#9'%r28, [__cudaparm_cudaProcess_k_g_data];'
  341. #9'.loc'#9'16'#9'80'#9'0'
  342. #9'add.u32 '#9'%r42, %r28, %r41;'
  343. #9'ld.global.s32 '#9'%r43, [%r42+0];'
  344. #9'add.s32 '#9'%r44, %r20, %r12;'
  345. #9'mul.lo.u32 '#9'%r45, %r44, 4;'
  346. #9'add.u32 '#9'%r46, %r1, %r45;'
  347. #9'st.shared.s32 '#9'[%r46+0], %r43;'
  348. #9'.loc'#9'16'#9'82'#9'0'
  349. #9'add.s32 '#9'%r47, %r4, %r17;'
  350. #9'min.s32 '#9'%r48, %r3, %r47;'
  351. #9'mov.s32 '#9'%r49, 0;'
  352. #9'max.s32 '#9'%r50, %r48, %r49;'
  353. #9'add.s32 '#9'%r51, %r27, %r50;'
  354. #9'mul.lo.u32 '#9'%r52, %r51, 4;'
  355. #9'add.u32 '#9'%r53, %r28, %r52;'
  356. #9'ld.global.s32 '#9'%r54, [%r53+0];'
  357. #9'add.s32 '#9'%r55, %r20, %r12;'
  358. #9'add.s32 '#9'%r56, %r13, %r4;'
  359. #9'add.s32 '#9'%r57, %r55, %r56;'
  360. #9'mul.lo.u32 '#9'%r58, %r57, 4;'
  361. #9'add.u32 '#9'%r59, %r1, %r58;'
  362. #9'st.shared.s32 '#9'[%r59+0], %r54;'
  363. '$Lt_0_5634:'
  364. #9'.loc'#9'16'#9'75'#9'0'
  365. #9'ld.param.s32 '#9'%r13, [__cudaparm_cudaProcess_k_r];'
  366. #9'.loc'#9'16'#9'82'#9'0'
  367. #9'setp.lt.u32 '#9'%p2, %r15, %r13;'
  368. #9'@!%p2 bra '#9'$Lt_0_6146;'
  369. #9'.loc'#9'16'#9'75'#9'0'
  370. #9'ld.param.s32 '#9'%r13, [__cudaparm_cudaProcess_k_r];'
  371. #9'.loc'#9'16'#9'86'#9'0'
  372. #9'sub.s32 '#9'%r60, %r18, %r13;'
  373. #9'min.s32 '#9'%r61, %r8, %r60;'
  374. #9'mov.s32 '#9'%r62, 0;'
  375. #9'max.s32 '#9'%r63, %r61, %r62;'
  376. #9'.loc'#9'16'#9'75'#9'0'
  377. #9'ld.param.s32 '#9'%r2, [__cudaparm_cudaProcess_k_imgw];'
  378. #9'.loc'#9'16'#9'86'#9'0'
  379. #9'mul.lo.s32 '#9'%r64, %r2, %r63;'
  380. #9'add.s32 '#9'%r65, %r24, %r64;'
  381. #9'mul.lo.u32 '#9'%r66, %r65, 4;'
  382. #9'.loc'#9'16'#9'75'#9'0'
  383. #9'ld.param.u32 '#9'%r28, [__cudaparm_cudaProcess_k_g_data];'
  384. #9'.loc'#9'16'#9'86'#9'0'
  385. #9'add.u32 '#9'%r67, %r28, %r66;'
  386. #9'ld.global.s32 '#9'%r68, [%r67+0];'
  387. #9'.loc'#9'16'#9'75'#9'0'
  388. #9'ld.param.s32 '#9'%r19, [__cudaparm_cudaProcess_k_tilew];'
  389. #9'.loc'#9'16'#9'86'#9'0'
  390. #9'mul.lo.s32 '#9'%r69, %r19, %r15;'
  391. #9'add.s32 '#9'%r70, %r14, %r69;'
  392. #9'mul.lo.u32 '#9'%r71, %r70, 4;'
  393. #9'add.u32 '#9'%r72, %r1, %r71;'
  394. #9'st.shared.s32 '#9'[%r72+0], %r68;'
  395. #9'.loc'#9'16'#9'88'#9'0'
  396. #9'add.s32 '#9'%r73, %r9, %r18;'
  397. #9'min.s32 '#9'%r74, %r8, %r73;'
  398. #9'mov.s32 '#9'%r75, 0;'
  399. #9'max.s32 '#9'%r76, %r74, %r75;'
  400. #9'mul.lo.s32 '#9'%r77, %r2, %r76;'
  401. #9'add.s32 '#9'%r78, %r24, %r77;'
  402. #9'mul.lo.u32 '#9'%r79, %r78, 4;'
  403. #9'add.u32 '#9'%r80, %r28, %r79;'
  404. #9'ld.global.s32 '#9'%r81, [%r80+0];'
  405. #9'add.s32 '#9'%r82, %r13, %r9;'
  406. #9'add.s32 '#9'%r83, %r15, %r82;'
  407. #9'mul.lo.s32 '#9'%r84, %r19, %r83;'
  408. #9'add.s32 '#9'%r85, %r14, %r84;'
  409. #9'mul.lo.u32 '#9'%r86, %r85, 4;'
  410. #9'add.u32 '#9'%r87, %r1, %r86;'
  411. #9'st.shared.s32 '#9'[%r87+0], %r81;'
  412. '$Lt_0_6146:'
  413. #9'selp.s32 '#9'%r88, 1, 0, %p1;'
  414. #9'selp.s32 '#9'%r89, 1, 0, %p2;'
  415. #9'and.b32 '#9'%r90, %r88, %r89;'
  416. #9'mov.u32 '#9'%r91, 0;'
  417. #9'setp.eq.s32 '#9'%p3, %r90, %r91;'
  418. #9'@%p3 bra '#9'$Lt_0_6658;'
  419. #9'.loc'#9'16'#9'75'#9'0'
  420. #9'ld.param.s32 '#9'%r19, [__cudaparm_cudaProcess_k_tilew];'
  421. #9'.loc'#9'16'#9'94'#9'0'
  422. #9'mul.lo.s32 '#9'%r92, %r19, %r15;'
  423. #9'.loc'#9'16'#9'75'#9'0'
  424. #9'ld.param.s32 '#9'%r13, [__cudaparm_cudaProcess_k_r];'
  425. #9'.loc'#9'16'#9'94'#9'0'
  426. #9'sub.s32 '#9'%r93, %r17, %r13;'
  427. #9'sub.s32 '#9'%r94, %r18, %r13;'
  428. #9'min.s32 '#9'%r95, %r3, %r93;'
  429. #9'min.s32 '#9'%r96, %r8, %r94;'
  430. #9'mov.s32 '#9'%r97, 0;'
  431. #9'max.s32 '#9'%r98, %r95, %r97;'
  432. #9'mov.s32 '#9'%r99, 0;'
  433. #9'max.s32 '#9'%r100, %r96, %r99;'
  434. #9'.loc'#9'16'#9'75'#9'0'
  435. #9'ld.param.s32 '#9'%r2, [__cudaparm_cudaProcess_k_imgw];'
  436. #9'.loc'#9'16'#9'94'#9'0'
  437. #9'mul.lo.s32 '#9'%r101, %r100, %r2;'
  438. #9'add.s32 '#9'%r102, %r101, %r98;'
  439. #9'mul.lo.u32 '#9'%r103, %r102, 4;'
  440. #9'.loc'#9'16'#9'75'#9'0'
  441. #9'ld.param.u32 '#9'%r28, [__cudaparm_cudaProcess_k_g_data];'
  442. #9'.loc'#9'16'#9'94'#9'0'
  443. #9'add.u32 '#9'%r104, %r28, %r103;'
  444. #9'ld.global.s32 '#9'%r105, [%r104+0];'
  445. #9'add.s32 '#9'%r106, %r92, %r12;'
  446. #9'mul.lo.u32 '#9'%r107, %r106, 4;'
  447. #9'add.u32 '#9'%r108, %r1, %r107;'
  448. #9'st.shared.s32 '#9'[%r108+0], %r105;'
  449. #9'.loc'#9'16'#9'96'#9'0'
  450. #9'add.s32 '#9'%r109, %r13, %r9;'
  451. #9'add.s32 '#9'%r110, %r109, %r15;'
  452. #9'add.s32 '#9'%r111, %r9, %r18;'
  453. #9'mul.lo.s32 '#9'%r112, %r110, %r19;'
  454. #9'min.s32 '#9'%r113, %r8, %r111;'
  455. #9'mov.s32 '#9'%r114, 0;'
  456. #9'max.s32 '#9'%r115, %r113, %r114;'
  457. #9'mul.lo.s32 '#9'%r116, %r115, %r2;'
  458. #9'add.s32 '#9'%r117, %r116, %r98;'
  459. #9'mul.lo.u32 '#9'%r118, %r117, 4;'
  460. #9'add.u32 '#9'%r119, %r28, %r118;'
  461. #9'ld.global.s32 '#9'%r120, [%r119+0];'
  462. #9'add.s32 '#9'%r121, %r112, %r12;'
  463. #9'mul.lo.u32 '#9'%r122, %r121, 4;'
  464. #9'add.u32 '#9'%r123, %r1, %r122;'
  465. #9'st.shared.s32 '#9'[%r123+0], %r120;'
  466. #9'.loc'#9'16'#9'98'#9'0'
  467. #9'add.s32 '#9'%r124, %r13, %r4;'
  468. #9'add.s32 '#9'%r125, %r124, %r12;'
  469. #9'add.s32 '#9'%r126, %r9, %r17;'
  470. #9'min.s32 '#9'%r127, %r3, %r126;'
  471. #9'mov.s32 '#9'%r128, 0;'
  472. #9'max.s32 '#9'%r129, %r127, %r128;'
  473. #9'add.s32 '#9'%r130, %r101, %r129;'
  474. #9'mul.lo.u32 '#9'%r131, %r130, 4;'
  475. #9'add.u32 '#9'%r132, %r28, %r131;'
  476. #9'ld.global.s32 '#9'%r133, [%r132+0];'
  477. #9'add.s32 '#9'%r134, %r92, %r125;'
  478. #9'mul.lo.u32 '#9'%r135, %r134, 4;'
  479. #9'add.u32 '#9'%r136, %r1, %r135;'
  480. #9'st.shared.s32 '#9'[%r136+0], %r133;'
  481. #9'.loc'#9'16'#9'100'#9'0'
  482. #9'add.s32 '#9'%r137, %r4, %r17;'
  483. #9'min.s32 '#9'%r138, %r3, %r137;'
  484. #9'mov.s32 '#9'%r139, 0;'
  485. #9'max.s32 '#9'%r140, %r138, %r139;'
  486. #9'add.s32 '#9'%r141, %r116, %r140;'
  487. #9'mul.lo.u32 '#9'%r142, %r141, 4;'
  488. #9'add.u32 '#9'%r143, %r28, %r142;'
  489. #9'ld.global.s32 '#9'%r144, [%r143+0];'
  490. #9'add.s32 '#9'%r145, %r112, %r125;'
  491. #9'mul.lo.u32 '#9'%r146, %r145, 4;'
  492. #9'add.u32 '#9'%r147, %r1, %r146;'
  493. #9'st.shared.s32 '#9'[%r147+0], %r144;'
  494. '$Lt_0_6658:'
  495. #9'.loc'#9'16'#9'104'#9'0'
  496. #9'bar.sync '#9'0;'
  497. #9'.loc'#9'16'#9'112'#9'0'
  498. #9'neg.s32 '#9'%r148, %r13;'
  499. #9'mov.s32 '#9'%r149, %r148;'
  500. #9'setp.gt.s32 '#9'%p4, %r148, %r13;'
  501. #9'@%p4 bra '#9'$Lt_0_9730;'
  502. #9'add.s32 '#9'%r150, %r13, %r13;'
  503. #9'add.s32 '#9'%r151, %r150, 1;'
  504. #9'mov.s32 '#9'%r152, %r151;'
  505. #9'mul.lo.s32 '#9'%r153, %r148, %r19;'
  506. #9'mul.lo.s32 '#9'%r154, %r13, %r13;'
  507. #9'add.s32 '#9'%r155, %r13, 1;'
  508. #9'add.s32 '#9'%r156, %r14, %r155;'
  509. #9'cvt.rn.f32.s32 '#9'%f1, %r154;'
  510. #9'add.s32 '#9'%r157, %r153, %r20;'
  511. #9'mov.f32 '#9'%f2, 0f00000000; '#9'// 0'
  512. #9'mov.f32 '#9'%f3, 0f00000000; '#9'// 0'
  513. #9'mov.f32 '#9'%f4, 0f00000000; '#9'// 0'
  514. #9'mov.f32 '#9'%f5, 0f00000000; '#9'// 0'
  515. #9'mov.s32 '#9'%r158, %r152;'
  516. '$Lt_0_7682:'
  517. ' //<loop> Loop body line 112, nesting depth: 1, estimated iterat' +
  518. 'ions: unknown'
  519. #9'.loc'#9'16'#9'113'#9'0'
  520. #9'mov.s32 '#9'%r159, %r148;'
  521. #9'mov.s32 '#9'%r160, %r151;'
  522. #9'mul.lo.s32 '#9'%r161, %r149, %r149;'
  523. #9'add.s32 '#9'%r162, %r157, %r12;'
  524. #9'add.s32 '#9'%r163, %r156, %r157;'
  525. #9'mul.lo.u32 '#9'%r164, %r162, 4;'
  526. #9'mul.lo.u32 '#9'%r165, %r163, 4;'
  527. #9'add.u32 '#9'%r166, %r164, %r1;'
  528. #9'add.u32 '#9'%r167, %r165, %r1;'
  529. ' //<loop> Part of loop body line 112, head labeled $Lt_0_7682'
  530. #9'mov.s32 '#9'%r168, %r160;'
  531. '$Lt_0_8450:'
  532. ' //<loop> Loop body line 113, nesting depth: 2, estimated iterat' +
  533. 'ions: unknown'
  534. #9'.loc'#9'16'#9'114'#9'0'
  535. #9'ld.shared.s32 '#9'%r169, [%r166+0];'
  536. #9'mul.lo.s32 '#9'%r170, %r159, %r159;'
  537. #9'add.s32 '#9'%r171, %r161, %r170;'
  538. #9'cvt.rn.f32.s32 '#9'%f6, %r171;'
  539. #9'setp.le.f32 '#9'%p5, %f6, %f1;'
  540. #9'@!%p5 bra '#9'$Lt_0_8706;'
  541. ' //<loop> Part of loop body line 113, head labeled $Lt_0_8450'
  542. #9'ld.shared.s32 '#9'%r169, [%r166+0];'
  543. #9'.loc'#9'16'#9'133'#9'0'
  544. #9'and.b32 '#9'%r172, %r169, 255;'
  545. #9'cvt.rn.f32.s32 '#9'%f7, %r172;'
  546. #9'add.f32 '#9'%f5, %f7, %f5;'
  547. #9'.loc'#9'16'#9'134'#9'0'
  548. #9'shr.s32 '#9'%r173, %r169, 8;'
  549. #9'and.b32 '#9'%r174, %r173, 255;'
  550. #9'cvt.rn.f32.s32 '#9'%f8, %r174;'
  551. #9'add.f32 '#9'%f4, %f8, %f4;'
  552. #9'.loc'#9'16'#9'135'#9'0'
  553. #9'shr.s32 '#9'%r175, %r169, 16;'
  554. #9'and.b32 '#9'%r176, %r175, 255;'
  555. #9'cvt.rn.f32.s32 '#9'%f9, %r176;'
  556. #9'add.f32 '#9'%f3, %f9, %f3;'
  557. #9'.loc'#9'16'#9'136'#9'0'
  558. #9'cvt.f64.f32 '#9'%fd1, %f2;'
  559. #9'mov.f64 '#9'%fd2, 0d3ff0000000000000;'#9'// 1'
  560. #9'add.f64 '#9'%fd3, %fd1, %fd2;'
  561. #9'cvt.rn.f32.f64 '#9'%f2, %fd3;'
  562. '$Lt_0_8706:'
  563. ' //<loop> Part of loop body line 113, head labeled $Lt_0_8450'
  564. #9'add.s32 '#9'%r159, %r159, 1;'
  565. #9'add.u32 '#9'%r166, %r166, 4;'
  566. #9'setp.ne.u32 '#9'%p6, %r166, %r167;'
  567. #9'@%p6 bra '#9'$Lt_0_8450;'
  568. ' //<loop> Part of loop body line 112, head labeled $Lt_0_7682'
  569. #9'add.s32 '#9'%r149, %r149, 1;'
  570. #9'add.s32 '#9'%r157, %r157, %r19;'
  571. #9'setp.ne.s32 '#9'%p7, %r155, %r149;'
  572. #9'@%p7 bra '#9'$Lt_0_7682;'
  573. #9'bra.uni '#9'$Lt_0_7170;'
  574. '$Lt_0_9730:'
  575. #9'mov.f32 '#9'%f2, 0f00000000; '#9'// 0'
  576. #9'mov.f32 '#9'%f3, 0f00000000; '#9'// 0'
  577. #9'mov.f32 '#9'%f4, 0f00000000; '#9'// 0'
  578. #9'mov.f32 '#9'%f5, 0f00000000; '#9'// 0'
  579. '$Lt_0_7170:'
  580. #9'.loc'#9'16'#9'144'#9'0'
  581. #9'div.full.f32 '#9'%f10, %f3, %f2;'
  582. #9'cvt.rzi.s32.f32 '#9'%r177, %f10;'
  583. #9'mov.s32 '#9'%r178, 255;'
  584. #9'min.s32 '#9'%r179, %r177, %r178;'
  585. #9'mov.s32 '#9'%r180, 0;'
  586. #9'max.s32 '#9'%r181, %r179, %r180;'
  587. #9'cvt.rn.f32.s32 '#9'%f11, %r181;'
  588. #9'cvt.rzi.s32.f32 '#9'%r182, %f11;'
  589. #9'shl.b32 '#9'%r183, %r182, 16;'
  590. #9'div.full.f32 '#9'%f12, %f4, %f2;'
  591. #9'cvt.rzi.s32.f32 '#9'%r184, %f12;'
  592. #9'mov.s32 '#9'%r185, 255;'
  593. #9'min.s32 '#9'%r186, %r184, %r185;'
  594. #9'mov.s32 '#9'%r187, 0;'
  595. #9'max.s32 '#9'%r188, %r186, %r187;'
  596. #9'cvt.rn.f32.s32 '#9'%f13, %r188;'
  597. #9'cvt.rzi.s32.f32 '#9'%r189, %f13;'
  598. #9'shl.b32 '#9'%r190, %r189, 8;'
  599. #9'or.b32 '#9'%r191, %r183, %r190;'
  600. #9'div.full.f32 '#9'%f14, %f5, %f2;'
  601. #9'cvt.rzi.s32.f32 '#9'%r192, %f14;'
  602. #9'mov.s32 '#9'%r193, 255;'
  603. #9'min.s32 '#9'%r194, %r192, %r193;'
  604. #9'mov.s32 '#9'%r195, 0;'
  605. #9'max.s32 '#9'%r196, %r194, %r195;'
  606. #9'cvt.rn.f32.s32 '#9'%f15, %r196;'
  607. #9'cvt.rzi.s32.f32 '#9'%r197, %f15;'
  608. #9'or.b32 '#9'%r198, %r191, %r197;'
  609. #9'ld.param.u32 '#9'%r199, [__cudaparm_cudaProcess_k_g_odata];'
  610. #9'mul.lo.s32 '#9'%r200, %r2, %r18;'
  611. #9'add.s32 '#9'%r201, %r17, %r200;'
  612. #9'mul.lo.u32 '#9'%r202, %r201, 4;'
  613. #9'add.u32 '#9'%r203, %r199, %r202;'
  614. #9'st.global.s32 '#9'[%r203+0], %r198;'
  615. #9'.loc'#9'16'#9'145'#9'0'
  616. #9'exit;'
  617. '$LDWend_cudaProcess_k:'
  618. #9'} // cudaProcess_k'
  619. '')
  620. Compiler = GLCUDACompiler1
  621. object cudaProcess: TCUDAFunction
  622. KernelName = 'cudaProcess_k'
  623. BlockShape.SizeX = 16
  624. BlockShape.SizeY = 16
  625. Grid.SizeX = 32
  626. Grid.SizeY = 32
  627. OnParameterSetup = cudaProcessParameterSetup
  628. object cudaProcess_k_g_data: TCUDAFuncParam
  629. KernelName = 'g_data'
  630. DataType = int1
  631. Size = 0
  632. Reference = True
  633. end
  634. object cudaProcess_k_g_odata: TCUDAFuncParam
  635. KernelName = 'g_odata'
  636. DataType = int1
  637. Size = 0
  638. Reference = True
  639. end
  640. object cudaProcess_k_imgw: TCUDAFuncParam
  641. KernelName = 'imgw'
  642. DataType = int1
  643. Size = 0
  644. Reference = False
  645. end
  646. object cudaProcess_k_imgh: TCUDAFuncParam
  647. KernelName = 'imgh'
  648. DataType = int1
  649. Size = 0
  650. Reference = False
  651. end
  652. object cudaProcess_k_tilew: TCUDAFuncParam
  653. KernelName = 'tilew'
  654. DataType = int1
  655. Size = 0
  656. Reference = False
  657. end
  658. object cudaProcess_k_r: TCUDAFuncParam
  659. KernelName = 'r'
  660. DataType = int1
  661. Size = 0
  662. Reference = False
  663. end
  664. object cudaProcess_k_threshold: TCUDAFuncParam
  665. KernelName = 'threshold'
  666. DataType = float1
  667. Size = 0
  668. Reference = False
  669. end
  670. object cudaProcess_k_highlight: TCUDAFuncParam
  671. KernelName = 'highlight'
  672. DataType = float1
  673. Size = 0
  674. Reference = False
  675. end
  676. end
  677. end
  678. object processedTextureMapper: TCUDAImageResource
  679. TextureName = 'processedTexture'
  680. MaterialLibrary = GLMaterialLibrary1
  681. end
  682. object processedTextureArray: TCUDAMemData
  683. Width = 512
  684. Height = 512
  685. MemoryType = mtArray
  686. ChannelsNum = cnFour
  687. end
  688. object outputBuffer: TCUDAMemData
  689. Width = 512
  690. Height = 512
  691. MemoryType = mtDevice
  692. ChannelsNum = cnFour
  693. end
  694. object inputBuffer: TCUDAMemData
  695. Width = 512
  696. Height = 512
  697. MemoryType = mtDevice
  698. ChannelsNum = cnFour
  699. end
  700. end
  701. object GLCUDACompiler1: TGLCUDACompiler
  702. ProjectModule = 'postProcessing_kernel.cu'
  703. Left = 512
  704. Top = 184
  705. end
  706. object ResultShader: TGLSLShader
  707. FragmentProgram.Code.Strings = (
  708. '#version 150'
  709. 'uniform usampler2D TexUnit0; '
  710. 'out vec4 FragColor;'
  711. 'void main(void)'
  712. '{'
  713. ' uvec3 intColor= texelFetch(TexUnit0, ivec2(gl_FragCoord.xy), ' +
  714. '0).rgb;'
  715. ' FragColor = vec4(vec3(intColor)/ 255.0, 1.0);'
  716. '}')
  717. FragmentProgram.Enabled = True
  718. VertexProgram.Code.Strings = (
  719. '#version 150'
  720. 'in vec3 Position;'
  721. 'void main(void)'
  722. '{'
  723. ' gl_Position = vec4(sign(Position.xy), 0.0, 1.0);'
  724. '}')
  725. VertexProgram.Enabled = True
  726. OnApply = ResultShaderApply
  727. Left = 32
  728. Top = 280
  729. end
  730. object CommonShader: TGLSLShader
  731. FragmentProgram.Code.Strings = (
  732. '#version 330 compatibility'
  733. 'const float LightIntensity = 1.0;'
  734. 'const float SpecPower = 32.0; '
  735. 'in vec3 Normal; '
  736. 'in vec3 LightVector; '
  737. 'in vec3 CameraVector; '
  738. 'in vec4 Color;'
  739. 'out uvec4 FragColor;'
  740. ''
  741. 'void main() '
  742. '{'
  743. ' vec4 DiffuseContrib = clamp(gl_LightSource[0].diffuse * dot(Li' +
  744. 'ghtVector, Normal), 0.0, 1.0); '
  745. ' vec3 reflect_vec = reflect(CameraVector, -Normal); '
  746. ' float Temp = max(dot(reflect_vec, LightVector), 0.0); '
  747. ' vec4 SpecContrib = gl_LightSource[0].specular * clamp(pow(Temp' +
  748. ', SpecPower), 0.0, 0.95); '
  749. ' vec4 fFragColor = LightIntensity * (Color* (gl_LightSource[0].' +
  750. 'ambient + DiffuseContrib) + SpecContrib);'
  751. ' FragColor = uvec4(255.0 * fFragColor.rgb, 255u); '
  752. '}')
  753. FragmentProgram.Enabled = True
  754. VertexProgram.Code.Strings = (
  755. '#version 120'
  756. 'varying vec3 Normal; '
  757. 'varying vec3 LightVector; '
  758. 'varying vec3 CameraVector; '
  759. 'varying vec4 Color; '
  760. ''
  761. 'void main() '
  762. '{'
  763. ' gl_Position = ftransform(); '
  764. ' gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; '
  765. ' Normal = normalize(gl_NormalMatrix * gl_Normal); '
  766. ' vec3 p = (gl_ModelViewMatrix * gl_Vertex).xyz; '
  767. ' LightVector = normalize(gl_LightSource[0].position.xyz - p); '
  768. ' CameraVector = normalize(p); '
  769. ' Color = gl_FrontMaterial.diffuse;'
  770. '}')
  771. VertexProgram.Enabled = True
  772. Left = 32
  773. Top = 208
  774. end
  775. end