GuestShaderCacheEntryHeader.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using Ryujinx.Graphics.Shader;
  2. using System.Runtime.InteropServices;
  3. namespace Ryujinx.Graphics.Gpu.Shader.Cache.Definition
  4. {
  5. /// <summary>
  6. /// The header of a guest shader entry in a guest shader program.
  7. /// </summary>
  8. [StructLayout(LayoutKind.Sequential, Pack = 0x1, Size = 0x30)]
  9. struct GuestShaderCacheEntryHeader
  10. {
  11. /// <summary>
  12. /// The stage of this shader.
  13. /// </summary>
  14. public ShaderStage Stage;
  15. /// <summary>
  16. /// Unused/reserved.
  17. /// </summary>
  18. public byte Reserved1;
  19. /// <summary>
  20. /// Unused/reserved.
  21. /// </summary>
  22. public byte Reserved2;
  23. /// <summary>
  24. /// Unused/reserved.
  25. /// </summary>
  26. public byte Reserved3;
  27. /// <summary>
  28. /// The size of the code section.
  29. /// </summary>
  30. public int Size;
  31. /// <summary>
  32. /// The size of the code2 section if present. (Vertex A)
  33. /// </summary>
  34. public int SizeA;
  35. /// <summary>
  36. /// Constant buffer 1 data size.
  37. /// </summary>
  38. public int Cb1DataSize;
  39. /// <summary>
  40. /// The header of the cached gpu accessor.
  41. /// </summary>
  42. public GuestGpuAccessorHeader GpuAccessorHeader;
  43. /// <summary>
  44. /// Create a new guest shader entry header.
  45. /// </summary>
  46. /// <param name="stage">The stage of this shader</param>
  47. /// <param name="size">The size of the code section</param>
  48. /// <param name="sizeA">The size of the code2 section if present (Vertex A)</param>
  49. /// <param name="cb1DataSize">Constant buffer 1 data size</param>
  50. /// <param name="gpuAccessorHeader">The header of the cached gpu accessor</param>
  51. public GuestShaderCacheEntryHeader(ShaderStage stage, int size, int sizeA, int cb1DataSize, GuestGpuAccessorHeader gpuAccessorHeader) : this()
  52. {
  53. Stage = stage;
  54. Size = size;
  55. SizeA = sizeA;
  56. Cb1DataSize = cb1DataSize;
  57. GpuAccessorHeader = gpuAccessorHeader;
  58. }
  59. }
  60. }