Skip to content

Commit fc52363

Browse files
committed
Android Fixes and core::execution
1 parent 21f2290 commit fc52363

29 files changed

+154
-76
lines changed

examples_tests/0.ImportanceSamplingEnvMaps/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ int main()
269269
state.inMipLevel = 0;
270270
state.outMipLevel = 0;
271271

272-
if (!sum_filter.execute(std::execution::par_unseq, &state))
272+
if (!sum_filter.execute(core::execution::par_unseq, &state))
273273
std::cout << "SAT filter failed for some reason" << std::endl;
274274

275275
_NBL_ALIGNED_FREE(state.scratchMemory);
@@ -354,7 +354,7 @@ int main()
354354
state.inMipLevel = 0;
355355
state.outMipLevel = 0;
356356

357-
if (!sum_filter.execute(std::execution::par_unseq, &state))
357+
if (!sum_filter.execute(core::execution::par_unseq, &state))
358358
std::cout << "SAT filter failed for some reason" << std::endl;
359359

360360
_NBL_ALIGNED_FREE(state.scratchMemory);

examples_tests/39.DenoiserTonemapper/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1756,7 +1756,7 @@ nbl_glsl_complex nbl_glsl_ext_FFT_getPaddedData(ivec3 coordinate, in uint channe
17561756
state.inMipLevel = region->imageSubresource.mipLevel;
17571757
state.outMipLevel = region->imageSubresource.mipLevel;
17581758

1759-
if (!convertFilter.execute(std::execution::par_unseq,&state))
1759+
if (!convertFilter.execute(core::execution::par_unseq,&state))
17601760
os::Printer::log("WARNING (" + std::to_string(__LINE__) + " line): Something went wrong while converting the image!", ELL_WARNING);
17611761

17621762
_NBL_DELETE(state.ditherState);

examples_tests/43.SumAndCDFFilters/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ int main()
201201
state.outMipLevel = MIPMAP_IMAGE;
202202
#endif // IMAGE_VIEW
203203

204-
if (!sumFilter.execute(std::execution::par_unseq,&state))
204+
if (!sumFilter.execute(core::execution::par_unseq,&state))
205205
os::Printer::log("Something went wrong while performing sum operation!", ELL_WARNING);
206206

207207
_NBL_ALIGNED_FREE(state.scratchMemory);
@@ -301,7 +301,7 @@ int main()
301301
state.scratchMemoryByteSize = blitImageFilter.getRequiredScratchByteSize(&state);
302302
state.scratchMemory = reinterpret_cast<uint8_t*>(_NBL_ALIGNED_MALLOC(state.scratchMemoryByteSize, 32));
303303

304-
if (!blitImageFilter.execute(std::execution::par_unseq,&state))
304+
if (!blitImageFilter.execute(core::execution::par_unseq,&state))
305305
os::Printer::log("Something went wrong while performing discrete convolution operation!", ELL_WARNING);
306306

307307
_NBL_DELETE(state.ditherState);

include/nbl/asset/filters/CBasicImageFilterCommon.h

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#define __NBL_ASSET_C_BASIC_IMAGE_FILTER_COMMON_H_INCLUDED__
77

88
#include "nbl/core/declarations.h"
9+
#include "nbl/core/execution.h"
910

1011
#include <algorithm>
11-
#include <execution>
1212

1313
#include "nbl/asset/filters/IImageFilter.h"
1414

@@ -58,6 +58,17 @@ class CBasicImageFilterCommon
5858
return batchCoord;
5959
}
6060
inline pointer operator->() const {return &batchCoord;}
61+
62+
inline value_type operator[] (int index)
63+
{
64+
return nullptr;
65+
}
66+
67+
inline bool operator< (const BlockIterator<batch_dims>& _rhs) const
68+
{
69+
return false;
70+
}
71+
6172
/*
6273
inline const BlockIterator<batch_dims>& operator--()
6374
{
@@ -201,7 +212,7 @@ class CBasicImageFilterCommon
201212

202213
constexpr uint32_t batchSizeThreshold = 0x80u;
203214
const core::vectorSIMDu32 spaceFillingEnd(0u,0u,0u,trueExtent.w);
204-
if (std::is_same_v<ExecutionPolicy,std::execution::sequenced_policy> || trueExtent.x*trueExtent.y<batchSizeThreshold)
215+
if (std::is_same_v<ExecutionPolicy,core::execution::sequenced_policy> || trueExtent.x*trueExtent.y<batchSizeThreshold)
205216
{
206217
constexpr uint32_t batch_dims = 1u;
207218
BlockIterator<batch_dims> begin(trueExtent.pointer+4u-batch_dims);
@@ -226,7 +237,7 @@ class CBasicImageFilterCommon
226237
template<typename F>
227238
static inline void executePerBlock(const ICPUImage* image, const IImage::SBufferCopy& region, F& f)
228239
{
229-
executePerBlock(std::execution::seq,image,region,f);
240+
executePerBlock(core::execution::seq,image,region,f);
230241
}
231242

232243
struct default_region_functor_t
@@ -309,7 +320,7 @@ class CBasicImageFilterCommon
309320
const IImage::SBufferCopy* _end,
310321
G& g)
311322
{
312-
return executePerRegion<const std::execution::sequenced_policy&,F,G>(std::execution::seq,image,f,_begin,_end,g);
323+
return executePerRegion<const core::execution::sequenced_policy&,F,G>(core::execution::seq,image,f,_begin,_end,g);
313324
}
314325
template<typename F>
315326
static inline void executePerRegion(const ICPUImage* image, F& f,

include/nbl/asset/filters/CBlitImageFilter.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ class CBlitImageFilter : public CImageFilter<CBlitImageFilter<Swizzle,Dither,Nor
348348
texelAlpha = intermediateStorage[axis][std::distance(begin,&texelAlpha)*4u+alphaChannel];
349349
texelAlpha -= double(sampler.nextSample())*(asset::getFormatPrecision<value_type>(outFormat,alphaChannel,texelAlpha)/double(~0u));
350350
});
351-
std::nth_element(policy,begin,nth,end);
351+
core::nth_element(policy,begin,nth,end);
352352
// scale all alpha texels to work with new reference value
353353
coverageScale = alphaRefValue/(*nth);
354354
}
@@ -371,7 +371,7 @@ class CBlitImageFilter : public CImageFilter<CBlitImageFilter<Swizzle,Dither,Nor
371371
CBasicImageFilterCommon::executePerRegion(policy,outImg,scaleCoverage,outRegions.begin(),outRegions.end(),clip);
372372
};
373373
// process
374-
state->normalization.initialize<double>();
374+
state->normalization.template initialize<double>();
375375
const core::vectorSIMDf fInExtent(inExtentLayerCount);
376376
const core::vectorSIMDf fOutExtent(outExtentLayerCount);
377377
const auto fScale = fInExtent.preciseDivision(fOutExtent);
@@ -387,7 +387,7 @@ class CBlitImageFilter : public CImageFilter<CBlitImageFilter<Swizzle,Dither,Nor
387387
const auto windowMinCoord = windowMinCoordBase+vLayer;
388388
const auto outOffsetLayer = outOffsetBaseLayer+vLayer;
389389
// reset coverage counter
390-
constexpr bool is_seq_policy_v = std::is_same_v<std::remove_reference_t<ExecutionPolicy>,std::execution::sequenced_policy>;
390+
constexpr bool is_seq_policy_v = std::is_same_v<std::remove_reference_t<ExecutionPolicy>,core::execution::sequenced_policy>;
391391
using cond_atomic_int32_t = std::conditional_t<is_seq_policy_v,int32_t,std::atomic_int32_t>;
392392
using cond_atomic_uint32_t = std::conditional_t<is_seq_policy_v,uint32_t,std::atomic_uint32_t>;
393393
cond_atomic_uint32_t inv_cvg_num(0u);
@@ -495,7 +495,7 @@ class CBlitImageFilter : public CImageFilter<CBlitImageFilter<Swizzle,Dither,Nor
495495
value_type swizzledSample[MaxChannels];
496496

497497
// TODO: make sure there is no leak due to MaxChannels!
498-
base_t::onDecode(inFormat, state, srcPix, sample, swizzledSample, inBlockCoord.x, inBlockCoord.y);
498+
base_t::template onDecode(inFormat, state, srcPix, sample, swizzledSample, inBlockCoord.x, inBlockCoord.y);
499499

500500
if (nonPremultBlendSemantic)
501501
{
@@ -575,7 +575,7 @@ class CBlitImageFilter : public CImageFilter<CBlitImageFilter<Swizzle,Dither,Nor
575575
}
576576
static inline bool execute(state_type* state)
577577
{
578-
return execute(std::execution::seq,state);
578+
return execute(core::execution::seq,state);
579579
}
580580

581581
private:

include/nbl/asset/filters/CCopyImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CCopyImageFilter : public CImageFilter<CCopyImageFilter>, public CMatchedS
7676
}
7777
static inline bool execute(state_type* state)
7878
{
79-
return execute(std::execution::seq,state);
79+
return execute(core::execution::seq,state);
8080
}
8181
};
8282

include/nbl/asset/filters/CFillImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class CFillImageFilter : public CImageFilter<CFillImageFilter>
5858
}
5959
static inline bool execute(state_type* state)
6060
{
61-
return execute(std::execution::seq,state);
61+
return execute(core::execution::seq,state);
6262
}
6363
};
6464

include/nbl/asset/filters/CFlattenRegionsImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class CFlattenRegionsImageFilter : public CImageFilter<CFlattenRegionsImageFilte
164164
}
165165
static inline bool execute(state_type* state)
166166
{
167-
return execute(std::execution::seq,state);
167+
return execute(core::execution::seq,state);
168168
}
169169
};
170170

include/nbl/asset/filters/CMipMapGenerationImageFilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,15 @@ class CMipMapGenerationImageFilter : public CImageFilter<CMipMapGenerationImageF
103103
}
104104
static inline bool execute(state_type* state)
105105
{
106-
return execute(std::execution::seq,state);
106+
return execute(core::execution::seq,state);
107107
}
108108

109109
protected:
110110
static inline auto buildBlitState(const state_type* state, uint32_t inMipLevel)
111111
{
112112
const auto prevLevel = inMipLevel-1u;
113113

114-
pseudo_base_t::template state_type blit;
114+
typename pseudo_base_t::state_type blit;
115115
blit.inOffsetBaseLayer = blit.outOffsetBaseLayer = core::vectorSIMDu32(0, 0, 0, state->baseLayer);
116116
blit.inExtentLayerCount = state->inOutImage->getMipSize(prevLevel);
117117
blit.outExtentLayerCount = state->inOutImage->getMipSize(inMipLevel);

include/nbl/asset/filters/CPaddedCopyImageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ class CPaddedCopyImageFilter : public CImageFilter<CPaddedCopyImageFilter>, publ
215215
}
216216
static inline bool execute(state_type* state)
217217
{
218-
return execute(std::execution::seq,state);
218+
return execute(core::execution::seq,state);
219219
}
220220

221221
private:

0 commit comments

Comments
 (0)