CmTextureView.cpp 854 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "CmTextureView.h"
  2. #include "CmUtil.h"
  3. namespace CamelotEngine
  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(Texture* texture, TEXTURE_VIEW_DESC& _desc)
  22. : mDesc(_desc)
  23. {
  24. }
  25. TextureView::~TextureView()
  26. {
  27. }
  28. }