Skip to content

Commit 2b1701a

Browse files
committed
Resolved conflicts, merged master
2 parents 75d5e6b + 72bd107 commit 2b1701a

File tree

164 files changed

+208948
-239029
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+208948
-239029
lines changed

include/nbl/asset/ICPUSampler.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ class ICPUSampler : public ISampler, public IAsset
3737
};
3838
switch (wrapModes[i])
3939
{
40-
case ISampler::ETC_REPEAT:
40+
case ISampler::E_TEXTURE_CLAMP::ETC_REPEAT:
4141
repeat();
4242
break;
43-
case ISampler::ETC_CLAMP_TO_EDGE:
44-
texelCoord[i] = core::clamp<int32_t,int32_t>(texelCoord[i],0,mipLastCoord[i]);
43+
case ISampler::E_TEXTURE_CLAMP::ETC_CLAMP_TO_EDGE:
44+
texelCoord[i] = core::clamp<int32_t, int32_t>(texelCoord[i], 0, mipLastCoord[i]);
4545
break;
46-
case ISampler::ETC_MIRROR_CLAMP_TO_EDGE:
47-
texelCoord[i] = core::clamp<int32_t,int32_t>(texelCoord[i],-int32_t(mipExtent[i]),mipExtent[i]+mipLastCoord[i]);
46+
case ISampler::E_TEXTURE_CLAMP::ETC_MIRROR_CLAMP_TO_EDGE:
47+
texelCoord[i] = core::clamp<int32_t, int32_t>(texelCoord[i], -int32_t(mipExtent[i]), mipExtent[i] + mipLastCoord[i]);
4848
[[fallthrough]];
49-
case ISampler::ETC_MIRROR:
49+
case ISampler::E_TEXTURE_CLAMP::ETC_MIRROR:
5050
{
5151
int32_t repeatID = (originalWasNegative+texelCoord[i])/int32_t(mipExtent[i]);
5252
repeat();

include/nbl/asset/ISampler.h

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#define __NBL_ASSET_I_SAMPLER_H_INCLUDED__
77

88
#include "nbl/asset/IDescriptor.h"
9+
#include "nbl/builtin/hlsl/enums.hlsl"
910

1011
namespace nbl
1112
{
@@ -16,23 +17,7 @@ class ISampler : public IDescriptor
1617
{
1718
public:
1819
//! Texture coord clamp mode outside [0.0, 1.0]
19-
enum E_TEXTURE_CLAMP
20-
{
21-
//! Texture repeats
22-
ETC_REPEAT = 0,
23-
//! Texture is clamped to the edge pixel
24-
ETC_CLAMP_TO_EDGE,
25-
//! Texture is clamped to the border pixel (if exists)
26-
ETC_CLAMP_TO_BORDER,
27-
//! Texture is alternatingly mirrored (0..1..0..1..0..)
28-
ETC_MIRROR,
29-
//! Texture is mirrored once and then clamped to edge
30-
ETC_MIRROR_CLAMP_TO_EDGE,
31-
//! Texture is mirrored once and then clamped to border
32-
ETC_MIRROR_CLAMP_TO_BORDER,
33-
34-
ETC_COUNT
35-
};
20+
using E_TEXTURE_CLAMP = hlsl::TextureClamp;
3621

3722
enum E_TEXTURE_BORDER_COLOR
3823
{
@@ -75,11 +60,11 @@ class ISampler : public IDescriptor
7560
{
7661
struct {
7762
//! Valeus taken from E_TEXTURE_CLAMP
78-
uint32_t TextureWrapU : 3 = ETC_REPEAT;
63+
uint32_t TextureWrapU : 3 = E_TEXTURE_CLAMP::ETC_REPEAT;
7964
//! Valeus taken from E_TEXTURE_CLAMP
80-
uint32_t TextureWrapV : 3 = ETC_REPEAT;
65+
uint32_t TextureWrapV : 3 = E_TEXTURE_CLAMP::ETC_REPEAT;
8166
//! Valeus taken from E_TEXTURE_CLAMP
82-
uint32_t TextureWrapW : 3 = ETC_REPEAT;
67+
uint32_t TextureWrapW : 3 = E_TEXTURE_CLAMP::ETC_REPEAT;
8368
//! Values taken from E_TEXTURE_BORDER_COLOR
8469
uint32_t BorderColor : 3 = ETBC_FLOAT_OPAQUE_BLACK;
8570
//! Values taken from E_TEXTURE_FILTER

include/nbl/asset/filters/CBlitImageFilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class CBlitImageFilterBase : public impl::CSwizzleableAndDitherableFilterBase<Sw
3434
uint8_t* scratchMemory = nullptr;
3535
uint32_t scratchMemoryByteSize = 0u;
3636
_NBL_STATIC_INLINE_CONSTEXPR auto NumWrapAxes = 3;
37-
ISampler::E_TEXTURE_CLAMP axisWraps[NumWrapAxes] = { ISampler::ETC_REPEAT,ISampler::ETC_REPEAT,ISampler::ETC_REPEAT };
37+
ISampler::E_TEXTURE_CLAMP axisWraps[NumWrapAxes] = { ISampler::E_TEXTURE_CLAMP::ETC_REPEAT,ISampler::E_TEXTURE_CLAMP::ETC_REPEAT,ISampler::E_TEXTURE_CLAMP::ETC_REPEAT };
3838
ISampler::E_TEXTURE_BORDER_COLOR borderColor = ISampler::ETBC_FLOAT_TRANSPARENT_BLACK;
3939
IBlitUtilities::E_ALPHA_SEMANTIC alphaSemantic = IBlitUtilities::EAS_NONE_OR_PREMULTIPLIED;
4040
double alphaRefValue = 0.5; // only required to make sense if `alphaSemantic==EAS_REFERENCE_OR_COVERAGE`
@@ -56,7 +56,7 @@ class CBlitImageFilterBase : public impl::CSwizzleableAndDitherableFilterBase<Sw
5656
return false;
5757

5858
for (auto i=0; i<CStateBase::NumWrapAxes; i++)
59-
if (state->axisWraps[i]>=ISampler::ETC_COUNT)
59+
if (state->axisWraps[i]>=ISampler::E_TEXTURE_CLAMP::ETC_COUNT)
6060
return false;
6161

6262
if (state->borderColor>=ISampler::ETBC_COUNT)

include/nbl/asset/filters/CPaddedCopyImageFilter.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class CPaddedCopyImageFilter : public CImageFilter<CPaddedCopyImageFilter>, publ
3030
virtual ~CState() {}
3131

3232
_NBL_STATIC_INLINE_CONSTEXPR auto NumWrapAxes = 3;
33-
ISampler::E_TEXTURE_CLAMP axisWraps[NumWrapAxes] = {ISampler::ETC_REPEAT,ISampler::ETC_REPEAT,ISampler::ETC_REPEAT};
33+
ISampler::E_TEXTURE_CLAMP axisWraps[NumWrapAxes] = {ISampler::E_TEXTURE_CLAMP::ETC_REPEAT,ISampler::E_TEXTURE_CLAMP::ETC_REPEAT,ISampler::E_TEXTURE_CLAMP::ETC_REPEAT};
3434
ISampler::E_TEXTURE_BORDER_COLOR borderColor;
3535
VkOffset3D relativeOffset;
3636
VkExtent3D paddedExtent;
@@ -57,7 +57,7 @@ class CPaddedCopyImageFilter : public CImageFilter<CPaddedCopyImageFilter>, publ
5757
// TODO: eventually remove when we can encode blocks
5858
for (auto i=0; i<CState::NumWrapAxes; i++)
5959
{
60-
if ((isBlockCompressionFormat(inFormat)||isBlockCompressionFormat(outFormat))&&state->axisWraps[i]!=ISampler::ETC_REPEAT)
60+
if ((isBlockCompressionFormat(inFormat)||isBlockCompressionFormat(outFormat))&&state->axisWraps[i]!=ISampler::E_TEXTURE_CLAMP::ETC_REPEAT)
6161
return false;
6262
}
6363

include/nbl/builtin/hlsl/concepts/accessors/fft.hlsl

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ NBL_CONCEPT_END(
4242
// * void get(uint32_t index, inout complex_t<Scalar> value);
4343
// * void set(uint32_t index, in complex_t<Scalar> value);
4444

45-
#define NBL_CONCEPT_NAME SmallFFTAccessor
45+
#define NBL_CONCEPT_NAME FFTAccessor
4646
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)(typename)
4747
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)(Scalar)
4848
#define NBL_CONCEPT_PARAM_0 (accessor, T)
@@ -53,32 +53,14 @@ NBL_CONCEPT_BEGIN(3)
5353
#define index NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_1
5454
#define val NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_2
5555
NBL_CONCEPT_END(
56-
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((accessor.set(index, val)), is_same_v, void))
57-
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((accessor.get(index, val)), is_same_v, void))
56+
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((accessor.template set<complex_t<Scalar> >(index, val)), is_same_v, void))
57+
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((accessor.template get<complex_t<Scalar> >(index, val)), is_same_v, void))
5858
);
5959
#undef val
6060
#undef index
6161
#undef accessor
6262
#include <nbl/builtin/hlsl/concepts/__end.hlsl>
6363

64-
65-
// The Accessor MUST provide the following methods:
66-
// * void get(uint32_t index, inout complex_t<Scalar> value);
67-
// * void set(uint32_t index, in complex_t<Scalar> value);
68-
// * void memoryBarrier();
69-
70-
#define NBL_CONCEPT_NAME FFTAccessor
71-
#define NBL_CONCEPT_TPLT_PRM_KINDS (typename)(typename)
72-
#define NBL_CONCEPT_TPLT_PRM_NAMES (T)(Scalar)
73-
#define NBL_CONCEPT_PARAM_0 (accessor, T)
74-
NBL_CONCEPT_BEGIN(1)
75-
#define accessor NBL_CONCEPT_PARAM_T NBL_CONCEPT_PARAM_0
76-
NBL_CONCEPT_END(
77-
((NBL_CONCEPT_REQ_EXPR_RET_TYPE)((accessor.memoryBarrier()), is_same_v, void))
78-
) && SmallFFTAccessor<T, Scalar>;
79-
#undef accessor
80-
#include <nbl/builtin/hlsl/concepts/__end.hlsl>
81-
8264
}
8365
}
8466
}

include/nbl/builtin/hlsl/enums.hlsl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,22 @@ enum ShaderStage : uint32_t
3232
ESS_ALL = 0x7fffffff
3333
};
3434

35+
enum TextureClamp : uint16_t
36+
{
37+
//! Texture repeats
38+
ETC_REPEAT = 0,
39+
//! Texture is clamped to the edge pixel
40+
ETC_CLAMP_TO_EDGE,
41+
//! Texture is clamped to the border pixel (if exists)
42+
ETC_CLAMP_TO_BORDER,
43+
//! Texture is alternatingly mirrored (0..1..0..1..0..)
44+
ETC_MIRROR,
45+
//! Texture is mirrored once and then clamped to edge
46+
ETC_MIRROR_CLAMP_TO_EDGE,
47+
48+
ETC_COUNT
49+
};
50+
3551
enum SampleCountFlags : uint16_t
3652
{
3753
ESCF_1_BIT = 0x01,

0 commit comments

Comments
 (0)