BsTextureView.cpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #include "BsTextureView.h"
  5. #include "BsTexture.h"
  6. #include "BsUtil.h"
  7. namespace BansheeEngine
  8. {
  9. size_t TextureView::HashFunction::operator()(const TEXTURE_VIEW_DESC &key) const
  10. {
  11. size_t seed = 0;
  12. hash_combine(seed, key.mostDetailMip);
  13. hash_combine(seed, key.numMips);
  14. hash_combine(seed, key.firstArraySlice);
  15. hash_combine(seed, key.numArraySlices);
  16. hash_combine(seed, key.usage);
  17. return seed;
  18. }
  19. bool TextureView::EqualFunction::operator()
  20. (const TEXTURE_VIEW_DESC &a, const TEXTURE_VIEW_DESC &b) const
  21. {
  22. return a.mostDetailMip == b.mostDetailMip && a.numMips == b.numMips
  23. && a.firstArraySlice == b.firstArraySlice && a.numArraySlices == b.numArraySlices && a.usage == b.usage;
  24. }
  25. TextureView::TextureView()
  26. { }
  27. TextureView::~TextureView()
  28. { }
  29. void TextureView::initialize(TexturePtr texture, TEXTURE_VIEW_DESC& _desc)
  30. {
  31. mOwnerTexture = texture;
  32. mDesc = _desc;
  33. CoreObject::initialize();
  34. }
  35. }