Skip to content

Commit b8a4bdd

Browse files
authored
Merge pull request #566 from Devsh-Graphics-Programming/give_credit_new
Give credit new
2 parents 0f44f7c + 5190699 commit b8a4bdd

36 files changed

+1342
-1287
lines changed

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ if(NOT CMAKE_BUILD_TYPE)
9797
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type: Debug or Release" FORCE)
9898
endif()
9999

100+
option(_NBL_MEMORY_CONSUMPTION_CHECK_SKIP_ "Turn it ON to bypass memory consumption test given _NBL_JOBS_AMOUNT_. Be aware you are doing it on your own risk of potential build failures!" OFF)
101+
100102
include(ProcessorCount)
101103
if(NOT DEFINED _NBL_JOBS_AMOUNT_)
102104
ProcessorCount(_NBL_JOBS_AMOUNT_)
@@ -111,17 +113,25 @@ cmake_host_system_information(RESULT _NBL_AVAILABLE_PHYSICAL_MEMORY_ QUERY AVAIL
111113
if(NBL_CI_MODE)
112114
math(EXPR _CI_NBL_JOBS_AMOUNT_ "(${_NBL_AVAILABLE_PHYSICAL_MEMORY_} - 512)/(2*1024)") # override with safe bias, respect memory and don't take more then max processors we have
113115
if(_CI_NBL_JOBS_AMOUNT_ LESS _NBL_JOBS_AMOUNT_)
116+
message(WARNING "Overriding _NBL_JOBS_AMOUNT_: \"${_NBL_JOBS_AMOUNT_}\" with \"${_CI_NBL_JOBS_AMOUNT_}\"")
117+
114118
set(_NBL_JOBS_AMOUNT_ "${_CI_NBL_JOBS_AMOUNT_}")
115119
endif()
116120
endif()
117121

122+
set(_NBL_JOBS_AMOUNT_ "${_NBL_JOBS_AMOUNT_}" CACHE STRING "Max jobs amount for the build to be invoked" FORCE)
123+
118124
math(EXPR _NBL_DEBUG_MEMORY_CONSUPTION_WITH_ALL_JOBS_ "${_NBL_JOBS_AMOUNT_}*2*1024") # MB
119125
math(EXPR _NBL_CURRENTLY_USED_PHYSICAL_MEMORY_ "${_NBL_TOTAL_PHYSICAL_MEMORY_}-${_NBL_AVAILABLE_PHYSICAL_MEMORY_}") # MB
120126

121127
if(_NBL_AVAILABLE_PHYSICAL_MEMORY_ LESS_EQUAL _NBL_DEBUG_MEMORY_CONSUPTION_WITH_ALL_JOBS_) # TODO: we may also add Release and RWDI checks as well
122-
if(NOT DEFINED _NBL_MEMORY_CONSUMPTION_CHECK_SKIP_)
123-
message(FATAL_ERROR "Memory consumption issue detected! To protect you from compile and linker errors, please read this message.\n\nYour total physical memory is ${_NBL_TOTAL_PHYSICAL_MEMORY_} MBs, your OS is currently using ${_NBL_CURRENTLY_USED_PHYSICAL_MEMORY_} MBs and consumption of your memory with requested ${_NBL_JOBS_AMOUNT_} jobs in Debug configuration may be around ${_NBL_DEBUG_MEMORY_CONSUPTION_WITH_ALL_JOBS_} MBs. Please override '_NBL_JOBS_AMOUNT_' variable by setting it as cache variable and lower the jobs! If you want to continue anyway, please define '_NBL_MEMORY_CONSUMPTION_CHECK_SKIP_' but be aware - you are doing it on your own risk of possible build failures.")
128+
if(_NBL_MEMORY_CONSUMPTION_CHECK_SKIP_)
129+
set(_NBL_CMAKE_STATUS_ WARNING)
130+
else()
131+
set(_NBL_CMAKE_STATUS_ FATAL_ERROR)
124132
endif()
133+
134+
message(${_NBL_CMAKE_STATUS_} "Memory consumption issue detected! To protect you from compile and linker errors, please read this message.\n\nYour total physical memory is ${_NBL_TOTAL_PHYSICAL_MEMORY_} MBs, your OS is currently using ${_NBL_CURRENTLY_USED_PHYSICAL_MEMORY_} MBs and consumption of your memory with requested ${_NBL_JOBS_AMOUNT_} jobs in Debug configuration may be around ${_NBL_DEBUG_MEMORY_CONSUPTION_WITH_ALL_JOBS_} MBs. Please override '_NBL_JOBS_AMOUNT_' variable by setting it as cache variable and lower the jobs! If you want to continue anyway, please define '_NBL_MEMORY_CONSUMPTION_CHECK_SKIP_' but be aware - you are doing it on your own risk of possible build failures.")
125135
endif()
126136

127137
macro(nbl_adjust_flags)

examples_tests

Submodule examples_tests updated 108 files

include/nbl/builtin/glsl/colorspace/decodeCIEXYZ.glsl

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,36 @@
55
#ifndef _NBL_BUILTIN_GLSL_COLOR_SPACE_DECODE_CIE_XYZ_INCLUDED_
66
#define _NBL_BUILTIN_GLSL_COLOR_SPACE_DECODE_CIE_XYZ_INCLUDED_
77

8-
const mat3 nbl_glsl_XYZtoscRGB = mat3( vec3( 3.2404542,-0.9692660, 0.0556434),
9-
vec3(-1.5371385, 1.8760108,-0.2040259),
10-
vec3(-0.4985314, 0.0415560, 1.0572252));
8+
const mat3 nbl_glsl_XYZtoscRGB = mat3(
9+
vec3( 3.240970f, -0.969244f, 0.055630f),
10+
vec3(-1.537383f, 1.875968f, -0.203977f),
11+
vec3(-0.498611f, 0.041555f, 1.056972f)
12+
);
1113

1214
const mat3 nbl_glsl_XYZtosRGB = nbl_glsl_XYZtoscRGB;
1315

1416
const mat3 nbl_glsl_XYZtoBT709 = nbl_glsl_XYZtoscRGB;
1517

1618

17-
const mat3 nbl_glsl_XYZtoDisplay_P3 = mat3( vec3( 2.4934969,-0.8294890, 0.0358458),
18-
vec3(-0.9313836, 1.7626641,-0.0761724),
19-
vec3(-0.4027108, 0.0236247, 0.9568845));
19+
const mat3 nbl_glsl_XYZtoDisplay_P3 = mat3(
20+
vec3( 2.4934969119f,-0.8294889696f, 0.0358458302f),
21+
vec3(-0.9313836179f, 1.7626640603f,-0.0761723893f),
22+
vec3(-0.4027107845f, 0.0236246858f, 0.9568845240f)
23+
);
2024

2125

22-
const mat3 nbl_glsl_XYZtoDCI_P3 = mat3(vec3(1.0,0.0,0.0),vec3(0.0,1.0,0.0),vec3(0.0,0.0,1.0));
26+
const mat3 nbl_glsl_XYZtoDCI_P3 = mat3(
27+
vec3(1.0f,0.0f,0.0f),
28+
vec3(0.0f,1.0f,0.0f),
29+
vec3(0.0f,0.0f,1.0f)
30+
);
2331

2432

25-
const mat3 nbl_glsl_XYZtoBT2020 = mat3( vec3( 1.7166512,-0.6666844, 0.0176399),
26-
vec3(-0.3556708, 1.6164812,-0.0427706),
27-
vec3(-0.2533663, 0.0157685, 0.9421031));
33+
const mat3 nbl_glsl_XYZtoBT2020 = mat3(
34+
vec3( 1.716651f,-0.666684f, 0.017640f),
35+
vec3(-0.355671f, 1.616481f,-0.042771f),
36+
vec3(-0.253366f, 0.015769f, 0.942103f)
37+
);
2838

2939
const mat3 nbl_glsl_XYZtoHDR10_ST2084 = nbl_glsl_XYZtoBT2020;
3040

@@ -33,19 +43,25 @@ const mat3 nbl_glsl_XYZtoDOLBYIVISION = nbl_glsl_XYZtoBT2020;
3343
const mat3 nbl_glsl_XYZtoHDR10_HLG = nbl_glsl_XYZtoBT2020;
3444

3545

36-
const mat3 nbl_glsl_XYZtoAdobeRGB = mat3( vec3( 2.04159,-0.96924, 0.01344),
37-
vec3(-0.56501, 1.87597,-0.11836),
38-
vec3(-0.34473, 0.04156, 1.01517));
46+
const mat3 nbl_glsl_XYZtoAdobeRGB = mat3(
47+
vec3( 2.0415879038f,-0.9692436363f, 0.0134442806f),
48+
vec3(-0.5650069743f, 1.8759675015f,-0.1183623922f),
49+
vec3(-0.3447313508f, 0.0415550574f, 1.0151749944f)
50+
);
3951

4052

41-
const mat3 nbl_glsl_XYZtoACES2065_1 = mat3( vec3( 1.0498110175, 0.0000000000,-0.0000974845),
42-
vec3(-0.4959030231, 1.3733130458, 0.0982400361),
43-
vec3( 0.0000000000, 0.0000000000, 0.9912520182));
53+
const mat3 nbl_glsl_XYZtoACES2065_1 = mat3(
54+
vec3( 1.0498110175f, -0.4959030231f, 0.0000000000f),
55+
vec3( 0.0000000000f, 1.3733130458f, 0.0000000000f),
56+
vec3(-0.0000974845f, 0.0982400361f, 0.9912520182f)
57+
);
4458

4559

46-
const mat3 nbl_glsl_XYZtoACEScc = mat3( vec3( 1.6410234,-0.6636629, 0.0117219),
47-
vec3(-0.3248033, 1.6153316,-0.0082844),
48-
vec3(-0.2364247, 0.0167563, 0.9883949));
60+
const mat3 nbl_glsl_XYZtoACEScc = mat3(
61+
vec3( 1.6410233797f,-0.6636628587f, 0.0117218943f),
62+
vec3(-0.3248032942f, 1.6153315917f,-0.0082844420f),
63+
vec3(-0.2364246952f, 0.0167563477f, 0.9883948585f)
64+
);
4965

5066
const mat3 nbl_glsl_XYZtoACEScct = nbl_glsl_XYZtoACEScc;
5167

include/nbl/builtin/glsl/colorspace/encodeCIEXYZ.glsl

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

88
const mat3 nbl_glsl_scRGBtoXYZ = mat3(
9-
vec3(0.4124564, 0.2126729, 0.0193339),
10-
vec3(0.3575761, 0.7151522, 0.1191920),
11-
vec3(0.1804375, 0.0721750, 0.9503041)
9+
vec3(0.412391f, 0.212639f, 0.019331f),
10+
vec3(0.357584f, 0.715169f, 0.119195f),
11+
vec3(0.180481f, 0.072192f, 0.950532f)
1212
);
1313

1414
const mat3 nbl_glsl_sRGBtoXYZ = nbl_glsl_scRGBtoXYZ;
@@ -17,23 +17,23 @@ const mat3 nbl_glsl_BT709toXYZ = nbl_glsl_scRGBtoXYZ;
1717

1818

1919
const mat3 nbl_glsl_Display_P3toXYZ = mat3(
20-
vec3(0.4865709, 0.2289746, 0.0000000),
21-
vec3(0.2656677, 0.6917385, 0.0451134),
22-
vec3(0.1982173, 0.0792869, 1.0439444)
20+
vec3(0.4865709486f, 0.2289745641f, 0.0000000000f),
21+
vec3(0.2656676932f, 0.6917385218f, 0.0451133819f),
22+
vec3(0.1982172852f, 0.0792869141f, 1.0439443689f)
2323
);
2424

2525

2626
const mat3 nbl_glsl_DCI_P3toXYZ = mat3(
27-
vec3(1.0, 0.0, 0.0),
28-
vec3(0.0, 1.0, 0.0),
29-
vec3(0.0, 0.0, 1.0)
27+
vec3(1.0f, 0.0f, 0.0f),
28+
vec3(0.0f, 1.0f, 0.0f),
29+
vec3(0.0f, 0.0f, 1.0f)
3030
);
3131

3232

3333
const mat3 nbl_glsl_BT2020toXYZ = mat3(
34-
vec3(0.6369580, 0.2627002, 0.0000000),
35-
vec3(0.1446169, 0.6779981, 0.0280727),
36-
vec3(0.1688810, 0.0593017, 1.0609851)
34+
vec3(0.636958f, 0.262700f, 0.000000f),
35+
vec3(0.144617f, 0.677998f, 0.028073f),
36+
vec3(0.168881f, 0.059302f, 1.060985f)
3737
);
3838

3939
const mat3 nbl_glsl_HDR10_ST2084toXYZ = nbl_glsl_BT2020toXYZ;
@@ -44,23 +44,23 @@ const mat3 nbl_glsl_HDR10_HLGtoXYZ = nbl_glsl_BT2020toXYZ;
4444

4545

4646
const mat3 nbl_glsl_AdobeRGBtoXYZ = mat3(
47-
vec3(0.57667, 0.29734, 0.02703),
48-
vec3(0.18556, 0.62736, 0.07069),
49-
vec3(0.18823, 0.07529, 0.99134)
47+
vec3(0.5766690429f, 0.2973449753f, 0.0270313614f),
48+
vec3(0.1855582379f, 0.6273635663f, 0.0706888525f),
49+
vec3(0.1882286462f, 0.0752914585f, 0.9913375368f)
5050
);
5151

5252

5353
const mat3 nbl_glsl_ACES2065_1toXYZ = mat3(
54-
vec3(0.9525523959, 0.3439664498, 0.0000000000),
55-
vec3(0.0000000000, 0.7281660966, 0.0000000000),
56-
vec3(0.0000936786, -0.0721325464, 1.0088251844)
54+
vec3(0.9525523959f, 0.3439664498f, 0.0000000000f),
55+
vec3(0.0000000000f, 0.7281660966f, 0.0000000000f),
56+
vec3(0.0000936786f, -0.0721325464f, 1.0088251844f)
5757
);
5858

5959

6060
const mat3 nbl_glsl_ACEScctoXYZ = mat3(
61-
vec3(0.6624542, 0.2722287, -0.0055746),
62-
vec3(0.1340042, 0.6740818, 0.6740818),
63-
vec3(0.1561877, 0.0536895, 1.0103391)
61+
vec3(0.6624541811f, 0.2722287168f, -0.0055746495f),
62+
vec3(0.1340042065f, 0.6740817658f, 0.0040607335f),
63+
vec3(0.1561876870f, 0.0536895174f, 1.0103391003f)
6464
);
6565

6666
const mat3 nbl_glsl_ACESccttoXYZ = nbl_glsl_ACEScctoXYZ;

include/nbl/builtin/hlsl/barycentric/utils.hlsl

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#ifndef _NBL_BUILTIN_HLSL_BARYCENTRIC_UTILS_INCLUDED_
55
#define _NBL_BUILTIN_HLSL_BARYCENTRIC_UTILS_INCLUDED_
66

7-
#include <nbl/builtin/hlsl/cpp_compat/cpp_compat.hlsl>
7+
#include <nbl/builtin/hlsl/cpp_compat.hlsl>
88

99
namespace nbl
1010
{
@@ -13,27 +13,27 @@ namespace hlsl
1313
namespace barycentric
1414
{
1515

16-
float2 reconstructBarycentrics(NBL_CONST_REF_ARG(float3) positionRelativeToV0, NBL_CONST_REF_ARG(float2x3) edges)
16+
float32_t2 reconstructBarycentrics(NBL_CONST_REF_ARG(float32_t3) positionRelativeToV0, NBL_CONST_REF_ARG(float32_t2x3) edges)
1717
{
18-
const float e0_2 = dot(edges[0], edges[0]);
19-
const float e0e1 = dot(edges[0], edges[1]);
20-
const float e1_2 = dot(edges[1], edges[1]);
18+
const float32_t e0_2 = dot(edges[0], edges[0]);
19+
const float32_t e0e1 = dot(edges[0], edges[1]);
20+
const float32_t e1_2 = dot(edges[1], edges[1]);
2121

22-
const float qe0 = dot(positionRelativeToV0, edges[0]);
23-
const float qe1 = dot(positionRelativeToV0, edges[1]);
24-
const float2 protoBary = float2(qe0 * e1_2 - qe1 * e0e1, qe1 * e0_2 - qe0 * e0e1);
22+
const float32_t qe0 = dot(positionRelativeToV0, edges[0]);
23+
const float32_t qe1 = dot(positionRelativeToV0, edges[1]);
24+
const float32_t2 protoBary = float32_t2(qe0 * e1_2 - qe1 * e0e1, qe1 * e0_2 - qe0 * e0e1);
2525

26-
const float rcp_dep = 1.f / (e0_2 * e1_2 - e0e1 * e0e1);
26+
const float32_t rcp_dep = 1.f / (e0_2 * e1_2 - e0e1 * e0e1);
2727
return protoBary * rcp_dep;
2828
}
29-
float2 reconstructBarycentrics(NBL_CONST_REF_ARG(float3) pointPosition, NBL_CONST_REF_ARG(float3x3) vertexPositions)
29+
float32_t2 reconstructBarycentrics(NBL_CONST_REF_ARG(float32_t3) pointPosition, NBL_CONST_REF_ARG(float32_t3x3) vertexPositions)
3030
{
31-
return reconstructBarycentrics(pointPosition - vertexPositions[2], float2x3(vertexPositions[0] - vertexPositions[2], vertexPositions[1] - vertexPositions[2]));
31+
return reconstructBarycentrics(pointPosition - vertexPositions[2], float32_t2x3(vertexPositions[0] - vertexPositions[2], vertexPositions[1] - vertexPositions[2]));
3232
}
3333

34-
float3 expand(NBL_CONST_REF_ARG(float2) compactBarycentrics)
34+
float32_t3 expand(NBL_CONST_REF_ARG(float32_t2) compactBarycentrics)
3535
{
36-
return float3(compactBarycentrics.xy,1.f-compactBarycentrics.x-compactBarycentrics.y);
36+
return float32_t3(compactBarycentrics.xy,1.f-compactBarycentrics.x-compactBarycentrics.y);
3737
}
3838

3939
}

include/nbl/builtin/hlsl/blit/blit/descriptors.hlsl

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)