BsTextureView.cpp 884 B

12345678910111213141516171819202122232425262728293031323334
  1. #include "BsTextureView.h"
  2. #include "BsTexture.h"
  3. #include "BsUtil.h"
  4. namespace BansheeEngine
  5. {
  6. size_t TextureView::HashFunction::operator()(const TEXTURE_VIEW_DESC &key) const
  7. {
  8. size_t seed = 0;
  9. hash_combine(seed, key.mostDetailMip);
  10. hash_combine(seed, key.numMips);
  11. hash_combine(seed, key.firstArraySlice);
  12. hash_combine(seed, key.numArraySlices);
  13. hash_combine(seed, key.usage);
  14. return seed;
  15. }
  16. bool TextureView::EqualFunction::operator()
  17. (const TEXTURE_VIEW_DESC &a, const TEXTURE_VIEW_DESC &b) const
  18. {
  19. return a.mostDetailMip == b.mostDetailMip && a.numMips == b.numMips
  20. && a.firstArraySlice == b.firstArraySlice && a.numArraySlices == b.numArraySlices && a.usage == b.usage;
  21. }
  22. TextureView::~TextureView()
  23. { }
  24. TextureView::TextureView(const SPtr<TextureCore>& texture, const TEXTURE_VIEW_DESC& desc)
  25. :mOwnerTexture(texture), mDesc(desc)
  26. {
  27. }
  28. }