GrVkImageLayout.h 735 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright 2018 Google Inc.
  3. *
  4. * Use of this source code is governed by a BSD-style license that can be
  5. * found in the LICENSE file.
  6. */
  7. #ifndef GrVkImageLayout_DEFINED
  8. #define GrVkImageLayout_DEFINED
  9. #include "include/core/SkRefCnt.h"
  10. #include "include/gpu/vk/GrVkTypes.h"
  11. class GrVkImageLayout : public SkRefCnt {
  12. public:
  13. GrVkImageLayout(VkImageLayout layout) : fLayout(layout) {}
  14. void setImageLayout(VkImageLayout layout) {
  15. // Defaulting to use std::memory_order_seq_cst
  16. fLayout.store(layout);
  17. }
  18. VkImageLayout getImageLayout() const {
  19. // Defaulting to use std::memory_order_seq_cst
  20. return fLayout.load();
  21. }
  22. private:
  23. std::atomic<VkImageLayout> fLayout;
  24. };
  25. #endif