BsTextureView.cpp 864 B

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