guest_driver.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Copyright 2020 yuzu Emulator Project
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include <vector>
  6. #include "common/common_types.h"
  7. namespace VideoCore {
  8. /**
  9. * The GuestDriverProfile class is used to learn about the GPU drivers behavior and collect
  10. * information necessary for impossible to avoid HLE methods like shader tracks as they are
  11. * Entscheidungsproblems.
  12. */
  13. class GuestDriverProfile {
  14. public:
  15. void DeduceTextureHandlerSize(std::vector<u32>&& bound_offsets);
  16. u32 GetTextureHandlerSize() const {
  17. return texture_handler_size;
  18. }
  19. bool TextureHandlerSizeKnown() const {
  20. return texture_handler_size_deduced;
  21. }
  22. private:
  23. // Minimum size of texture handler any driver can use.
  24. static constexpr u32 min_texture_handler_size = 4;
  25. // This goes with Vulkan and OpenGL standards but Nvidia GPUs can easily
  26. // use 4 bytes instead. Thus, certain drivers may squish the size.
  27. static constexpr u32 default_texture_handler_size = 8;
  28. u32 texture_handler_size = default_texture_handler_size;
  29. bool texture_handler_size_deduced = false;
  30. };
  31. } // namespace VideoCore