gl_device.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. // Copyright 2019 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <cstddef>
  6. #include "common/common_types.h"
  7. namespace OpenGL {
  8. class Device {
  9. public:
  10. explicit Device();
  11. explicit Device(std::nullptr_t);
  12. std::size_t GetUniformBufferAlignment() const {
  13. return uniform_buffer_alignment;
  14. }
  15. std::size_t GetShaderStorageBufferAlignment() const {
  16. return shader_storage_alignment;
  17. }
  18. u32 GetMaxVertexAttributes() const {
  19. return max_vertex_attributes;
  20. }
  21. u32 GetMaxVaryings() const {
  22. return max_varyings;
  23. }
  24. bool HasWarpIntrinsics() const {
  25. return has_warp_intrinsics;
  26. }
  27. bool HasVertexViewportLayer() const {
  28. return has_vertex_viewport_layer;
  29. }
  30. bool HasImageLoadFormatted() const {
  31. return has_image_load_formatted;
  32. }
  33. bool HasVariableAoffi() const {
  34. return has_variable_aoffi;
  35. }
  36. bool HasComponentIndexingBug() const {
  37. return has_component_indexing_bug;
  38. }
  39. bool HasPreciseBug() const {
  40. return has_precise_bug;
  41. }
  42. private:
  43. static bool TestVariableAoffi();
  44. static bool TestComponentIndexingBug();
  45. static bool TestPreciseBug();
  46. std::size_t uniform_buffer_alignment{};
  47. std::size_t shader_storage_alignment{};
  48. u32 max_vertex_attributes{};
  49. u32 max_varyings{};
  50. bool has_warp_intrinsics{};
  51. bool has_vertex_viewport_layer{};
  52. bool has_image_load_formatted{};
  53. bool has_variable_aoffi{};
  54. bool has_component_indexing_bug{};
  55. bool has_precise_bug{};
  56. };
  57. } // namespace OpenGL