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.

75 lines
3.2 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. //
  3. // Functionality to handle collation of shader debugging metadata
  4. // (i.e. shader PDBs) sent from shadercompile workers to the master.
  5. //
  6. //===============================================================================
  7. #pragma once
  8. #ifndef SHADERCOMPILE_PS3_HELPERS_H
  9. #define SHADERCOMPILE_PS3_HELPERS_H
  10. #include "vmpi.h"
  11. //-----------------------------------------------------------------------------
  12. // The ID of the VMPI packet sent from workers to the master for each
  13. // small PS3 shader debug metadata file generated by the Sony/Cg compiler.
  14. //-----------------------------------------------------------------------------
  15. #define PS3_SHADER_DEBUG_INFO_PACKETID 6
  16. #define PS3_SHADER_COMPILE_LOG_PACKETID 11
  17. //-----------------------------------------------------------------------------
  18. // Structure of the packet corresponding to PS3_SHADER_DEBUG_INFO_PACKETID
  19. //-----------------------------------------------------------------------------
  20. struct PS3ShaderDebugInfoPacket_t
  21. {
  22. char m_PacketID; // This should be PS3_SHADER_DEBUG_INFO_PACKETID
  23. int m_nFileNameLength;
  24. int m_nFileDataLength;
  25. // Followed by m_nFileNameLength + m_nFileDataLength bytes of data
  26. };
  27. //-----------------------------------------------------------------------------
  28. // Handler for VMPI packet: PS3_SHADER_DEBUG_INFO_PACKETID.
  29. // Called on the master when such a packet is received.
  30. //-----------------------------------------------------------------------------
  31. bool PS3ShaderDebugInfoDispatch( MessageBuffer *pBuf, int nSource, int nPacketID );
  32. //-----------------------------------------------------------------------------
  33. // Initializes the TOC and Pack files used to store the large amount
  34. // of shader metadata generated by the worker machines.
  35. // Called on the master.
  36. //-----------------------------------------------------------------------------
  37. void InitializePS3ShaderDebugPackFiles();
  38. //-----------------------------------------------------------------------------
  39. // Expand PS3 debug information that has been accumulated into giant pack
  40. // files on the master's machine.
  41. // These giant files expand into hundreds of thousands of tiny files
  42. // required for shader debugging.
  43. // Called on the master.
  44. //-----------------------------------------------------------------------------
  45. void ExpandPS3DebugInfo();
  46. //-----------------------------------------------------------------------------
  47. // Sends all files and non-empty directories to the VMPI master, one packet
  48. // per file (see PS3_SHADER_DEBUG_INFO_PACKETID). Called by workers.
  49. //-----------------------------------------------------------------------------
  50. void SendSubDirectoryToMaster( const char *pStartingPath );
  51. //-----------------------------------------------------------------------------
  52. // Shader compile statistics log file
  53. //-----------------------------------------------------------------------------
  54. struct PS3ShaderCompileLogPacket_t
  55. {
  56. char m_PacketID; // This should be PS3_SHADER_COMPILE_LOG_PACKETID
  57. int m_nPacketSize;
  58. // Followed by m_nPacketSize bytes of data
  59. };
  60. void PS3SendShaderCompileLogContentsToMaster();
  61. bool PS3ShaderCompileLogDispatch( MessageBuffer *pBuf, int nSource, int nPacketID );
  62. #endif // SHADERCOMPILE_PS3_HELPERS_H