Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

rasterizer_impl.h 1.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
  1. /*
  2. * Copyright (C) 2023, Inria
  3. * GRAPHDECO research group, https://team.inria.fr/graphdeco
  4. * All rights reserved.
  5. *
  6. * This software is free for non-commercial, research and evaluation use
  7. * under the terms of the LICENSE.md file.
  8. *
  9. * For inquiries contact george.drettakis@inria.fr
  10. */
  11. #pragma once
  12. #include <iostream>
  13. #include <vector>
  14. #include "rasterizer.h"
  15. #include <cuda_runtime_api.h>
  16. namespace CudaRasterizer
  17. {
  18. template <typename T>
  19. static void obtain(char*& chunk, T*& ptr, std::size_t count, std::size_t alignment)
  20. {
  21. std::size_t offset = (reinterpret_cast<std::uintptr_t>(chunk) + alignment - 1) & ~(alignment - 1);
  22. ptr = reinterpret_cast<T*>(offset);
  23. chunk = reinterpret_cast<char*>(ptr + count);
  24. }
  25. struct GeometryState
  26. {
  27. size_t scan_size;
  28. float* depths;
  29. char* scanning_space;
  30. bool* clamped;
  31. int* internal_radii;
  32. float2* means2D;
  33. float* cov3D;
  34. float4* conic_opacity;
  35. float* rgb;
  36. uint32_t* point_offsets;
  37. uint32_t* tiles_touched;
  38. static GeometryState fromChunk(char*& chunk, size_t P);
  39. };
  40. struct ImageState
  41. {
  42. uint2* ranges;
  43. uint32_t* n_contrib;
  44. float* accum_alpha;
  45. static ImageState fromChunk(char*& chunk, size_t N);
  46. };
  47. struct BinningState
  48. {
  49. size_t sorting_size;
  50. uint64_t* point_list_keys_unsorted;
  51. uint64_t* point_list_keys;
  52. uint32_t* point_list_unsorted;
  53. uint32_t* point_list;
  54. char* list_sorting_space;
  55. static BinningState fromChunk(char*& chunk, size_t P);
  56. };
  57. template<typename T>
  58. size_t required(size_t P)
  59. {
  60. char* size = nullptr;
  61. T::fromChunk(size, P);
  62. return ((size_t)size) + 128;
  63. }
  64. };
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...