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.

187 lines
4.5 KiB

  1. //========= Copyright � Valve Corporation, All rights reserved. ============//
  2. #ifndef BUILDRENDERABLES_PS3_HDR
  3. #define BUILDRENDERABLES_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. #include "ClientLeafSystem.h"
  15. #endif // __SPU__
  16. // copied from bspfile.h, do we need the rest of that file?
  17. #define MAX_MAP_AREAS 256
  18. // round up to next 16B boundary, then add 16B
  19. #define ROUNDUPTONEXT16B( a ) (0x10 + ((a) + (0x10 - ((a)%0x10))))
  20. struct ALIGN128 buildRenderablesJob_SPU
  21. {
  22. int debugJob; // for dynamic switching of DebuggerBreak
  23. uint32 pEA_debugRenderable;
  24. SetupRenderInfo_t info;
  25. void* pEA_worldbrush_leafs; // mleaf_t *
  26. void* pEA_detailObjects; // CDetailModel *, g_detailObjectSystem->m_DetailObjects.Base()
  27. void* pEA_detailObjects_origin; // CDetailModel *, g_detailObjectSystem->m_DetailObjects.Base()
  28. // this is ptr to detailmodel.m_origin, so we don't have to fetch the whole thing, stride can this still be sizeof(CDetailModel) to access elements
  29. int detailObjects_count; // g_detailObjectSystem->m_DetailObjects.count()
  30. Vector viewOrigin; // g_vecCurrentRenderOrigin, CurrentViewOrigin()
  31. int strideCDetailModel;
  32. void* pEA_clientRenderablesList_RenderGroups; // ptr to CEntry m_REnderGroups[RENDER_GROUP_COUNT][MAX_GROUP_ENTITIRES]
  33. void* pEA_clientRenderablesList_RenderGroupCounts; // ptr to int m_REnderGroupCounts[RENDER_GROUP_COUNT]
  34. DistanceFadeInfo_t info_mpRenderList_mDetailFade;
  35. int maxCount;
  36. int buildFastReflectionRenderables; // r_fastreflectionfastpath
  37. //
  38. void* pEA_frustums[MAX_MAP_AREAS]; // Frustum_t *
  39. int numAreaFrustums;
  40. // detailobjectsystem info
  41. float flFactor;
  42. float flDetailFadeStart;
  43. float flDetailFadeEnd;
  44. // translucency
  45. float flMinLevelFadeArea;
  46. float flMaxLevelFadeArea;
  47. float flMinGlobalFadeArea;
  48. float flMaxGlobalFadeArea;
  49. float flGlobalDistFadeScale;
  50. int bComputeScreenFade;
  51. ScreenSizeComputeInfo_t screensizecomputeinfo;
  52. int shouldDrawDetailObjects;
  53. // utl
  54. void* pEA_clientleafsystem_mleaf;
  55. void* pEA_renderablesLIST; // renderable_LIST_t *
  56. void* pEA_renderablesInLeafLIST; // renderableInLeaf_LIST_t *
  57. int renderablesHeadIdx;
  58. // extract
  59. int clientleafsystem_alternateSortCount; //
  60. int clientleafsystem_drawStaticProps; //
  61. int clientleafsystem_disableShadowDepthCount;
  62. // convar copies
  63. int r_drawallrenderables;
  64. int r_portaltestents_AND_NOTr_portalsopenall;
  65. int r_occlusion;
  66. // gpGlobals
  67. int frameCount;
  68. float curTime;
  69. // CSM View
  70. bool bCSMView;
  71. bool bDisableCSMCulling;
  72. bool bShadowEntities;
  73. bool bShadowStaticProps;
  74. bool bShadowSprites;
  75. bool bIgnoreDisableShadowDepthRendering;
  76. int cascadeID;
  77. int debugViewID;
  78. int debugViewID_DEBUG;
  79. // OUT
  80. void* ppEA_Renderables; // RenderableInfo **
  81. void* pEA_RenderablesCount; // int *
  82. void* pEA_RLInfo; // BuildRenderListInfo_t *
  83. void* pEA_DetailRenderables; // DetailRenderableInfo_t *
  84. void* pEA_DetailRenderablesCount; // int *
  85. enum
  86. {
  87. MAX_GROUP_ENTITIES = 4096,
  88. MAX_BONE_SETUP_DEPENDENCY = 64,
  89. };
  90. } ALIGN128_POST;
  91. #if !defined( __SPU__ )
  92. struct ALIGN128 PS3BuildRenderablesJobData
  93. {
  94. public:
  95. job_buildrenderables::JobDescriptor_t jobDescriptor ALIGN128;
  96. // src, SPU in only, going to SPU at start of job
  97. buildRenderablesJob_SPU buildRenderablesJobSPU;
  98. } ALIGN128_POST;
  99. class CPS3BuildRenderablesJob : public VJobInstance
  100. {
  101. public:
  102. CPS3BuildRenderablesJob()
  103. {
  104. }
  105. ~CPS3BuildRenderablesJob()
  106. {
  107. Shutdown();
  108. }
  109. void OnVjobsInit( void ); // gets called after m_pRoot was created and assigned
  110. void OnVjobsShutdown( void ); // gets called before m_pRoot is about to be destructed and NULL'ed
  111. void Init( void );
  112. void Shutdown( void );
  113. void ResetBoneJobs( void );
  114. PS3BuildRenderablesJobData *GetJobData( int job );
  115. CUtlVector<PS3BuildRenderablesJobData> m_buildRenderablesJobData;
  116. private:
  117. int m_buildRenderablesJobCount;
  118. int m_buildRenderablesJobNextSPURSPort;
  119. bool m_bEnabled;
  120. };
  121. extern IVJobs * g_pVJobs;
  122. extern CPS3BuildRenderablesJob* g_pBuildRenderablesJob;
  123. extern job_buildrenderables::JobDescriptor_t g_buildRenderablesJobDescriptor ALIGN128;
  124. #endif // #if !defined(__SPU__)
  125. #endif // if !defined(_PS3)
  126. #endif