Skip to content

Commit d8bbc00

Browse files
committed
Merge branch 'baw' into erfan_todos
2 parents 6c2cdea + 79a03d3 commit d8bbc00

37 files changed

+224
-242
lines changed

examples_tests/common/CommonAPI.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class CommonAPI
608608
bool hasSparseBindingFlag = (familyProperty.queueFlags & IPhysicalDevice::EQF_SPARSE_BINDING_BIT).value != 0;
609609
bool hasProtectedFlag = (familyProperty.queueFlags & IPhysicalDevice::EQF_PROTECTED_BIT).value != 0;
610610

611-
const uint32_t extraQueueCount = core::min(remainingQueueCounts[familyIndex], 2u); // UP + DOWN
611+
const uint32_t extraQueueCount = nbl::core::min(remainingQueueCounts[familyIndex], 2u); // UP + DOWN
612612
const bool hasExtraQueues = extraQueueCount >= 1u;
613613

614614
/*
@@ -1459,12 +1459,12 @@ class CommonAPI
14591459
else
14601460
imageSharingMode = asset::ESM_CONCURRENT;
14611461

1462-
video::ISurface::SFormat surfaceFormat;
1462+
nbl::video::ISurface::SFormat surfaceFormat;
14631463

14641464
if(api_type == nbl::video::EAT_VULKAN)
14651465
{
14661466
// Deduce format features from imageUsage param
1467-
video::IPhysicalDevice::SFormatImageUsage requiredFormatUsages = {};
1467+
nbl::video::IPhysicalDevice::SFormatImageUsage requiredFormatUsages = {};
14681468
if (imageUsage & asset::IImage::EUF_STORAGE_BIT)
14691469
requiredFormatUsages.storageImage = 1;
14701470

@@ -1561,8 +1561,8 @@ class CommonAPI
15611561
sc_params.imageUsage = imageUsage;
15621562
sc_params.surface = surface;
15631563
sc_params.imageSharingMode = imageSharingMode;
1564-
sc_params.preTransform = video::ISurface::EST_IDENTITY_BIT;
1565-
sc_params.compositeAlpha = video::ISurface::ECA_OPAQUE_BIT;
1564+
sc_params.preTransform = nbl::video::ISurface::EST_IDENTITY_BIT;
1565+
sc_params.compositeAlpha = nbl::video::ISurface::ECA_OPAQUE_BIT;
15661566
sc_params.surfaceFormat = surfaceFormat;
15671567

15681568
auto swapchain = device->createSwapchain(std::move(sc_params));
@@ -1636,7 +1636,7 @@ class CommonAPI
16361636
{
16371637
using namespace nbl;
16381638
bool useDepth = asset::isDepthOrStencilFormat(depthFormat);
1639-
std::array<nbl::core::smart_refctd_ptr<video::IGPUFramebuffer>, InitOutput::MaxSwapChainImageCount> fbo;
1639+
std::array<nbl::core::smart_refctd_ptr<nbl::video::IGPUFramebuffer>, InitOutput::MaxSwapChainImageCount> fbo;
16401640
auto sc_images = swapchain->getImages();
16411641
assert(sc_images.size() == imageCount);
16421642
for (uint32_t i = 0u; i < imageCount; ++i)
@@ -1716,10 +1716,10 @@ class CommonAPI
17161716
{
17171717
submit.commandBufferCount = 1u;
17181718
submit.commandBuffers = &cmdbuf;
1719-
video::IGPUSemaphore* signalsem = renderFinishedSemaphore;
1719+
nbl::video::IGPUSemaphore* signalsem = renderFinishedSemaphore;
17201720
submit.signalSemaphoreCount = waitSemaphore ? 1u:0u;
17211721
submit.pSignalSemaphores = &signalsem;
1722-
video::IGPUSemaphore* waitsem = waitSemaphore;
1722+
nbl::video::IGPUSemaphore* waitsem = waitSemaphore;
17231723
asset::E_PIPELINE_STAGE_FLAGS dstWait = waitDstStageMask.value;
17241724
submit.waitSemaphoreCount = 1u;
17251725
submit.pWaitSemaphores = &waitsem;

include/nbl/asset/IAssetManager.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ class IAssetManager : public core::IReferenceCounted, public core::QuitSignallin
654654
if (file) // could fail creating file (lack of permissions)
655655
{
656656
bool res = writeAsset(file.get(), _params, _override);
657-
file->drop();
658657
return res;
659658
}
660659
else

include/nbl/asset/filters/CBasicImageFilterCommon.h

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class CBasicImageFilterCommon
2626
public:
2727
using iterator_category = std::random_access_iterator_tag;
2828
using difference_type = int64_t;
29-
using value_type = const uint32_t*;
29+
using value_type = std::array<uint32_t,batch_dims>;
3030
using pointer = const value_type*;
3131
using reference = value_type;
3232

@@ -35,17 +35,17 @@ class CBasicImageFilterCommon
3535
BlockIterator()
3636
{
3737
std::fill_n(extentBatches,batch_dims,0u);
38-
std::fill_n(batchCoord,batch_dims,0u);
38+
std::fill_n(batchCoord.begin(),batch_dims,0u);
3939
}
4040
explicit inline BlockIterator(const uint32_t* _extentBatches)
4141
{
4242
std::copy_n(_extentBatches,batch_dims,extentBatches);
43-
std::fill_n(batchCoord,batch_dims,0u);
43+
std::fill_n(batchCoord.begin(),batch_dims,0u);
4444
}
4545
explicit inline BlockIterator(const uint32_t* _extentBatches, const uint32_t* _batchCoord)
4646
{
4747
std::copy_n(_extentBatches,batch_dims,extentBatches);
48-
std::copy_n(_batchCoord,batch_dims,batchCoord);
48+
std::copy_n(_batchCoord,batch_dims,batchCoord.begin());
4949
}
5050
BlockIterator(const BlockIterator<batch_dims>& other) = default;
5151
BlockIterator(BlockIterator<batch_dims>&& other) = default;
@@ -59,11 +59,9 @@ class CBasicImageFilterCommon
5959
}
6060
inline pointer operator->() const {return &batchCoord;}
6161

62-
inline value_type operator[] (int index)
62+
inline value_type operator[] (int index) const
6363
{
64-
BlockIterator<batch_dims> temp = BlockIterator<batch_dims>(this->extentBatches);
65-
temp+=index;
66-
return *temp;
64+
return *(operator+(index));
6765
}
6866

6967
inline bool operator< (const BlockIterator<batch_dims>& _rhs) const
@@ -108,7 +106,7 @@ class CBasicImageFilterCommon
108106
return copy;
109107
}
110108

111-
inline bool operator==(const BlockIterator<batch_dims>& other) const {return std::equal(batchCoord,batchCoord+batch_dims,other.batchCoord);}
109+
inline bool operator==(const BlockIterator<batch_dims>& other) const {return std::equal(batchCoord.begin(),batchCoord.end(),other.batchCoord.begin());}
112110
inline bool operator!=(const BlockIterator<batch_dims>& other) const {return !operator==(other);}
113111

114112
inline BlockIterator<batch_dims>& operator+=(const difference_type advance)
@@ -134,7 +132,7 @@ class CBasicImageFilterCommon
134132
inline const uint32_t* getExtentBatches() const {return extentBatches;}
135133
private:
136134
uint32_t extentBatches[batch_dims];
137-
uint32_t batchCoord[batch_dims];
135+
value_type batchCoord;
138136

139137

140138
explicit inline BlockIterator(const uint32_t* _extentBatches, difference_type linearAddress)
@@ -184,15 +182,15 @@ class CBasicImageFilterCommon
184182

185183
const auto strides = region.getByteStrides(blockInfo);
186184

187-
auto batch1D = [&f,&region,trueExtent,strides,trueOffset](const uint32_t* batchCoord)
185+
auto batch1D = [&f,&region,trueExtent,strides,trueOffset](const std::array<uint32_t,3u>& batchCoord)
188186
{
189187
for (auto xBlock=0u; xBlock<trueExtent.x; ++xBlock)
190188
{
191189
const core::vectorSIMDu32 localCoord(xBlock,batchCoord[0],batchCoord[1],batchCoord[2]);
192190
f(region.getByteOffset(localCoord,strides),localCoord+trueOffset);
193191
}
194192
};
195-
auto batch2D = [&f,&region,trueExtent,strides,trueOffset](const uint32_t* batchCoord)
193+
auto batch2D = [&f,&region,trueExtent,strides,trueOffset](const std::array<uint32_t,2u>& batchCoord)
196194
{
197195
for (auto yBlock=0u; yBlock<trueExtent.y; ++yBlock)
198196
for (auto xBlock=0u; xBlock<trueExtent.x; ++xBlock)
@@ -201,7 +199,7 @@ class CBasicImageFilterCommon
201199
f(region.getByteOffset(localCoord,strides),localCoord+trueOffset);
202200
}
203201
};
204-
auto batch3D = [&f,&region,trueExtent,strides,trueOffset](const uint32_t* batchCoord)
202+
auto batch3D = [&f,&region,trueExtent,strides,trueOffset](const std::array<uint32_t,1u>& batchCoord)
205203
{
206204
for (auto zBlock=0u; zBlock<trueExtent.z; ++zBlock)
207205
for (auto yBlock=0u; yBlock<trueExtent.y; ++yBlock)

include/nbl/asset/filters/CBlitImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,7 @@ class CBlitImageFilter : public CImageFilter<CBlitImageFilter<Swizzle,Dither,Nor
461461
CBasicImageFilterCommon::BlockIterator<batch_dims> begin(batchExtent);
462462
const uint32_t spaceFillingEnd[batch_dims] = {0u,batchExtent[1]};
463463
CBasicImageFilterCommon::BlockIterator<batch_dims> end(begin.getExtentBatches(),spaceFillingEnd);
464-
std::for_each(policy,begin,end,[&](const uint32_t* batchCoord) -> void
464+
std::for_each(policy,begin,end,[&](const std::array<uint32_t,batch_dims>& batchCoord) -> void
465465
{
466466
// we need some tmp memory for threads in the first pass so that they dont step on each other
467467
uint32_t decode_offset;

include/nbl/core/math/glslFunctions.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ class matrix3x4SIMD;
2828
template<typename T>
2929
NBL_FORCE_INLINE T radians(const T& degrees)
3030
{
31-
static_assert(
32-
std::is_same<T, float>::value ||
33-
std::is_same<T, double>::value ||
34-
std::is_same<T, vectorSIMDf>::value,
35-
"This code expects the type to be double, float or vectorSIMDf, only (float, double, vectorSIMDf).");
31+
//static_assert(
32+
// std::is_same<T, float>::value ||
33+
// std::is_same<T, double>::value ||
34+
// std::is_same<T, vectorSIMDf>::value,
35+
// "This code expects the type to be double, float or vectorSIMDf, only (float, double, vectorSIMDf).");
3636

3737
return degrees*PI<T>()/T(180);
3838
}
File renamed without changes.

include/nbl/video/IGPUQueue.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ class IGPUQueue : public core::Interface, public core::Unmovable
9696
if(cmdbuf == nullptr)
9797
return false;
9898

99-
if(cmdbuf->isResettable())
100-
cmdbuf->setState(IGPUCommandBuffer::ES_INVALID);
101-
else
99+
if (cmdbuf->isResettable())
102100
cmdbuf->setState(IGPUCommandBuffer::ES_EXECUTABLE);
101+
else
102+
cmdbuf->setState(IGPUCommandBuffer::ES_INVALID);
103103
}
104104
}
105105
return true;

include/nbl/video/declarations.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// platform and API specific stuff
2424
#include "nbl/video/COpenGL_Connection.h"
2525
#include "nbl/video/CVulkanConnection.h"
26-
#include "nbl/video/surface/ISurfaceGL.h"
26+
#include "nbl/video/surface/CSurfaceGL.h"
2727
#include "nbl/video/surface/CSurfaceVulkan.h"
2828

2929
// utilities

include/nbl/video/surface/ISurfaceGL.h renamed to include/nbl/video/surface/CSurfaceGL.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class CSurfaceGLImpl : public Base<Window>
2424
{
2525
if (!api || !window)
2626
return nullptr;
27-
auto retval = new this_t(std::move(api),std::move(window));
27+
auto retval = new this_t(std::move(window), std::move(api));
2828
return core::smart_refctd_ptr<this_t>(retval,core::dont_grab);
2929
}
3030
template<video::E_API_TYPE API_TYPE>

0 commit comments

Comments
 (0)