Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

312 lines
6.2 KiB

  1. //========== Copyright � Valve Corporation, All rights reserved. ========
  2. #if !defined( VJOBS_JOBPARAMS_SHARED_HDR ) && defined( _PS3 )
  3. #define VJOBS_JOBPARAMS_SHARED_HDR
  4. #include "ps3/spu_job_shared.h"
  5. // these structure belong in its own headers in public/vjobs, but they're small and I don't want to pollute public with such trivialities
  6. namespace job_ctxflush
  7. {
  8. struct JobParams_t
  9. {
  10. uint32 m_nUsefulCmdBytes;
  11. uint32 m_nNewPcbringEnd;
  12. };
  13. inline JobParams_t * GetJobParams( void *pJob )
  14. {
  15. return VjobGetJobParams< JobParams_t, CellSpursJob128 >( pJob );
  16. }
  17. }
  18. namespace job_gcmstateflush
  19. {
  20. typedef CellSpursJob128 JobDescriptor_t;
  21. struct JobParams_t
  22. {
  23. uint32 m_nSpuDrawQueueSignal;
  24. uint16 m_nSizeofDrawQueueUploadWords; // this may be unaligned, and it counts bytes from the unaligned start
  25. uint16 m_nSkipDrawQueueWords;
  26. };
  27. inline JobParams_t * GetJobParams( void *pJob )
  28. {
  29. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  30. }
  31. }
  32. namespace job_hello
  33. {
  34. struct ALIGN128 Exchange_t
  35. {
  36. uint32 m_numSpusJoined;
  37. uint32 m_nStage;
  38. uint64 m_nIncrementer[2];
  39. } ALIGN128_POST;
  40. }
  41. namespace job_zpass
  42. {
  43. typedef CellSpursJob128 JobDescriptor_t;
  44. enum ConstEnum_t
  45. {
  46. PHASE_ZPREPASS,
  47. PHASE_RENDER,
  48. PHASE_END
  49. };
  50. struct JobParams_t
  51. {
  52. uint8 m_nPhase;
  53. uint8 m_nDebuggerBreak;
  54. };
  55. inline JobParams_t * GetJobParams( void *pJob )
  56. {
  57. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  58. }
  59. }
  60. struct CellMP3Context;
  61. // Edge Zlib compression job
  62. namespace job_zlibdeflate
  63. {
  64. typedef CellSpursJob128 JobDescriptor_t;
  65. struct JobParams_t
  66. {
  67. uint16 IsDone()const { return *(volatile uint16*)&m_nStatus; }
  68. void * m_eaOutputCompressedData;
  69. uint32 m_nMaxCompressedOutputSize;
  70. void * m_eaInputUncompressedData;
  71. uint32 m_nUncompressedSize;
  72. uint32 m_nError;
  73. // 0 : compressed data was larger than uncompressed or compression error, store uncompressed
  74. // the MSB is set when data is compressed
  75. uint32 m_nCompressedSizeOut;
  76. uint16 m_nStatus; // will be non-0 when the job is done
  77. uint16 m_nDebuggerBreak;
  78. };
  79. inline JobParams_t * GetJobParams( void *pJob )
  80. {
  81. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  82. }
  83. }
  84. // Edge Zlib decompression job
  85. namespace job_zlibinflate
  86. {
  87. typedef CellSpursJob128 JobDescriptor_t;
  88. struct JobParams_t
  89. {
  90. uint16 IsDone()const { return *(volatile uint16*)&m_nStatus; }
  91. void *m_eaUncompressedOutput;
  92. uint32 m_nExpectedUncompressedSize;
  93. void *m_eaCompressed;
  94. uint32 m_nCompressedSize;
  95. // 0 : decompressed without error
  96. uint32 m_nError;
  97. uint16 m_nStatus; // will be non-0 when the job is done
  98. uint16 m_nDebuggerBreak;
  99. };
  100. inline JobParams_t * GetJobParams( void *pJob )
  101. {
  102. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  103. }
  104. }
  105. namespace job_edgemlaa
  106. {
  107. typedef CellSpursJob128 JobDescriptor_t;
  108. struct JobParams_t
  109. {
  110. uint32 m_nDebuggerBreakMask;
  111. uint32 *m_eaJts; // patch this with RETURN
  112. };
  113. inline JobParams_t * GetJobParams( void *pJob )
  114. {
  115. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  116. }
  117. }
  118. namespace job_buildindices
  119. {
  120. typedef CellSpursJob128 JobDescriptor_t;
  121. struct JobParams_t
  122. {
  123. int m_testInt_IN;
  124. int m_testInt_OUT;
  125. };
  126. inline JobParams_t * GetJobParams( void *pJob )
  127. {
  128. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  129. }
  130. }
  131. namespace job_buildrenderables
  132. {
  133. typedef CellSpursJob128 JobDescriptor_t;
  134. struct JobParams_t
  135. {
  136. int m_testInt_IN;
  137. int m_testInt_OUT;
  138. };
  139. inline JobParams_t * GetJobParams( void *pJob )
  140. {
  141. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  142. }
  143. }
  144. namespace job_buildworldlists
  145. {
  146. typedef CellSpursJob256 JobDescriptor_t;
  147. struct JobParams_t
  148. {
  149. uint32 m_nDebugBreak;
  150. uint32 m_eaWorldNodes;
  151. int m_visframecount;
  152. uint32 m_pSurfaces2;
  153. uint32 m_pmarksurfaces;
  154. uint32 m_pLeafs;
  155. float m_ModelOrg[4];
  156. bool m_bViewerInSolidSpace;
  157. uint32 m_Disp_ParentSurfID_offset;
  158. uint32 m_Disp_BB_offset;
  159. uint32 m_Disp_Info_Size;
  160. uint32 m_pDispInfos;
  161. uint32 m_eaFrustum;
  162. uint32 m_nAreaFrustum;
  163. uint32 m_eaAreaFrustum;
  164. uint32 m_eaRenderAreaBits;
  165. uint32 m_eaDispInfoReferences;
  166. uint32 m_nMaxVisitSurfaces;
  167. uint32 m_nNumSortID;
  168. bool m_bShadowDepth;
  169. bool m_bDrawTopView;
  170. bool m_bTopViewNoBackfaceCulling;
  171. bool m_bTopViewNoVisCheck;
  172. uint32 m_eaVolumeCuller;
  173. float m_orthoCenter[2];
  174. float m_orthoHalfDi[2];
  175. int m_DrawFlags;
  176. int m_buildViewID;
  177. // inout
  178. uint32 m_eaInfo;
  179. uint32 m_eaRenderListLeaves;
  180. // addr of output DMA structure
  181. uint32 m_eaDMAOut;
  182. // offset for CUtlVector Count
  183. uint32 m_nUtlCountOffset;
  184. };
  185. struct ALIGN128 buildWorldListsDMAOut
  186. {
  187. // m_SortList
  188. uint32 m_pSortList_m_list;
  189. uint32 m_pSortList_m_groupsShared;
  190. uint32 m_pSortList_m_groupIndices;
  191. uint32 m_pSortList_m_sortGroupLists[4];
  192. uint32 m_pSortList_m_listUtlPtr;
  193. uint32 m_pSortList_m_groupsSharedUtlPtr;
  194. uint32 m_pSortList_m_groupIndicesUtlPtr;
  195. uint32 m_pSortList_m_sortGroupListsUtlPtr[4];
  196. // m_DispSortList
  197. uint32 m_pDispSortList_m_list;
  198. uint32 m_pDispSortList_m_groupsShared;
  199. uint32 m_pDispSortList_m_groupIndices;
  200. uint32 m_pDispSortList_m_sortGroupLists[4];
  201. uint32 m_pDispSortList_m_listUtlPtr;
  202. uint32 m_pDispSortList_m_groupsSharedUtlPtr;
  203. uint32 m_pDispSortList_m_groupIndicesUtlPtr;
  204. uint32 m_pDispSortList_m_sortGroupListsUtlPtr[4];
  205. // m_AlphaSurfaces
  206. uint32 m_pAlphaSurfaces;
  207. uint32 m_pAlphaSurfacesUtlPtr;
  208. // m_DlightSurfaces
  209. uint32 m_pDlightSurfaces[4];
  210. uint32 m_pDlightSurfacesUtlPtr[4];
  211. // m_PaintedSurfaces
  212. uint32 m_pPaintedSurfaces[4];
  213. uint32 m_pPaintedSurfacesUtlPtr[4];
  214. // m_leaves
  215. uint32 m_pLeaves;
  216. uint32 m_pLeavesUtlPtr;
  217. // m_VisitedSurfs
  218. uint32 m_pVisitedSurfs;
  219. // decal surf list
  220. uint32 m_pDecalSurfsToAdd;
  221. uint32 m_pDecalSurfsToAddUtlPtr;
  222. // m_bSkyVisible
  223. uint32 m_pSkyVisible;
  224. // m_bWaterVisible
  225. uint32 m_pWaterVisible;
  226. } ALIGN128_POST;
  227. struct decalSurfPair
  228. {
  229. uint32 m_surfID;
  230. int m_renderGroup;
  231. };
  232. inline JobParams_t * GetJobParams( void *pJob )
  233. {
  234. return VjobGetJobParams< JobParams_t, JobDescriptor_t >( pJob );
  235. }
  236. }
  237. #endif