Skip to content

Commit 1e9c170

Browse files
fix crashbug when converting specialized shaders and link error on DLL builds of ICommandPoolCache
1 parent e700683 commit 1e9c170

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

include/nbl/video/utilities/ICommandPoolCache.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ class ICommandPoolCache : public core::IReferenceCounted
2121
public:
2222
using CommandPoolAllocator = core::PoolAddressAllocatorST<uint32_t>;
2323

24-
ICommandPoolCache(ILogicalDevice* device, const uint32_t queueFamilyIx, const IGPUCommandPool::E_CREATE_FLAGS _flags, const uint32_t capacity);
24+
NBL_API2 ICommandPoolCache(ILogicalDevice* device, const uint32_t queueFamilyIx, const IGPUCommandPool::E_CREATE_FLAGS _flags, const uint32_t capacity);
2525

2626
//
2727
inline uint32_t getCapacity() const {return m_cmdPoolAllocator.get_total_size();}
2828

2929
//
3030
constexpr static inline auto invalid_index = CommandPoolAllocator::invalid_address;
31-
IGPUCommandPool* getPool(uint32_t poolIx)
31+
inline IGPUCommandPool* getPool(uint32_t poolIx)
3232
{
3333
if (poolIx<getCapacity())
3434
return m_cache[poolIx].get();
@@ -71,7 +71,7 @@ class ICommandPoolCache : public core::IReferenceCounted
7171
{
7272
}
7373
DeferredCommandPoolResetter(const DeferredCommandPoolResetter& other) = delete;
74-
DeferredCommandPoolResetter(DeferredCommandPoolResetter&& other) : m_cache(nullptr), m_poolIx(CommandPoolAllocator::invalid_address)
74+
inline DeferredCommandPoolResetter(DeferredCommandPoolResetter&& other) : m_cache(nullptr), m_poolIx(CommandPoolAllocator::invalid_address)
7575
{
7676
this->operator=(std::forward<DeferredCommandPoolResetter>(other));
7777
}
@@ -106,19 +106,19 @@ class ICommandPoolCache : public core::IReferenceCounted
106106
return false;
107107
}
108108

109-
void operator()();
109+
NBL_API2 void operator()();
110110
};
111111

112112
protected:
113113
friend class DeferredCommandPoolResetter;
114-
virtual ~ICommandPoolCache()
114+
inline virtual ~ICommandPoolCache()
115115
{
116116
m_deferredResets.cullEvents(0u);
117117
free(m_reserved);
118118
delete[] m_cache;
119119
}
120120

121-
void releaseSet(const uint32_t poolIx);
121+
NBL_API2 void releaseSet(const uint32_t poolIx);
122122

123123
core::smart_refctd_ptr<IGPUCommandPool>* m_cache;
124124
void* m_reserved;

include/nbl/video/utilities/IGPUObjectFromAssetConverter.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1490,8 +1490,9 @@ auto IGPUObjectFromAssetConverter::create(const asset::ICPUSpecializedShader** c
14901490

14911491
for (ptrdiff_t i = 0; i < assetCount; ++i)
14921492
{
1493-
auto a = gpuDeps->operator[](redirs[i]);
1494-
res->operator[](i) = _params.device->createSpecializedShader(gpuDeps->operator[](redirs[i]).get(), _begin[i]->getSpecializationInfo());
1493+
auto unspecShader = gpuDeps->operator[](redirs[i]);
1494+
if (unspecShader)
1495+
res->operator[](i) = _params.device->createSpecializedShader(unspecShader.get(), _begin[i]->getSpecializationInfo());
14951496
}
14961497

14971498
return res;

0 commit comments

Comments
 (0)