coverage.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright 2018 Blender Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #include "render/buffers.h"
  17. #include "kernel/kernel_compat_cpu.h"
  18. #include "kernel/split/kernel_split_data.h"
  19. #include "kernel/kernel_globals.h"
  20. #include "util/util_map.h"
  21. #include "util/util_vector.h"
  22. #ifndef __COVERAGE_H__
  23. # define __COVERAGE_H__
  24. CCL_NAMESPACE_BEGIN
  25. class Coverage {
  26. public:
  27. Coverage(KernelGlobals *kg_, RenderTile &tile_) : kg(kg_), tile(tile_)
  28. {
  29. }
  30. void init_path_trace();
  31. void init_pixel(int x, int y);
  32. void finalize();
  33. private:
  34. vector<CoverageMap> coverage_object;
  35. vector<CoverageMap> coverage_material;
  36. vector<CoverageMap> coverage_asset;
  37. KernelGlobals *kg;
  38. RenderTile &tile;
  39. void finalize_buffer(vector<CoverageMap> &coverage, const int pass_offset);
  40. void flatten_buffer(vector<CoverageMap> &coverage, const int pass_offset);
  41. void sort_buffer(const int pass_offset);
  42. };
  43. CCL_NAMESPACE_END
  44. #endif /* __COVERAGE_H__ */