Skip to content

Commit e9ea363

Browse files
committed
fix more lambda template crap and compile commonpch target again
1 parent f15b671 commit e9ea363

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

include/nbl/scene/ICullingLoDSelectionSystem.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -487,16 +487,16 @@ class NBL_API ICullingLoDSelectionSystem : public virtual core::IReferenceCounte
487487
return nullptr;
488488

489489
using shader_source_and_path = std::pair<core::smart_refctd_ptr<asset::ICPUShader>,system::path>;
490-
auto getShader = [device](auto uniqueString) -> shader_source_and_path
490+
auto getShader = [device]<core::StringLiteral Path>() -> shader_source_and_path
491491
{
492492
auto system = device->getPhysicalDevice()->getSystem();
493-
auto glslFile = system->loadBuiltinData<decltype(uniqueString)>();
493+
auto glslFile = system->loadBuiltinData<Path>();
494494
core::smart_refctd_ptr<asset::ICPUBuffer> glsl;
495495
{
496496
glsl = core::make_smart_refctd_ptr<asset::ICPUBuffer>(glslFile->getSize());
497497
memcpy(glsl->getPointer(), glslFile->getMappedPointer(), glsl->getSize());
498498
}
499-
return {core::make_smart_refctd_ptr<asset::ICPUShader>(std::move(glsl), asset::IShader::ESS_COMPUTE, asset::IShader::E_CONTENT_TYPE::ECT_GLSL, decltype(uniqueString)::value), decltype(uniqueString)::value};
499+
return {core::make_smart_refctd_ptr<asset::ICPUShader>(std::move(glsl), asset::IShader::ESS_COMPUTE, asset::IShader::E_CONTENT_TYPE::ECT_GLSL, Path.value), Path.value};
500500
};
501501
auto overrideShader = [device,&cwdForShaderCompilation,workgroupSize,_scanner](shader_source_and_path&& baseShader, std::string additionalCode)
502502
{
@@ -515,7 +515,7 @@ class NBL_API ICullingLoDSelectionSystem : public virtual core::IReferenceCounte
515515

516516
const std::string workgroupSizeDef = "\n#define _NBL_GLSL_WORKGROUP_SIZE_ _NBL_GLSL_CULLING_LOD_SELECTION_CULL_WORKGROUP_SIZE_\n";
517517

518-
auto firstShader = getShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/culling_lod_selection/instance_cull_and_lod_select.comp")());
518+
auto firstShader = getShader.operator()<core::StringLiteral("nbl/builtin/glsl/culling_lod_selection/instance_cull_and_lod_select.comp")>();
519519
auto instanceCullAndLoDSelect = device->createComputePipeline(
520520
nullptr,core::smart_refctd_ptr(instanceCullAndLoDSelectLayout),
521521
overrideShader(std::move(firstShader),workgroupSizeDef+perViewPerInstanceDefinition+cullAndLoDSelectFuncDefinitions)
@@ -533,7 +533,7 @@ class NBL_API ICullingLoDSelectionSystem : public virtual core::IReferenceCounte
533533

534534
auto instanceDrawCull = device->createComputePipeline(
535535
nullptr,core::smart_refctd_ptr(instanceDrawCullLayout),
536-
overrideShader(getShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/culling_lod_selection/instance_draw_cull.comp")()),workgroupSizeDef+perViewPerInstanceDefinition)
536+
overrideShader(getShader.operator()<core::StringLiteral("nbl/builtin/glsl/culling_lod_selection/instance_draw_cull.comp")>(),workgroupSizeDef+perViewPerInstanceDefinition)
537537
);
538538

539539
auto drawInstanceCountPrefixSum = device->createComputePipeline(
@@ -548,7 +548,7 @@ class NBL_API ICullingLoDSelectionSystem : public virtual core::IReferenceCounte
548548
);
549549
auto instanceRefCountingSortScatter = device->createComputePipeline(
550550
nullptr,core::smart_refctd_ptr(instanceRefCountingSortPipelineLayout),
551-
overrideShader(getShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/culling_lod_selection/instance_ref_counting_sort_scatter.comp")()),workgroupSizeDef)
551+
overrideShader(getShader.operator()<core::StringLiteral("nbl/builtin/glsl/culling_lod_selection/instance_ref_counting_sort_scatter.comp")>(),workgroupSizeDef)
552552
);
553553

554554
//auto drawCompact = ?;

include/nbl/scene/ITransformTreeManager.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ class NBL_API ITransformTreeManager : public virtual core::IReferenceCounted
106106
{
107107
auto device = utils->getLogicalDevice();
108108
auto system = device->getPhysicalDevice()->getSystem();
109-
auto createShader = [&system,&device](auto uniqueString, asset::IShader::E_SHADER_STAGE type=asset::IShader::ESS_COMPUTE) -> core::smart_refctd_ptr<video::IGPUSpecializedShader>
109+
auto createShader = [&system,&device]<core::StringLiteral Path>(asset::IShader::E_SHADER_STAGE type=asset::IShader::ESS_COMPUTE) -> core::smart_refctd_ptr<video::IGPUSpecializedShader>
110110
{
111-
auto glslFile = system->loadBuiltinData<decltype(uniqueString)>();
111+
auto glslFile = system->loadBuiltinData<Path>();
112112
core::smart_refctd_ptr<asset::ICPUBuffer> glsl;
113113
{
114114
glsl = core::make_smart_refctd_ptr<asset::ICPUBuffer>(glslFile->getSize());
@@ -118,11 +118,11 @@ class NBL_API ITransformTreeManager : public virtual core::IReferenceCounted
118118
return device->createSpecializedShader(shader.get(),{nullptr,nullptr,"main"});
119119
};
120120

121-
auto updateRelativeSpec = createShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/transform_tree/relative_transform_update.comp")());
122-
auto recomputeGlobalSpec = createShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/transform_tree/global_transform_update.comp")());
123-
auto recomputeGlobalAndNormalSpec = createShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/transform_tree/global_transform_and_normal_matrix_update.comp")());
124-
auto debugDrawVertexSpec = createShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/glsl/transform_tree/debug.vert")(),asset::IShader::ESS_VERTEX);
125-
auto debugDrawFragmentSpec = createShader(NBL_CORE_UNIQUE_STRING_LITERAL_TYPE("nbl/builtin/material/debug/vertex_normal/specialized_shader.frag")(),asset::IShader::ESS_FRAGMENT);
121+
auto updateRelativeSpec = createShader.operator()<core::StringLiteral("nbl/builtin/glsl/transform_tree/relative_transform_update.comp")>();
122+
auto recomputeGlobalSpec = createShader.operator()<core::StringLiteral("nbl/builtin/glsl/transform_tree/global_transform_update.comp")>();
123+
auto recomputeGlobalAndNormalSpec = createShader.operator()<core::StringLiteral("nbl/builtin/glsl/transform_tree/global_transform_and_normal_matrix_update.comp")>();
124+
auto debugDrawVertexSpec = createShader.operator()<core::StringLiteral("nbl/builtin/glsl/transform_tree/debug.vert")>(asset::IShader::ESS_VERTEX);
125+
auto debugDrawFragmentSpec = createShader.operator()<core::StringLiteral("nbl/builtin/material/debug/vertex_normal/specialized_shader.frag")>(asset::IShader::ESS_FRAGMENT);
126126
if (!updateRelativeSpec || !recomputeGlobalSpec || !recomputeGlobalAndNormalSpec || !debugDrawVertexSpec || !debugDrawFragmentSpec)
127127
return nullptr;
128128

0 commit comments

Comments
 (0)