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.

133 lines
3.0 KiB

  1. //========= Copyright � Valve Corporation, All rights reserved. ============//
  2. #ifndef BUILDINDICES_PS3_HDR
  3. #define BUILDINDICES_PS3_HDR
  4. #if defined( _PS3 )
  5. #if defined(__SPU__)
  6. #include "ps3/spu_job_shared.h"
  7. #else
  8. #include "utlvector.h"
  9. #include "vjobs/root.h"
  10. #include <vjobs_interface.h>
  11. #include <ps3/vjobutils.h>
  12. #include <ps3/vjobutils_shared.h>
  13. #include "vjobs/jobparams_shared.h"
  14. #endif // __SPU__
  15. #define MAX_BUILDINDICES_JOBS 32
  16. // round up to next 16B boundary, then add 16B
  17. #define ROUNDUPTONEXT16B( a ) (0x10 + ((a) + (0x10 - ((a)%0x10))))
  18. struct ALIGN128 buildIndicesJob_SPU
  19. {
  20. int debugJob; // for dynamic switching of DebuggerBreak
  21. int count;
  22. int maxIndices; //
  23. int worldStaticMeshesCount; //
  24. int listIndex;
  25. int indexCount;
  26. int meshListCount;
  27. int batchListCount;
  28. void* pEA_groupList_listIndexStart; // surfacesortgroup *
  29. void* pEA_worldStaticMeshes; // IMesh **, g_WorldStaticMeshes[]
  30. void* pEA_lastMesh; // IMesh *
  31. void* pEA_sortList_materiallist; // CMSurfaceSortList.m_list materiallist_t * via CUtlVector
  32. int32 group_listHead; // surfacesortgroup_t.listHead
  33. // worldbrushdata_t
  34. void* pEA_worldbrush_surfaces1; // msurface1_t * (host_state.worldbrush
  35. void* pEA_worldbrush_surfaces2; // msurface2_t *
  36. void* pEA_worldbrush_primitives; // mprimitive_t *
  37. void* pEA_worldbrush_primindices; // unsigned short *
  38. int worldbrush_numsurfaces; //
  39. // CIndexBuilder
  40. void* pEA_indexbuilder_indices; // unsigned short *
  41. int indexbuilder_indexOffset; //
  42. unsigned int indexbuilder_indexSize; //
  43. int indexbuilder_indexCount; //
  44. int indexbuilder_currentIndex; //
  45. int pad[1]; // to 16B boundary, shouldn't need this
  46. } ALIGN128_POST;
  47. #if !defined( __SPU__ )
  48. struct ALIGN128 PS3BuildIndicesJobData
  49. {
  50. public:
  51. job_buildindices::JobDescriptor_t jobDescriptor ALIGN128;
  52. // src, SPU in only, going to SPU at start of job
  53. buildIndicesJob_SPU buildIndicesJobSPU;
  54. } ALIGN128_POST;
  55. class CPS3BuildIndicesJob : public VJobInstance
  56. {
  57. public:
  58. CPS3BuildIndicesJob()
  59. {
  60. }
  61. ~CPS3BuildIndicesJob()
  62. {
  63. //Shutdown();
  64. }
  65. void OnVjobsInit( void ); // gets called after m_pRoot was created and assigned
  66. void OnVjobsShutdown( void ); // gets called before m_pRoot is about to be destructed and NULL'ed
  67. void Init( void );
  68. void Shutdown( void );
  69. void Sync( void );
  70. void Push( job_buildindices::JobDescriptor_t *pJobDescriptor );
  71. void ResetBoneJobs( void );
  72. PS3BuildIndicesJobData *GetJobData( void );
  73. CUtlVector<PS3BuildIndicesJobData> m_buildIndicesJobData;
  74. private:
  75. int m_buildIndicesJobCount;
  76. int m_buildIndicesJobNextSPURSPort;
  77. bool m_bEnabled;
  78. };
  79. extern IVJobs * g_pVJobs;
  80. extern CPS3BuildIndicesJob* g_pBuildIndicesJob;
  81. extern job_buildindices::JobDescriptor_t g_buildIndicesJobDescriptor ALIGN128;
  82. #endif // #if !defined(__SPU__)
  83. #endif // if !defined(_PS3)
  84. #endif