CmTextureView.cpp 977 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #include "CmTextureView.h"
  2. #include "CmTexture.h"
  3. #include "CmUtil.h"
  4. namespace CamelotFramework
  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()
  25. { }
  26. void TextureView::initialize(TexturePtr texture, TEXTURE_VIEW_DESC& _desc)
  27. {
  28. mOwnerTexture = texture;
  29. mDesc = _desc;
  30. CoreObject::initialize();
  31. }
  32. }