Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
diff-gaussian-rasterization
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alan de Oliveira
diff-gaussian-rasterization
Commits
681c0f9e
Commit
681c0f9e
authored
Jun 20, 2023
by
Bernhard Kerbl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed bad conversions
parent
79cbd71d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
21 deletions
+22
-21
rasterizer.h
cuda_rasterizer/rasterizer.h
+3
-3
rasterizer_impl.cu
cuda_rasterizer/rasterizer_impl.cu
+7
-7
rasterizer_impl.h
cuda_rasterizer/rasterizer_impl.h
+6
-5
rasterize_points.cu
rasterize_points.cu
+6
-6
No files found.
cuda_rasterizer/rasterizer.h
View file @
681c0f9e
...
@@ -18,9 +18,9 @@ namespace CudaRasterizer
...
@@ -18,9 +18,9 @@ namespace CudaRasterizer
bool
*
present
);
bool
*
present
);
static
int
forward
(
static
int
forward
(
std
::
function
<
char
*
(
in
t
)
>
geometryBuffer
,
std
::
function
<
char
*
(
size_
t
)
>
geometryBuffer
,
std
::
function
<
char
*
(
in
t
)
>
binningBuffer
,
std
::
function
<
char
*
(
size_
t
)
>
binningBuffer
,
std
::
function
<
char
*
(
in
t
)
>
imageBuffer
,
std
::
function
<
char
*
(
size_
t
)
>
imageBuffer
,
const
int
P
,
int
D
,
int
M
,
const
int
P
,
int
D
,
int
M
,
const
float
*
background
,
const
float
*
background
,
const
int
width
,
int
height
,
const
int
width
,
int
height
,
...
...
cuda_rasterizer/rasterizer_impl.cu
View file @
681c0f9e
...
@@ -141,7 +141,7 @@ void CudaRasterizer::Rasterizer::markVisible(
...
@@ -141,7 +141,7 @@ void CudaRasterizer::Rasterizer::markVisible(
present);
present);
}
}
CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& chunk,
in
t P)
CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& chunk,
size_
t P)
{
{
GeometryState geom;
GeometryState geom;
obtain(chunk, geom.depths, P, 128);
obtain(chunk, geom.depths, P, 128);
...
@@ -158,7 +158,7 @@ CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& ch
...
@@ -158,7 +158,7 @@ CudaRasterizer::GeometryState CudaRasterizer::GeometryState::fromChunk(char*& ch
return geom;
return geom;
}
}
CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk,
in
t N)
CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk,
size_
t N)
{
{
ImageState img;
ImageState img;
obtain(chunk, img.accum_alpha, N, 128);
obtain(chunk, img.accum_alpha, N, 128);
...
@@ -167,7 +167,7 @@ CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk, i
...
@@ -167,7 +167,7 @@ CudaRasterizer::ImageState CudaRasterizer::ImageState::fromChunk(char*& chunk, i
return img;
return img;
}
}
CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chunk,
in
t P)
CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chunk,
size_
t P)
{
{
BinningState binning;
BinningState binning;
obtain(chunk, binning.point_list, P, 128);
obtain(chunk, binning.point_list, P, 128);
...
@@ -185,9 +185,9 @@ CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chun
...
@@ -185,9 +185,9 @@ CudaRasterizer::BinningState CudaRasterizer::BinningState::fromChunk(char*& chun
// Forward rendering procedure for differentiable rasterization
// Forward rendering procedure for differentiable rasterization
// of Gaussians.
// of Gaussians.
int CudaRasterizer::Rasterizer::forward(
int CudaRasterizer::Rasterizer::forward(
std::function<char*
(in
t)> geometryBuffer,
std::function<char*
(size_
t)> geometryBuffer,
std::function<char* (
in
t)> binningBuffer,
std::function<char* (
size_
t)> binningBuffer,
std::function<char* (
in
t)> imageBuffer,
std::function<char* (
size_
t)> imageBuffer,
const int P, int D, int M,
const int P, int D, int M,
const float* background,
const float* background,
const int width, int height,
const int width, int height,
...
@@ -210,7 +210,7 @@ int CudaRasterizer::Rasterizer::forward(
...
@@ -210,7 +210,7 @@ int CudaRasterizer::Rasterizer::forward(
const float focal_y = height / (2.0f * tan_fovy);
const float focal_y = height / (2.0f * tan_fovy);
const float focal_x = width / (2.0f * tan_fovx);
const float focal_x = width / (2.0f * tan_fovx);
in
t chunk_size = required<GeometryState>(P);
size_
t chunk_size = required<GeometryState>(P);
char* chunkptr = geometryBuffer(chunk_size);
char* chunkptr = geometryBuffer(chunk_size);
GeometryState geomState = GeometryState::fromChunk(chunkptr, P);
GeometryState geomState = GeometryState::fromChunk(chunkptr, P);
...
...
cuda_rasterizer/rasterizer_impl.h
View file @
681c0f9e
...
@@ -29,7 +29,7 @@ namespace CudaRasterizer
...
@@ -29,7 +29,7 @@ namespace CudaRasterizer
uint32_t
*
point_offsets
;
uint32_t
*
point_offsets
;
uint32_t
*
tiles_touched
;
uint32_t
*
tiles_touched
;
static
GeometryState
fromChunk
(
char
*&
chunk
,
in
t
P
);
static
GeometryState
fromChunk
(
char
*&
chunk
,
size_
t
P
);
};
};
struct
ImageState
struct
ImageState
...
@@ -38,7 +38,7 @@ namespace CudaRasterizer
...
@@ -38,7 +38,7 @@ namespace CudaRasterizer
uint32_t
*
n_contrib
;
uint32_t
*
n_contrib
;
float
*
accum_alpha
;
float
*
accum_alpha
;
static
ImageState
fromChunk
(
char
*&
chunk
,
in
t
N
);
static
ImageState
fromChunk
(
char
*&
chunk
,
size_
t
N
);
};
};
struct
BinningState
struct
BinningState
...
@@ -50,14 +50,14 @@ namespace CudaRasterizer
...
@@ -50,14 +50,14 @@ namespace CudaRasterizer
uint32_t
*
point_list
;
uint32_t
*
point_list
;
char
*
list_sorting_space
;
char
*
list_sorting_space
;
static
BinningState
fromChunk
(
char
*&
chunk
,
in
t
P
);
static
BinningState
fromChunk
(
char
*&
chunk
,
size_
t
P
);
};
};
template
<
typename
T
>
template
<
typename
T
>
int
required
(
in
t
P
)
size_t
required
(
size_
t
P
)
{
{
char
*
size
=
nullptr
;
char
*
size
=
nullptr
;
T
::
fromChunk
(
size
,
P
);
T
::
fromChunk
(
size
,
P
);
return
((
in
t
)
size
)
+
128
;
return
((
size_
t
)
size
)
+
128
;
}
}
};
};
\ No newline at end of file
rasterize_points.cu
View file @
681c0f9e
...
@@ -15,9 +15,9 @@
...
@@ -15,9 +15,9 @@
#include <string>
#include <string>
#include <functional>
#include <functional>
std::function<char*(
in
t N)> resizeFunctional(torch::Tensor& t) {
std::function<char*(
size_
t N)> resizeFunctional(torch::Tensor& t) {
auto lambda = [&t](
in
t N) {
auto lambda = [&t](
size_
t N) {
t.resize_({N});
t.resize_({
(long long)
N});
return reinterpret_cast<char*>(t.contiguous().data_ptr());
return reinterpret_cast<char*>(t.contiguous().data_ptr());
};
};
return lambda;
return lambda;
...
@@ -64,9 +64,9 @@ RasterizeGaussiansCUDA(
...
@@ -64,9 +64,9 @@ RasterizeGaussiansCUDA(
torch::Tensor geomBuffer = torch::empty({0}, options.device(device));
torch::Tensor geomBuffer = torch::empty({0}, options.device(device));
torch::Tensor binningBuffer = torch::empty({0}, options.device(device));
torch::Tensor binningBuffer = torch::empty({0}, options.device(device));
torch::Tensor imgBuffer = torch::empty({0}, options.device(device));
torch::Tensor imgBuffer = torch::empty({0}, options.device(device));
std::function<char*(
in
t)> geomFunc = resizeFunctional(geomBuffer);
std::function<char*(
size_
t)> geomFunc = resizeFunctional(geomBuffer);
std::function<char*(
in
t)> binningFunc = resizeFunctional(binningBuffer);
std::function<char*(
size_
t)> binningFunc = resizeFunctional(binningBuffer);
std::function<char*(
in
t)> imgFunc = resizeFunctional(imgBuffer);
std::function<char*(
size_
t)> imgFunc = resizeFunctional(imgBuffer);
int rendered = 0;
int rendered = 0;
if(P != 0)
if(P != 0)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment