@@ -810,14 +810,26 @@ void Renderer::initSceneResources(SAssetBundle& meshes)
810
810
IGPUDescriptorSet::SDescriptorInfo infos[MaxDescritorUpdates];
811
811
IGPUDescriptorSet::SWriteDescriptorSet writes[MaxDescritorUpdates];
812
812
813
+ size_t lightCDF_BufferSize = 0u ;
814
+ size_t lights_BufferSize = 0u ;
815
+
813
816
// set up rest of m_additionalGlobalDS
814
817
{
815
- createFilledBufferAndSetUpInfoFromVector (infos+0 ,initData.lightCDF );
816
- createFilledBufferAndSetUpInfoFromVector (infos+1 ,initData.lights );
817
-
818
+ auto lightCDFBuffer = createFilledBufferAndSetUpInfoFromVector (infos+0 ,initData.lightCDF );
819
+ auto lightsBuffer = createFilledBufferAndSetUpInfoFromVector (infos+1 ,initData.lights );
820
+ lightCDF_BufferSize = lightCDFBuffer->getSize ();
821
+ lights_BufferSize = lightsBuffer->getSize ();
818
822
setDstSetAndDescTypesOnWrites (m_additionalGlobalDS.get (),writes,infos,{EDT_STORAGE_BUFFER,EDT_STORAGE_BUFFER},3u );
819
823
}
820
824
m_driver->updateDescriptorSets (2u ,writes,0u ,nullptr );
825
+
826
+ std::cout << " \n Scene Resources Initialized:" << std::endl;
827
+ std::cout << " \t lightCDF = " << lightCDF_BufferSize << " bytes" << std::endl;
828
+ std::cout << " \t lights = " << lights_BufferSize << " bytes" << std::endl;
829
+ std::cout << " \t indexBuffer = " << m_indexBuffer->getSize () << " bytes" << std::endl;
830
+ for (auto i=0u ; i<2u ; i++)
831
+ std::cout << " \t Indirect Draw Buffers[" << i << " ] = " << m_indirectDrawBuffers[i]->getSize () << " bytes" << std::endl;
832
+ std::cout << std::endl;
821
833
}
822
834
}
823
835
}
@@ -880,6 +892,7 @@ void Renderer::initScreenSizedResources(uint32_t width, uint32_t height, core::s
880
892
881
893
const auto renderPixelCount = m_staticViewData.imageDimensions .x *m_staticViewData.imageDimensions .y ;
882
894
// figure out how much Samples Per Pixel Per Dispatch we can afford
895
+ size_t scrambleBufferSize=0u ;
883
896
size_t raygenBufferSize=0u ,intersectionBufferSize=0u ;
884
897
{
885
898
uint32_t bxdfSamples=1u ,maxNEESamples=1u ;
@@ -1006,8 +1019,10 @@ void Renderer::initScreenSizedResources(uint32_t width, uint32_t height, core::s
1006
1019
1007
1020
// set up m_commonRaytracingDS
1008
1021
core::smart_refctd_ptr<IGPUBuffer> _staticViewDataBuffer;
1022
+ size_t staticViewDataBufferSize=0u ;
1009
1023
{
1010
1024
_staticViewDataBuffer = createFilledBufferAndSetUpInfoFromStruct (infos+0 ,m_staticViewData);
1025
+ staticViewDataBufferSize = _staticViewDataBuffer->getSize ();
1011
1026
{
1012
1027
constexpr auto ScrambleStateChannels = 2u ;
1013
1028
auto tmpBuff = m_driver->createCPUSideGPUVisibleGPUBufferOnDedMem (sizeof (uint32_t )*ScrambleStateChannels*renderPixelCount);
@@ -1022,6 +1037,7 @@ void Renderer::initScreenSizedResources(uint32_t width, uint32_t height, core::s
1022
1037
*it = rng.nextSample ();
1023
1038
tmpBuff->getBoundMemory ()->unmapMemory ();
1024
1039
}
1040
+ scrambleBufferSize = tmpBuff->getSize ();
1025
1041
// upload
1026
1042
IGPUImage::SBufferCopy region;
1027
1043
// region.imageSubresource.aspectMask = ;
@@ -1107,6 +1123,16 @@ void Renderer::initScreenSizedResources(uint32_t width, uint32_t height, core::s
1107
1123
m_colorBuffer = m_driver->addFrameBuffer ();
1108
1124
m_colorBuffer->attach (EFAP_COLOR_ATTACHMENT0, core::smart_refctd_ptr (m_tonemapOutput));
1109
1125
1126
+ std::cout << " \n Screen Sized Resources have been initialized (" << width << " x" << height << " )" << std::endl;
1127
+ std::cout << " \t StaticViewData = " << staticViewDataBufferSize << " bytes" << std::endl;
1128
+ std::cout << " \t ScrambleBuffer = " << scrambleBufferSize << " bytes" << std::endl;
1129
+ std::cout << " \t SampleSequence = " << sampleSequence->getSize () << " bytes" << std::endl;
1130
+ std::cout << " \t RayCount Buffer = " << m_rayCountBuffer->getSize () << " bytes" << std::endl;
1131
+ for (auto i=0u ; i<2u ; i++)
1132
+ std::cout << " \t Intersection Buffer[" << i << " ] = " << m_intersectionBuffer[i].buffer ->getSize () << " bytes" << std::endl;
1133
+ for (auto i=0u ; i<2u ; i++)
1134
+ std::cout << " \t Ray Buffer[" << i << " ] = " << m_rayBuffer[i].buffer ->getSize () << " bytes" << std::endl;
1135
+ std::cout << std::endl;
1110
1136
#ifdef _NBL_BUILD_OPTIX_
1111
1137
while (m_denoiser)
1112
1138
{
0 commit comments