Skip to content

Commit 677e32c

Browse files
author
Bernhard Kerbl
committed
Revert "Support for fill color"
This reverts commit af946be.
1 parent af946be commit 677e32c

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

cuda_rasterizer/forward.cu

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,6 @@ __global__ void renderCUDA(
264264
float* __restrict__ final_T,
265265
uint32_t* __restrict__ n_contrib,
266266
const float* __restrict__ bg_color,
267-
const float* __restrict__ fill_bg_color,
268267
float* __restrict__ out_color)
269268
{
270269
// Identify current tile and associated min/max pixel range.
@@ -363,13 +362,8 @@ __global__ void renderCUDA(
363362
{
364363
final_T[pix_id] = T;
365364
n_contrib[pix_id] = last_contributor;
366-
367-
if(last_contributor == 0)
368-
for (int ch = 0; ch < CHANNELS; ch++)
369-
out_color[ch * H * W + pix_id] = fill_bg_color[ch];
370-
else
371-
for (int ch = 0; ch < CHANNELS; ch++)
372-
out_color[ch * H * W + pix_id] = C[ch] + T * bg_color[ch];
365+
for (int ch = 0; ch < CHANNELS; ch++)
366+
out_color[ch * H * W + pix_id] = C[ch] + T * bg_color[ch];
373367
}
374368
}
375369

@@ -384,7 +378,6 @@ void FORWARD::render(
384378
float* final_T,
385379
uint32_t* n_contrib,
386380
const float* bg_color,
387-
const float* fill_bg_color,
388381
float* out_color)
389382
{
390383
renderCUDA<NUM_CHANNELS> << <grid, block >> > (
@@ -397,7 +390,6 @@ void FORWARD::render(
397390
final_T,
398391
n_contrib,
399392
bg_color,
400-
fill_bg_color,
401393
out_color);
402394
}
403395

cuda_rasterizer/forward.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ namespace FORWARD
4848
float* final_T,
4949
uint32_t* n_contrib,
5050
const float* bg_color,
51-
const float* fill_bg_color,
5251
float* out_color);
5352
}
5453

cuda_rasterizer/rasterizer.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ namespace CudaRasterizer
3838
const float tan_fovx, float tan_fovy,
3939
const bool prefiltered,
4040
float* out_color,
41-
int* radii = nullptr,
42-
const float* fill_background = nullptr);
41+
int* radii = nullptr);
4342

4443
static void backward(
4544
const int P, int D, int M, int R,

cuda_rasterizer/rasterizer_impl.cu

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ int CudaRasterizer::Rasterizer::forward(
205205
const float tan_fovx, float tan_fovy,
206206
const bool prefiltered,
207207
float* out_color,
208-
int* radii,
209-
const float* fill_background)
208+
int* radii)
210209
{
211210
const float focal_y = height / (2.0f * tan_fovy);
212211
const float focal_x = width / (2.0f * tan_fovx);
@@ -216,10 +215,9 @@ int CudaRasterizer::Rasterizer::forward(
216215
GeometryState geomState = GeometryState::fromChunk(chunkptr, P);
217216

218217
if (radii == nullptr)
218+
{
219219
radii = geomState.internal_radii;
220-
221-
if (fill_background == nullptr)
222-
fill_background = background;
220+
}
223221

224222
dim3 tile_grid((width + BLOCK_X - 1) / BLOCK_X, (height + BLOCK_Y - 1) / BLOCK_Y, 1);
225223
dim3 block(BLOCK_X, BLOCK_Y, 1);
@@ -320,7 +318,6 @@ int CudaRasterizer::Rasterizer::forward(
320318
imgState.accum_alpha,
321319
imgState.n_contrib,
322320
background,
323-
fill_background,
324321
out_color);
325322

326323
return num_rendered;
@@ -363,7 +360,9 @@ void CudaRasterizer::Rasterizer::backward(
363360
ImageState imgState = ImageState::fromChunk(img_buffer, width * height);
364361

365362
if (radii == nullptr)
363+
{
366364
radii = geomState.internal_radii;
365+
}
367366

368367
const float focal_y = height / (2.0f * tan_fovy);
369368
const float focal_x = width / (2.0f * tan_fovx);

0 commit comments

Comments
 (0)