Skip to content

Commit b990649

Browse files
make Denoiser fail instead of hang, but it really needs an upgrade to a streaming version.
1 parent 1618daa commit b990649

File tree

1 file changed

+12
-1
lines changed
  • examples_tests/39.DenoiserTonemapper

1 file changed

+12
-1
lines changed

examples_tests/39.DenoiserTonemapper/main.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,9 @@ int main(int argc, char* argv[])
7979
params.Vsync = true;
8080
params.Doublebuffer = true;
8181
params.Stencilbuffer = false;
82-
params.StreamingDownloadBufferSize = 1024*1024*1024; // for 16k images
82+
// TODO: this is a temporary fix for a problem solved in the Vulkan Branch
83+
params.StreamingUploadBufferSize = 1024*1024*1024; // for Color + 2 AoV of 8k images
84+
params.StreamingDownloadBufferSize = core::roundUp(params.StreamingUploadBufferSize/3u,256u); // for output image
8385
auto device = createDeviceEx(params);
8486

8587
if (check_error(!device,"Could not create Irrlicht Device!"))
@@ -1270,8 +1272,17 @@ nbl_glsl_complex nbl_glsl_ext_FFT_getPaddedData(ivec3 coordinate, in uint channe
12701272
uint32_t inImageByteOffset[EII_COUNT];
12711273
{
12721274
asset::ICPUBuffer* buffersToUpload[EII_COUNT];
1275+
size_t inputSize = 0u;
12731276
for (uint32_t j=0u; j<denoiserInputCount; j++)
1277+
{
12741278
buffersToUpload[j] = param.image[j]->getBuffer();
1279+
inputSize += buffersToUpload[j]->getSize();
1280+
}
1281+
if (inputSize>=params.StreamingUploadBufferSize)
1282+
{
1283+
printf("[ERROR] Denoiser Failed, input too large to fit in VRAM, Streaming Denoise not implemented yet!");
1284+
return -1;
1285+
}
12751286
auto gpubuffers = driver->getGPUObjectsFromAssets(buffersToUpload,buffersToUpload+denoiserInputCount,&assetConverter);
12761287

12771288
bool skip = false;

0 commit comments

Comments
 (0)