GpuAccessorBase.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. namespace Ryujinx.Graphics.Gpu.Shader
  2. {
  3. /// <summary>
  4. /// Represents a GPU state and memory accessor.
  5. /// </summary>
  6. class GpuAccessorBase
  7. {
  8. private readonly GpuContext _context;
  9. /// <summary>
  10. /// Creates a new instance of the GPU state accessor.
  11. /// </summary>
  12. /// <param name="context">GPU context</param>
  13. public GpuAccessorBase(GpuContext context)
  14. {
  15. _context = context;
  16. }
  17. /// <summary>
  18. /// Queries host about the presence of the FrontFacing built-in variable bug.
  19. /// </summary>
  20. /// <returns>True if the bug is present on the host device used, false otherwise</returns>
  21. public bool QueryHostHasFrontFacingBug() => _context.Capabilities.HasFrontFacingBug;
  22. /// <summary>
  23. /// Queries host about the presence of the vector indexing bug.
  24. /// </summary>
  25. /// <returns>True if the bug is present on the host device used, false otherwise</returns>
  26. public bool QueryHostHasVectorIndexingBug() => _context.Capabilities.HasVectorIndexingBug;
  27. /// <summary>
  28. /// Queries host storage buffer alignment required.
  29. /// </summary>
  30. /// <returns>Host storage buffer alignment in bytes</returns>
  31. public int QueryHostStorageBufferOffsetAlignment() => _context.Capabilities.StorageBufferOffsetAlignment;
  32. /// <summary>
  33. /// Queries host support for readable images without a explicit format declaration on the shader.
  34. /// </summary>
  35. /// <returns>True if formatted image load is supported, false otherwise</returns>
  36. public bool QueryHostSupportsImageLoadFormatted() => _context.Capabilities.SupportsImageLoadFormatted;
  37. /// <summary>
  38. /// Queries host GPU non-constant texture offset support.
  39. /// </summary>
  40. /// <returns>True if the GPU and driver supports non-constant texture offsets, false otherwise</returns>
  41. public bool QueryHostSupportsNonConstantTextureOffset() => _context.Capabilities.SupportsNonConstantTextureOffset;
  42. /// <summary>
  43. /// Queries host GPU texture shadow LOD support.
  44. /// </summary>
  45. /// <returns>True if the GPU and driver supports texture shadow LOD, false otherwise</returns>
  46. public bool QueryHostSupportsTextureShadowLod() => _context.Capabilities.SupportsTextureShadowLod;
  47. }
  48. }