@@ -1500,13 +1500,59 @@ class GetDependantVisit<ICPUPipelineLayout> : public GetDependantVisitBase<ICPUP
1500
1500
return true ;
1501
1501
}
1502
1502
};
1503
- template <Asset AssetT> requires nbl::is_any_of_v<AssetT,ICPUComputePipeline,ICPUGraphicsPipeline >
1504
- class GetDependantVisit <AssetT > : public GetDependantVisitBase<AssetT >
1503
+ template <>
1504
+ class GetDependantVisit <ICPUComputePipeline > : public GetDependantVisitBase<ICPUComputePipeline >
1505
1505
{
1506
- using base_t = GetDependantVisitBase<AssetT>;
1506
+ public:
1507
+ // using AssetType = ICPUComputePipeline;
1508
+
1509
+ inline auto & getSpecInfo (const IShader::E_SHADER_STAGE stage)
1510
+ {
1511
+ assert (hlsl::bitCount (stage)==1 );
1512
+ return specInfo[hlsl::findLSB (stage)];
1513
+ }
1514
+
1515
+ // ok to do non owning since some cache owns anyway
1516
+ IGPUPipelineLayout* layout = nullptr ;
1517
+ // has to be public to allow for initializer list constructor
1518
+ std::array<IGPUShader::SSpecInfo,/* hlsl::mpl::findMSB<ESS_COUNT>::value*/ sizeof (IShader::E_SHADER_STAGE)*8 > specInfo = {};
1507
1519
1520
+ protected:
1521
+ bool descend_impl (
1522
+ const instance_t <ICPUComputePipeline>& user, const CAssetConverter::patch_t <ICPUComputePipeline>& userPatch,
1523
+ const instance_t <ICPUPipelineLayout>& dep, const CAssetConverter::patch_t <ICPUPipelineLayout>& soloPatch
1524
+ )
1525
+ {
1526
+ auto depObj = getDependant<ICPUPipelineLayout>(dep,soloPatch);
1527
+ if (!depObj)
1528
+ return false ;
1529
+ layout = depObj.get ();
1530
+ return true ;
1531
+ }
1532
+ bool descend_impl (
1533
+ const instance_t <ICPUComputePipeline>& user, const CAssetConverter::patch_t <ICPUComputePipeline>& userPatch,
1534
+ const instance_t <ICPUShader>& dep, const CAssetConverter::patch_t <ICPUShader>& soloPatch,
1535
+ const IShader::E_SHADER_STAGE stage, const IShader::SSpecInfo<const ICPUShader>& inSpecInfo
1536
+ )
1537
+ {
1538
+ auto depObj = getDependant<ICPUShader>(dep,soloPatch);
1539
+ if (!depObj)
1540
+ return false ;
1541
+ getSpecInfo (stage) = {
1542
+ .entryPoint = inSpecInfo.entryPoint ,
1543
+ .shader = depObj.get (),
1544
+ .entries = inSpecInfo.entries ,
1545
+ .requiredSubgroupSize = inSpecInfo.requiredSubgroupSize ,
1546
+ .requireFullSubgroups = inSpecInfo.requireFullSubgroups
1547
+ };
1548
+ return true ;
1549
+ }
1550
+ };
1551
+ template <>
1552
+ class GetDependantVisit <ICPUGraphicsPipeline> : public GetDependantVisitBase<ICPUGraphicsPipeline>
1553
+ {
1508
1554
public:
1509
- using AssetType = AssetT ;
1555
+ // using AssetType = ICPUGraphicsPipeline ;
1510
1556
1511
1557
inline auto & getSpecInfo (const IShader::E_SHADER_STAGE stage)
1512
1558
{
@@ -1523,41 +1569,40 @@ class GetDependantVisit<AssetT> : public GetDependantVisitBase<AssetT>
1523
1569
1524
1570
protected:
1525
1571
bool descend_impl (
1526
- const instance_t <AssetType >& user, const CAssetConverter::patch_t <AssetType >& userPatch,
1572
+ const instance_t <ICPUGraphicsPipeline >& user, const CAssetConverter::patch_t <ICPUGraphicsPipeline >& userPatch,
1527
1573
const instance_t <ICPUPipelineLayout>& dep, const CAssetConverter::patch_t <ICPUPipelineLayout>& soloPatch
1528
1574
)
1529
1575
{
1530
- auto depObj = base_t :: getDependant<ICPUPipelineLayout>(dep,soloPatch);
1576
+ auto depObj = getDependant<ICPUPipelineLayout>(dep,soloPatch);
1531
1577
if (!depObj)
1532
1578
return false ;
1533
1579
layout = depObj.get ();
1534
1580
return true ;
1535
1581
}
1536
1582
bool descend_impl (
1537
- const instance_t <AssetType >& user, const CAssetConverter::patch_t <AssetType >& userPatch,
1583
+ const instance_t <ICPUGraphicsPipeline >& user, const CAssetConverter::patch_t <ICPUGraphicsPipeline >& userPatch,
1538
1584
const instance_t <ICPUShader>& dep, const CAssetConverter::patch_t <ICPUShader>& soloPatch,
1539
1585
const IShader::E_SHADER_STAGE stage, const IShader::SSpecInfo<const ICPUShader>& inSpecInfo
1540
1586
)
1541
1587
{
1542
- auto depObj = base_t :: getDependant<ICPUShader>(dep,soloPatch);
1588
+ auto depObj = getDependant<ICPUShader>(dep,soloPatch);
1543
1589
if (!depObj)
1544
1590
return false ;
1545
1591
getSpecInfo (stage) = {
1546
1592
.entryPoint = inSpecInfo.entryPoint ,
1547
1593
.shader = depObj.get (),
1548
1594
.entries = inSpecInfo.entries ,
1549
1595
.requiredSubgroupSize = inSpecInfo.requiredSubgroupSize ,
1550
- .requireFullSubgroups = stage==IShader::E_SHADER_STAGE::ESS_COMPUTE ? inSpecInfo. requireFullSubgroups : uint8_t ( 0 )
1596
+ .requireFullSubgroups = 0
1551
1597
};
1552
1598
return true ;
1553
1599
}
1554
- template <Asset T=AssetType> requires (std::is_same_v<T,AssetType>&& std::is_same_v<T,ICPUGraphicsPipeline>)
1555
1600
bool descend_impl (
1556
- const instance_t <T >& user, const CAssetConverter::patch_t <T >& userPatch,
1601
+ const instance_t <ICPUGraphicsPipeline >& user, const CAssetConverter::patch_t <ICPUGraphicsPipeline >& userPatch,
1557
1602
const instance_t <ICPURenderpass>& dep, const CAssetConverter::patch_t <ICPURenderpass>& soloPatch
1558
1603
)
1559
1604
{
1560
- auto depObj = base_t :: getDependant<ICPURenderpass>(dep,soloPatch);
1605
+ auto depObj = getDependant<ICPURenderpass>(dep,soloPatch);
1561
1606
if (!depObj)
1562
1607
return false ;
1563
1608
renderpass = depObj.get ();
0 commit comments