Skip to content

Commit ebfa0a5

Browse files
author
devsh
committed
remove redundant builtin assets
1 parent 210cca4 commit ebfa0a5

File tree

1 file changed

+0
-70
lines changed

1 file changed

+0
-70
lines changed

src/nbl/asset/IAssetManager.cpp

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -254,41 +254,6 @@ void IAssetManager::insertBuiltinAssets()
254254
insertBuiltinAssetIntoCache(bundle);
255255
};
256256

257-
/*
258-
SBinding for UBO - basic view parameters.
259-
*/
260-
261-
asset::ICPUDescriptorSetLayout::SBinding binding1;
262-
binding1.count = 1u;
263-
binding1.binding = 0u;
264-
binding1.stageFlags = static_cast<hlsl::ShaderStage>(hlsl::ShaderStage::ESS_VERTEX | hlsl::ShaderStage::ESS_FRAGMENT);
265-
binding1.type = asset::IDescriptor::E_TYPE::ET_UNIFORM_BUFFER;
266-
267-
auto ds1Layout = core::make_smart_refctd_ptr<asset::ICPUDescriptorSetLayout>(&binding1, &binding1 + 1);
268-
addBuiltInToCaches(ds1Layout, "nbl/builtin/material/lambertian/singletexture/descriptor_set_layout/1");
269-
270-
/*
271-
SBinding for the texture (sampler).
272-
*/
273-
274-
asset::ICPUDescriptorSetLayout::SBinding binding3;
275-
binding3.binding = 0u;
276-
binding3.type = IDescriptor::E_TYPE::ET_COMBINED_IMAGE_SAMPLER;
277-
binding3.count = 1u;
278-
binding3.stageFlags = static_cast<hlsl::ShaderStage>(hlsl::ShaderStage::ESS_FRAGMENT);
279-
binding3.immutableSamplers = nullptr;
280-
281-
auto ds3Layout = core::make_smart_refctd_ptr<asset::ICPUDescriptorSetLayout>(&binding3, &binding3 + 1);
282-
addBuiltInToCaches(ds3Layout, "nbl/builtin/material/lambertian/singletexture/descriptor_set_layout/3"); // TODO find everything what has been using it so far
283-
284-
constexpr uint32_t pcCount = 1u;
285-
asset::SPushConstantRange pcRanges[pcCount] = {asset::IShader::E_SHADER_STAGE::ESS_VERTEX,0u,sizeof(core::matrix4SIMD)};
286-
auto pLayout = core::make_smart_refctd_ptr<asset::ICPUPipelineLayout>(
287-
std::span<const asset::SPushConstantRange>(pcRanges,pcCount),
288-
nullptr,core::smart_refctd_ptr(ds1Layout),nullptr,core::smart_refctd_ptr(ds3Layout)
289-
);
290-
addBuiltInToCaches(pLayout,"nbl/builtin/material/lambertian/singletexture/pipeline_layout"); // TODO find everything what has been using it so far
291-
292257
// samplers
293258
{
294259
asset::ISampler::SParams params;
@@ -369,39 +334,4 @@ void IAssetManager::insertBuiltinAssets()
369334
addBuiltInToCaches(dummy2dImgView, "nbl/builtin/image_view/dummy2d");
370335
addBuiltInToCaches(dummy2dImage, "nbl/builtin/image/dummy2d");
371336
}
372-
373-
//ds layouts
374-
core::smart_refctd_ptr<asset::ICPUDescriptorSetLayout> defaultDs1Layout;
375-
{
376-
asset::ICPUDescriptorSetLayout::SBinding bnd;
377-
bnd.count = 1u;
378-
bnd.binding = 0u;
379-
//maybe even ESS_ALL_GRAPHICS?
380-
bnd.stageFlags = static_cast<hlsl::ShaderStage>(hlsl::ShaderStage::ESS_VERTEX | hlsl::ShaderStage::ESS_FRAGMENT);
381-
bnd.type = asset::IDescriptor::E_TYPE::ET_UNIFORM_BUFFER;
382-
defaultDs1Layout = core::make_smart_refctd_ptr<asset::ICPUDescriptorSetLayout>(&bnd, &bnd+1);
383-
//it's intentionally added to cache later, see comments below, dont touch this order of insertions
384-
}
385-
386-
// pipeline layout
387-
core::smart_refctd_ptr<asset::ICPUPipelineLayout> pipelineLayout;
388-
{
389-
asset::ICPUDescriptorSetLayout::SBinding bnd;
390-
bnd.count = 1u;
391-
bnd.binding = 0u;
392-
bnd.stageFlags = static_cast<hlsl::ShaderStage>(hlsl::ShaderStage::ESS_VERTEX | hlsl::ShaderStage::ESS_FRAGMENT);
393-
bnd.type = asset::IDescriptor::E_TYPE::ET_UNIFORM_BUFFER;
394-
auto ds1Layout = core::make_smart_refctd_ptr<asset::ICPUDescriptorSetLayout>(&bnd, &bnd + 1);
395-
396-
pipelineLayout = core::make_smart_refctd_ptr<asset::ICPUPipelineLayout>(std::span<const asset::SPushConstantRange>(),nullptr,std::move(ds1Layout),nullptr,nullptr);
397-
auto paths =
398-
{
399-
"nbl/builtin/material/lambertian/no_texture/pipeline_layout",
400-
"nbl/builtin/pipeline_layout/loader/PLY",
401-
"nbl/builtin/pipeline_layout/loader/STL"
402-
};
403-
404-
for(auto &path : paths)
405-
addBuiltInToCaches(pipelineLayout, path);
406-
}
407337
}

0 commit comments

Comments
 (0)