gpu_driver_bug_workarounds.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // Copyright 2016 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUNDS_H_
  5. #define GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUNDS_H_
  6. #include <vector>
  7. #include "build/build_config.h"
  8. #include "gpu/config/gpu_driver_bug_workaround_type.h"
  9. #include "gpu/gpu_export.h"
  10. // Forwardly declare a few GL types to avoid including GL header files.
  11. typedef int GLint;
  12. namespace gpu {
  13. class GPU_EXPORT GpuDriverBugWorkarounds {
  14. public:
  15. GpuDriverBugWorkarounds();
  16. explicit GpuDriverBugWorkarounds(const std::vector<int32_t>&);
  17. GpuDriverBugWorkarounds(const GpuDriverBugWorkarounds& other);
  18. ~GpuDriverBugWorkarounds();
  19. // For boolean members, || is applied.
  20. // For int members, the min() is applied if both are non-zero; if one is
  21. // zero, then the other is applied.
  22. void Append(const GpuDriverBugWorkarounds& extra);
  23. std::vector<int32_t> ToIntSet() const;
  24. #define GPU_OP(type, name) bool name = false;
  25. GPU_DRIVER_BUG_WORKAROUNDS(GPU_OP)
  26. #undef GPU_OP
  27. // Note: 0 here means use driver limit.
  28. GLint webgl_or_caps_max_texture_size = 0;
  29. GLint max_3d_array_texture_size = 0;
  30. GLint max_copy_texture_chromium_size = 0;
  31. };
  32. } // namespace gpu
  33. #endif // GPU_CONFIG_GPU_DRIVER_BUG_WORKAROUNDS_H_