HostShaderCacheHeader.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System.Runtime.InteropServices;
  2. namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
  3. {
  4. /// <summary>
  5. /// The header of a shader program in the guest cache.
  6. /// </summary>
  7. [StructLayout(LayoutKind.Sequential, Pack = 0x1, Size = 0x10)]
  8. struct HostShaderCacheHeader
  9. {
  10. /// <summary>
  11. /// The count of shaders defining this program.
  12. /// </summary>
  13. public byte Count;
  14. /// <summary>
  15. /// Unused/reserved.
  16. /// </summary>
  17. public byte Reserved1;
  18. /// <summary>
  19. /// Unused/reserved.
  20. /// </summary>
  21. public ushort Reserved2;
  22. /// <summary>
  23. /// Size of the shader binary.
  24. /// </summary>
  25. public int CodeSize;
  26. /// <summary>
  27. /// Create a new host shader cache header.
  28. /// </summary>
  29. /// <param name="count">The count of shaders defining this program</param>
  30. /// <param name="codeSize">The size of the shader binary</param>
  31. public HostShaderCacheHeader(byte count, int codeSize) : this()
  32. {
  33. Count = count;
  34. CodeSize = codeSize;
  35. }
  36. }
  37. }