BsTextureView.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #include "RenderAPI/BsTextureView.h"
  4. #include "Image/BsTexture.h"
  5. namespace bs { namespace ct
  6. {
  7. size_t TextureView::HashFunction::operator()(const TEXTURE_VIEW_DESC &key) const
  8. {
  9. size_t seed = 0;
  10. hash_combine(seed, key.mostDetailMip);
  11. hash_combine(seed, key.numMips);
  12. hash_combine(seed, key.firstArraySlice);
  13. hash_combine(seed, key.numArraySlices);
  14. hash_combine(seed, key.usage);
  15. return seed;
  16. }
  17. bool TextureView::EqualFunction::operator()
  18. (const TEXTURE_VIEW_DESC &a, const TEXTURE_VIEW_DESC &b) const
  19. {
  20. return a.mostDetailMip == b.mostDetailMip && a.numMips == b.numMips
  21. && a.firstArraySlice == b.firstArraySlice && a.numArraySlices == b.numArraySlices && a.usage == b.usage;
  22. }
  23. TextureView::~TextureView()
  24. { }
  25. TextureView::TextureView(const TEXTURE_VIEW_DESC& desc)
  26. :mDesc(desc)
  27. {
  28. }
  29. }}