@@ -136,16 +136,15 @@ Renderer::Renderer(IVideoDriver* _driver, IAssetManager* _assetManager, scene::I
136
136
}
137
137
138
138
{
139
- constexpr auto raytracingCommonDescriptorCount = 7u ;
139
+ constexpr auto raytracingCommonDescriptorCount = 6u ;
140
140
IGPUDescriptorSetLayout::SBinding bindings[raytracingCommonDescriptorCount];
141
141
fillIotaDescriptorBindingDeclarations (bindings,ISpecializedShader::ESS_COMPUTE,raytracingCommonDescriptorCount);
142
142
bindings[0 ].type = asset::EDT_UNIFORM_BUFFER;
143
- bindings[1 ].type = asset::EDT_STORAGE_BUFFER ;
144
- bindings[2 ].type = asset::EDT_STORAGE_IMAGE ;
145
- bindings[3 ].type = asset::EDT_UNIFORM_TEXEL_BUFFER ;
146
- bindings[4 ].type = asset::EDT_STORAGE_IMAGE ;
143
+ bindings[1 ].type = asset::EDT_STORAGE_IMAGE ;
144
+ bindings[2 ].type = asset::EDT_UNIFORM_TEXEL_BUFFER ;
145
+ bindings[3 ].type = asset::EDT_STORAGE_IMAGE ;
146
+ bindings[4 ].type = asset::EDT_STORAGE_BUFFER ;
147
147
bindings[5 ].type = asset::EDT_STORAGE_BUFFER;
148
- bindings[6 ].type = asset::EDT_STORAGE_BUFFER;
149
148
150
149
m_commonRaytracingDSLayout = m_driver->createGPUDescriptorSetLayout (bindings,bindings+raytracingCommonDescriptorCount);
151
150
}
@@ -837,7 +836,7 @@ void Renderer::init(const SAssetBundle& meshes, core::smart_refctd_ptr<ICPUBuffe
837
836
838
837
//
839
838
constexpr uint32_t descriptorUpdates = 5 ;
840
- constexpr uint32_t descriptorUpdateCounts[descriptorUpdates] = {2u ,7u ,2u ,2u ,3u };
839
+ constexpr uint32_t descriptorUpdateCounts[descriptorUpdates] = {2u ,6u ,2u ,2u ,3u };
841
840
constexpr uint32_t descriptorUpdateMaxCount = *std::max_element (descriptorUpdateCounts,descriptorUpdateCounts+descriptorUpdates);
842
841
843
842
//
@@ -933,23 +932,22 @@ void Renderer::init(const SAssetBundle& meshes, core::smart_refctd_ptr<ICPUBuffe
933
932
region.imageExtent = {m_staticViewData.imageDimensions .x ,m_staticViewData.imageDimensions .y ,1u };
934
933
auto scrambleKeys = createScreenSizedTexture (EF_R32G32_UINT,2u );
935
934
m_driver->copyBufferToImage (tmpBuff.get (),scrambleKeys->getCreationParameters ().image .get (),1u ,®ion);
936
- setImageInfo (infos+2 ,asset::EIL_GENERAL,std::move (scrambleKeys));
935
+ setImageInfo (infos+1 ,asset::EIL_GENERAL,std::move (scrambleKeys));
937
936
}
938
937
{
939
938
// TODO: maybe use the sample limit in the future to stop a converged render
940
939
const auto maxSamples = sampleSequence->getSize ()/(sizeof (uint32_t )*MaxDimensions);
941
940
assert (maxSamples==MAX_ACCUMULATED_SAMPLES);
942
941
// upload sequence to GPU (TODO: clip its size to the dimensions we'll actually use)
943
942
auto gpubuf = m_driver->createFilledDeviceLocalGPUBufferOnDedMem (sampleSequence->getSize (),sampleSequence->getPointer ());
944
- infos[3 ].desc = m_driver->createGPUBufferView (gpubuf.get (),asset::EF_R32G32B32_UINT); // TODO: maybe try to pack into 64bits?
943
+ infos[2 ].desc = m_driver->createGPUBufferView (gpubuf.get (),asset::EF_R32G32B32_UINT); // TODO: maybe try to pack into 64bits?
945
944
}
946
- setImageInfo (infos+4 ,asset::EIL_GENERAL,core::smart_refctd_ptr (m_accumulation));
947
- createEmptyInteropBufferAndSetUpInfo (infos+5 ,m_rayBuffer[0 ],raygenBufferSize);
948
- setBufferInfo (infos+6 ,m_rayCountBuffer);
945
+ setImageInfo (infos+3 ,asset::EIL_GENERAL,core::smart_refctd_ptr (m_accumulation));
946
+ createEmptyInteropBufferAndSetUpInfo (infos+4 ,m_rayBuffer[0 ],raygenBufferSize);
947
+ setBufferInfo (infos+5 ,m_rayCountBuffer);
949
948
950
949
setDstSetAndDescTypesOnWrites (m_commonRaytracingDS[0 ].get (),writes,infos,{
951
950
EDT_UNIFORM_BUFFER,
952
- EDT_STORAGE_BUFFER,
953
951
EDT_STORAGE_IMAGE,
954
952
EDT_UNIFORM_TEXEL_BUFFER,
955
953
EDT_STORAGE_IMAGE,
@@ -958,7 +956,7 @@ void Renderer::init(const SAssetBundle& meshes, core::smart_refctd_ptr<ICPUBuffe
958
956
});
959
957
m_driver->updateDescriptorSets (descriptorUpdateCounts[1 ],writes,0u ,nullptr );
960
958
// set up second DS
961
- createEmptyInteropBufferAndSetUpInfo (infos+5 ,m_rayBuffer[1 ],raygenBufferSize);
959
+ createEmptyInteropBufferAndSetUpInfo (infos+4 ,m_rayBuffer[1 ],raygenBufferSize);
962
960
for (auto i=0u ; i<descriptorUpdateCounts[1 ]; i++)
963
961
writes[i].dstSet = m_commonRaytracingDS[1 ].get ();
964
962
m_driver->updateDescriptorSets (descriptorUpdateCounts[1 ],writes,0u ,nullptr );
0 commit comments