Skip to content

Commit 847f081

Browse files
committed
Merge remote-tracking branch 'origin/master' into dynamicJsonDepsInstall
2 parents f907cf5 + ed96a86 commit 847f081

Some content is hidden

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

45 files changed

+4041
-245
lines changed

3rdparty/dxc/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ if(NBL_EMBED_BUILTIN_RESOURCES)
172172
include("${NBL_ROOT_PATH}/src/nbl/builtin/utils.cmake")
173173

174174
# SPIRV Header in builtin resources, nbl paths as aliases
175-
LIST_BUILTIN_RESOURCE(SPIRV_RESOURCES_TO_EMBED "1.2/spirv.h")
176-
LIST_BUILTIN_RESOURCE(SPIRV_RESOURCES_TO_EMBED "1.2/spirv.hpp")
175+
LIST_BUILTIN_RESOURCE(SPIRV_RESOURCES_TO_EMBED "unified1/spirv.h")
176+
LIST_BUILTIN_RESOURCE(SPIRV_RESOURCES_TO_EMBED "unified1/spirv.hpp")
177177

178178
ADD_CUSTOM_BUILTIN_RESOURCES(dxcBuiltinResourceData SPIRV_RESOURCES_TO_EMBED "${_SPIRV_BR_BUNDLE_SEARCH_DIRECTORY_}" "spirv" "spirv::builtin" "${_SPIRV_BR_OUTPUT_DIRECTORY_HEADER_}" "${_SPIRV_BR_OUTPUT_DIRECTORY_SOURCE_}" "STATIC" "INTERNAL")
179179
endif()

3rdparty/dxc/Readme.md

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# How to update the DXC module
2+
3+
## FIRST TIME SETUP: Make sure you have the correct remotes!
4+
5+
The following submodules as initialized on your system should have `origin` pointing at the `[email protected]:Devsh-Graphics-Programming` fork.
6+
7+
Then a remote `Khronos` for the SPIR-V submodules, and `Microsoft` for the DXC.
8+
9+
If they don't then you can correct that with `git remote add [RemoteName] [email protected]:[Organisation]/[Repo-Name].git` and `git remote remove [RemoteName]`
10+
11+
## IF YOU GET `There is no tracking information for the current branch`
12+
13+
just make the branch track the origin
14+
```
15+
git branch --set-upstream-to=origin/[BranchName] [BranchName]
16+
```
17+
18+
## Its Basically an Depth First Search with a Prologue and Epilogue
19+
20+
```
21+
checkout correct branch HEAD
22+
[optional] Merge latest stuff from original project
23+
recurse()
24+
commit
25+
push
26+
```
27+
28+
### First make sure you're on some Nabla branch Head
29+
30+
Just `git pull` and make sure you're tracking a branch.
31+
32+
### Make sure DXC is tracked and pointing at HEAD
33+
34+
```
35+
cd ./3rdparty/dxc/dxc
36+
git fetch
37+
git checkout devshFixes
38+
git pull
39+
```
40+
41+
### SPIR-V Headers: track & get latest head, merge latest upstream, commit and push
42+
43+
```
44+
cd ./external/SPIRV-Headers
45+
git fetch
46+
git checkout header_4_hlsl
47+
git pull
48+
git pull Khronos main
49+
git commit -m "latest Khronos `main` merge"
50+
git push
51+
```
52+
53+
### SPIR-V Tools: track & get latest head, merge latest upstream, commit and push
54+
55+
```
56+
cd ../SPIRV-Tools
57+
git fetch
58+
git checkout main
59+
git pull
60+
git pull Khronos main
61+
git commit -m "latest Khronos `main` merge"
62+
git push
63+
```
64+
65+
### Back to DXC and commit the submodule pointer changes
66+
67+
```
68+
cd ..
69+
git add .
70+
git commit -m "Update SPIR-V Headers and Tools"
71+
cd ..
72+
[optional] git pull Microsoft main
73+
[optional] git commit -m "merge upstream from Microsoft"
74+
git push
75+
```
76+
77+
The reason the upstream from Microsoft is optional is because it might break our Clang hacks like:
78+
- abuse of `__decltype`
79+
- `inout` working like a reference, but only sometimes
80+
- abuse of reference type
81+
82+
### Finally commit the change of DXC commit pointer to Nabla
83+
84+
```
85+
cd ..
86+
git add dxc
87+
git commit -m "Updated DXC"
88+
git push
89+
```

3rdparty/dxc/dxc

Submodule dxc updated 978 files

CMakeLists.txt

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

101+
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)
102+
101103
include(ProcessorCount)
102104
if(NOT DEFINED _NBL_JOBS_AMOUNT_)
103105
ProcessorCount(_NBL_JOBS_AMOUNT_)
@@ -112,17 +114,25 @@ cmake_host_system_information(RESULT _NBL_AVAILABLE_PHYSICAL_MEMORY_ QUERY AVAIL
112114
if(NBL_CI_MODE)
113115
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
114116
if(_CI_NBL_JOBS_AMOUNT_ LESS _NBL_JOBS_AMOUNT_)
117+
message(WARNING "Overriding _NBL_JOBS_AMOUNT_: \"${_NBL_JOBS_AMOUNT_}\" with \"${_CI_NBL_JOBS_AMOUNT_}\"")
118+
115119
set(_NBL_JOBS_AMOUNT_ "${_CI_NBL_JOBS_AMOUNT_}")
116120
endif()
117121
endif()
118122

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

122128
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
123-
if(NOT DEFINED _NBL_MEMORY_CONSUMPTION_CHECK_SKIP_)
124-
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.")
129+
if(_NBL_MEMORY_CONSUMPTION_CHECK_SKIP_)
130+
set(_NBL_CMAKE_STATUS_ WARNING)
131+
else()
132+
set(_NBL_CMAKE_STATUS_ FATAL_ERROR)
125133
endif()
134+
135+
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.")
126136
endif()
127137

128138
macro(nbl_adjust_flags)

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
}

0 commit comments

Comments
 (0)