Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
82fdf31
update examples
Erfan-Ahmadi Jun 7, 2023
9729e4b
Merge branch 'master' into cad_shaders_work
Erfan-Ahmadi Jun 8, 2023
0f2462e
update examples
Erfan-Ahmadi Jun 8, 2023
f5a9dcf
update examples
Erfan-Ahmadi Jun 9, 2023
de6a6de
update examples
Erfan-Ahmadi Jul 14, 2023
880dc8c
Merge branch 'ext_debug_utils' into cad_shaders_work
Erfan-Ahmadi Jul 15, 2023
e52fc34
Merge branch 'ext_debug_utils' into cad_shaders_work
Erfan-Ahmadi Jul 15, 2023
7ecd8b9
examples update
Erfan-Ahmadi Aug 8, 2023
a6c5aaf
Changes to builtin HLSL code
deprilula28 Aug 8, 2023
3aa8645
Revert "Changes to builtin HLSL code"
deprilula28 Aug 8, 2023
7f2cd41
Changes to builtin HLSL code
deprilula28 Aug 8, 2023
e8b76d9
Update examples submodule
deprilula28 Aug 8, 2023
f79dca3
examples update
Erfan-Ahmadi Aug 9, 2023
57041bd
Changes to builtin shaders
deprilula28 Aug 10, 2023
a1bf9b5
update examples
Erfan-Ahmadi Aug 10, 2023
2d1f8c0
update examples
Erfan-Ahmadi Aug 10, 2023
a2b2e6d
CHLSLCompiler new required flags
Erfan-Ahmadi Aug 10, 2023
f6b6873
update examples
Erfan-Ahmadi Aug 10, 2023
e7fbc42
update examples
Erfan-Ahmadi Aug 10, 2023
1feba68
update examples
Erfan-Ahmadi Aug 11, 2023
fce831d
Merge branch 'cad_shaders_hlsl_builtin' into cad_shaders_work
Erfan-Ahmadi Aug 11, 2023
bb87240
update examples
Erfan-Ahmadi Aug 11, 2023
8ca68fd
update examples
Erfan-Ahmadi Aug 11, 2023
e8bf8d1
update examples
Erfan-Ahmadi Aug 11, 2023
7cb05b0
update examples
Erfan-Ahmadi Aug 11, 2023
ec7d3c9
update examples
Erfan-Ahmadi Aug 11, 2023
077d6ca
fix catastrophic cancellation
Erfan-Ahmadi Aug 14, 2023
b816e2c
some comments in sdf
Erfan-Ahmadi Aug 14, 2023
3d77581
finally figured out the approximation is legit
Erfan-Ahmadi Aug 14, 2023
e9b7b37
Fix the quadratic coefficients in QuadraticBezier
deprilula28 Aug 31, 2023
a814cef
Revert "Fix the quadratic coefficients in QuadraticBezier"
deprilula28 Aug 31, 2023
6cb27cf
updated .gitmodules to use DevshGraphicsProgramming forks and SSH
Hazardu Sep 21, 2023
4cf58f6
update examples
Erfan-Ahmadi Sep 27, 2023
44db425
row major hlsl by default
Erfan-Ahmadi Sep 28, 2023
015195e
examples update
Erfan-Ahmadi Sep 28, 2023
2663b50
examples update
Erfan-Ahmadi Sep 28, 2023
2ea6a3f
update examples
Erfan-Ahmadi Sep 29, 2023
2ea518d
Added .hlsl and .glsl files
Przemog1 Sep 29, 2023
349f838
Modified cpp_compat files
Przemog1 Sep 29, 2023
6895860
Modified CMakeLists.txt
Przemog1 Sep 29, 2023
315f3b9
Refactored `xoroshiro.hlsl`
Przemog1 Sep 29, 2023
65498f0
Modified CMakeLists.txt
Przemog1 Sep 29, 2023
7b95623
Merge pull request #558 from Devsh-Graphics-Programming/new_hlsl_xoro…
Przemog1 Sep 29, 2023
e9a9150
Fixed bug in `xoroshiro.hlsl`
Przemog1 Sep 29, 2023
1ad4d39
merge examples with master
Erfan-Ahmadi Oct 2, 2023
89c8043
Merge branch 'master' into cad_shaders_work
Erfan-Ahmadi Oct 2, 2023
d70736d
Cache '_NBL_JOBS_AMOUNT_' CMake variable (can be seen in GUI, no need…
AnastaZIuk Oct 2, 2023
16a8d66
create integral hlsl builtin file
Erfan-Ahmadi Oct 2, 2023
5d78710
gauss legendre hlsl
Erfan-Ahmadi Oct 2, 2023
3288b9c
some TODOS before impl and test
Erfan-Ahmadi Oct 2, 2023
02187ea
gauss_legendre completed
Erfan-Ahmadi Oct 2, 2023
2105199
fix for cpp compat hlsl side workaround
Erfan-Ahmadi Oct 2, 2023
9a83008
update examples
Erfan-Ahmadi Oct 3, 2023
bab6cf0
add more types to cpp-hlsl compat
Erfan-Ahmadi Oct 3, 2023
45b98e7
Merge branch 'master' into cad_shaders_work
Erfan-Ahmadi Oct 3, 2023
3de0e4c
gauss legendre edits
Erfan-Ahmadi Oct 3, 2023
fa0bcd4
small rename
Erfan-Ahmadi Oct 3, 2023
8c28efa
Provide proper HLSL2021 explicitly sized named typedefs for matrices
devshgraphicsprogramming Oct 3, 2023
1c9cc30
Untangle the include ordering of matrix and vector
devshgraphicsprogramming Oct 3, 2023
87b95a5
Make the vector typedefs sized to encourage their usage in HLSL
devshgraphicsprogramming Oct 3, 2023
00e01d4
hoist cpp_compat.hlsl and introduce intrinsics.h
devshgraphicsprogramming Oct 3, 2023
77fa52d
forgot to rename builtin in cmake
Erfan-Ahmadi Oct 3, 2023
97d676b
needed to reverse the include order, also tests pass now
devshgraphicsprogramming Oct 3, 2023
a395eca
update examples
Erfan-Ahmadi Oct 3, 2023
b960325
add a simple pass-through macro to hasten the HLSL C++ implementation
devshgraphicsprogramming Oct 3, 2023
a7ef2ca
merge examples with master
Erfan-Ahmadi Oct 3, 2023
916fe23
Merge branch 'master' into cad_shaders_work
Erfan-Ahmadi Oct 3, 2023
dcc2596
use cpp compat correctly in gauss legendre
Erfan-Ahmadi Oct 3, 2023
ea80c6a
Updated examples_tests
Przemog1 Oct 3, 2023
cd282ea
Removed xoroshiro.hlsl
Przemog1 Oct 3, 2023
5875a18
reset examples_tests submodule to `master` HEAD to merge without `exa…
devshgraphicsprogramming Oct 3, 2023
1813545
Merge pull request #562 from Devsh-Graphics-Programming/cad_shaders_w…
devshgraphicsprogramming Oct 3, 2023
edceab1
update examples
Erfan-Ahmadi Oct 3, 2023
ff7b87d
Resolved conflicts
Przemog1 Oct 3, 2023
1f4e772
Adjusted colorspace files to new changes
Przemog1 Oct 3, 2023
e5ceeae
gauss_legendre shit finalize with customized floating point
Erfan-Ahmadi Oct 4, 2023
690a7a3
Merge branch 'master' into type_traits
atkurtul Oct 4, 2023
6720e39
fix gauss_legendre builtin path in cmakelists
atkurtul Oct 4, 2023
3ab2e9b
Added `type_traits.hlsl`
Przemog1 Oct 4, 2023
db91207
gauss_legendre fixes
Erfan-Ahmadi Oct 4, 2023
610b2cd
Corrections
Przemog1 Oct 4, 2023
f8e68ae
Merge pull request #557 from Devsh-Graphics-Programming/new_hlsl_colo…
devshgraphicsprogramming Oct 4, 2023
529fd13
rename meta_math -> mpl & add consteval log2 + clz
atkurtul Oct 4, 2023
1a3a171
update examples
Erfan-Ahmadi Oct 4, 2023
9f220b1
Merge branch 'master' into cad_shaders_work
Erfan-Ahmadi Oct 4, 2023
07a87f1
add extra constant impls
atkurtul Oct 4, 2023
b327d60
update examples
Erfan-Ahmadi Oct 4, 2023
be7d796
compiling workaround for clz
atkurtul Oct 4, 2023
b9c4777
typeid & decltype
atkurtul Oct 4, 2023
cf51f49
add mpl to builtin resources
atkurtul Oct 4, 2023
6a2fb98
update submodule
atkurtul Oct 4, 2023
660af38
Merge branch 'master' into type_traits
atkurtul Oct 4, 2023
2b834bb
update examples
Erfan-Ahmadi Oct 4, 2023
bb9a694
Merge pull request #529 from Devsh-Graphics-Programming/cad_shaders_work
devshgraphicsprogramming Oct 4, 2023
d4149ea
update submodule pointer after merge
devshgraphicsprogramming Oct 4, 2023
a9ee791
rename mpl::log2 & define decltype for all scalars
atkurtul Oct 4, 2023
ef1b9db
Merge branch 'master' into type_traits
atkurtul Oct 4, 2023
d40d913
update master merged examples_tests
atkurtul Oct 4, 2023
5bb0f08
decltype for vectors and matricies as well
atkurtul Oct 4, 2023
7198ff9
register all builtin types
atkurtul Oct 4, 2023
2892202
move typeid_t out of impl
atkurtul Oct 4, 2023
02e7598
wrap namespaces
atkurtul Oct 4, 2023
ffe9a73
add -Wno-c++11-extensions to default dxc args
atkurtul Oct 4, 2023
e2aa56f
move cpp_compat/type_traits.hlsl into type_traits.hlsl & smarter type…
atkurtul Oct 4, 2023
69a1537
update tests
atkurtul Oct 4, 2023
a4f5ecb
is_[un]bounded_array
atkurtul Oct 4, 2023
ae30095
enable_if && type_identity
atkurtul Oct 4, 2023
49b02b6
Merge pull request #546 from Devsh-Graphics-Programming/type_traits
devshgraphicsprogramming Oct 4, 2023
e4ab38c
make `examples_tests` point in the right place post-merge
devshgraphicsprogramming Oct 4, 2023
2fa14cf
Resolved conflicts
Przemog1 Oct 11, 2023
5190699
Deleted old files
Przemog1 Oct 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Build type: Debug or Release" FORCE)
endif()

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)

include(ProcessorCount)
if(NOT DEFINED _NBL_JOBS_AMOUNT_)
ProcessorCount(_NBL_JOBS_AMOUNT_)
Expand All @@ -111,17 +113,25 @@ cmake_host_system_information(RESULT _NBL_AVAILABLE_PHYSICAL_MEMORY_ QUERY AVAIL
if(NBL_CI_MODE)
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
if(_CI_NBL_JOBS_AMOUNT_ LESS _NBL_JOBS_AMOUNT_)
message(WARNING "Overriding _NBL_JOBS_AMOUNT_: \"${_NBL_JOBS_AMOUNT_}\" with \"${_CI_NBL_JOBS_AMOUNT_}\"")

set(_NBL_JOBS_AMOUNT_ "${_CI_NBL_JOBS_AMOUNT_}")
endif()
endif()

set(_NBL_JOBS_AMOUNT_ "${_NBL_JOBS_AMOUNT_}" CACHE STRING "Max jobs amount for the build to be invoked" FORCE)

math(EXPR _NBL_DEBUG_MEMORY_CONSUPTION_WITH_ALL_JOBS_ "${_NBL_JOBS_AMOUNT_}*2*1024") # MB
math(EXPR _NBL_CURRENTLY_USED_PHYSICAL_MEMORY_ "${_NBL_TOTAL_PHYSICAL_MEMORY_}-${_NBL_AVAILABLE_PHYSICAL_MEMORY_}") # MB

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
if(NOT DEFINED _NBL_MEMORY_CONSUMPTION_CHECK_SKIP_)
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.")
if(_NBL_MEMORY_CONSUMPTION_CHECK_SKIP_)
set(_NBL_CMAKE_STATUS_ WARNING)
else()
set(_NBL_CMAKE_STATUS_ FATAL_ERROR)
endif()

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.")
endif()

macro(nbl_adjust_flags)
Expand Down
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 108 files
54 changes: 35 additions & 19 deletions include/nbl/builtin/glsl/colorspace/decodeCIEXYZ.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,36 @@
#ifndef _NBL_BUILTIN_GLSL_COLOR_SPACE_DECODE_CIE_XYZ_INCLUDED_
#define _NBL_BUILTIN_GLSL_COLOR_SPACE_DECODE_CIE_XYZ_INCLUDED_

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

const mat3 nbl_glsl_XYZtosRGB = nbl_glsl_XYZtoscRGB;

const mat3 nbl_glsl_XYZtoBT709 = nbl_glsl_XYZtoscRGB;


const mat3 nbl_glsl_XYZtoDisplay_P3 = mat3( vec3( 2.4934969,-0.8294890, 0.0358458),
vec3(-0.9313836, 1.7626641,-0.0761724),
vec3(-0.4027108, 0.0236247, 0.9568845));
const mat3 nbl_glsl_XYZtoDisplay_P3 = mat3(
vec3( 2.4934969119f,-0.8294889696f, 0.0358458302f),
vec3(-0.9313836179f, 1.7626640603f,-0.0761723893f),
vec3(-0.4027107845f, 0.0236246858f, 0.9568845240f)
);


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));
const mat3 nbl_glsl_XYZtoDCI_P3 = mat3(
vec3(1.0f,0.0f,0.0f),
vec3(0.0f,1.0f,0.0f),
vec3(0.0f,0.0f,1.0f)
);


const mat3 nbl_glsl_XYZtoBT2020 = mat3( vec3( 1.7166512,-0.6666844, 0.0176399),
vec3(-0.3556708, 1.6164812,-0.0427706),
vec3(-0.2533663, 0.0157685, 0.9421031));
const mat3 nbl_glsl_XYZtoBT2020 = mat3(
vec3( 1.716651f,-0.666684f, 0.017640f),
vec3(-0.355671f, 1.616481f,-0.042771f),
vec3(-0.253366f, 0.015769f, 0.942103f)
);

const mat3 nbl_glsl_XYZtoHDR10_ST2084 = nbl_glsl_XYZtoBT2020;

Expand All @@ -33,19 +43,25 @@ const mat3 nbl_glsl_XYZtoDOLBYIVISION = nbl_glsl_XYZtoBT2020;
const mat3 nbl_glsl_XYZtoHDR10_HLG = nbl_glsl_XYZtoBT2020;


const mat3 nbl_glsl_XYZtoAdobeRGB = mat3( vec3( 2.04159,-0.96924, 0.01344),
vec3(-0.56501, 1.87597,-0.11836),
vec3(-0.34473, 0.04156, 1.01517));
const mat3 nbl_glsl_XYZtoAdobeRGB = mat3(
vec3( 2.0415879038f,-0.9692436363f, 0.0134442806f),
vec3(-0.5650069743f, 1.8759675015f,-0.1183623922f),
vec3(-0.3447313508f, 0.0415550574f, 1.0151749944f)
);


const mat3 nbl_glsl_XYZtoACES2065_1 = mat3( vec3( 1.0498110175, 0.0000000000,-0.0000974845),
vec3(-0.4959030231, 1.3733130458, 0.0982400361),
vec3( 0.0000000000, 0.0000000000, 0.9912520182));
const mat3 nbl_glsl_XYZtoACES2065_1 = mat3(
vec3( 1.0498110175f, -0.4959030231f, 0.0000000000f),
vec3( 0.0000000000f, 1.3733130458f, 0.0000000000f),
vec3(-0.0000974845f, 0.0982400361f, 0.9912520182f)
);


const mat3 nbl_glsl_XYZtoACEScc = mat3( vec3( 1.6410234,-0.6636629, 0.0117219),
vec3(-0.3248033, 1.6153316,-0.0082844),
vec3(-0.2364247, 0.0167563, 0.9883949));
const mat3 nbl_glsl_XYZtoACEScc = mat3(
vec3( 1.6410233797f,-0.6636628587f, 0.0117218943f),
vec3(-0.3248032942f, 1.6153315917f,-0.0082844420f),
vec3(-0.2364246952f, 0.0167563477f, 0.9883948585f)
);

const mat3 nbl_glsl_XYZtoACEScct = nbl_glsl_XYZtoACEScc;

Expand Down
42 changes: 21 additions & 21 deletions include/nbl/builtin/glsl/colorspace/encodeCIEXYZ.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#define _NBL_BUILTIN_GLSL_COLOR_SPACE_ENCODE_CIE_XYZ_INCLUDED_

const mat3 nbl_glsl_scRGBtoXYZ = mat3(
vec3(0.4124564, 0.2126729, 0.0193339),
vec3(0.3575761, 0.7151522, 0.1191920),
vec3(0.1804375, 0.0721750, 0.9503041)
vec3(0.412391f, 0.212639f, 0.019331f),
vec3(0.357584f, 0.715169f, 0.119195f),
vec3(0.180481f, 0.072192f, 0.950532f)
);

const mat3 nbl_glsl_sRGBtoXYZ = nbl_glsl_scRGBtoXYZ;
Expand All @@ -17,23 +17,23 @@ const mat3 nbl_glsl_BT709toXYZ = nbl_glsl_scRGBtoXYZ;


const mat3 nbl_glsl_Display_P3toXYZ = mat3(
vec3(0.4865709, 0.2289746, 0.0000000),
vec3(0.2656677, 0.6917385, 0.0451134),
vec3(0.1982173, 0.0792869, 1.0439444)
vec3(0.4865709486f, 0.2289745641f, 0.0000000000f),
vec3(0.2656676932f, 0.6917385218f, 0.0451133819f),
vec3(0.1982172852f, 0.0792869141f, 1.0439443689f)
);


const mat3 nbl_glsl_DCI_P3toXYZ = mat3(
vec3(1.0, 0.0, 0.0),
vec3(0.0, 1.0, 0.0),
vec3(0.0, 0.0, 1.0)
vec3(1.0f, 0.0f, 0.0f),
vec3(0.0f, 1.0f, 0.0f),
vec3(0.0f, 0.0f, 1.0f)
);


const mat3 nbl_glsl_BT2020toXYZ = mat3(
vec3(0.6369580, 0.2627002, 0.0000000),
vec3(0.1446169, 0.6779981, 0.0280727),
vec3(0.1688810, 0.0593017, 1.0609851)
vec3(0.636958f, 0.262700f, 0.000000f),
vec3(0.144617f, 0.677998f, 0.028073f),
vec3(0.168881f, 0.059302f, 1.060985f)
);

const mat3 nbl_glsl_HDR10_ST2084toXYZ = nbl_glsl_BT2020toXYZ;
Expand All @@ -44,23 +44,23 @@ const mat3 nbl_glsl_HDR10_HLGtoXYZ = nbl_glsl_BT2020toXYZ;


const mat3 nbl_glsl_AdobeRGBtoXYZ = mat3(
vec3(0.57667, 0.29734, 0.02703),
vec3(0.18556, 0.62736, 0.07069),
vec3(0.18823, 0.07529, 0.99134)
vec3(0.5766690429f, 0.2973449753f, 0.0270313614f),
vec3(0.1855582379f, 0.6273635663f, 0.0706888525f),
vec3(0.1882286462f, 0.0752914585f, 0.9913375368f)
);


const mat3 nbl_glsl_ACES2065_1toXYZ = mat3(
vec3(0.9525523959, 0.3439664498, 0.0000000000),
vec3(0.0000000000, 0.7281660966, 0.0000000000),
vec3(0.0000936786, -0.0721325464, 1.0088251844)
vec3(0.9525523959f, 0.3439664498f, 0.0000000000f),
vec3(0.0000000000f, 0.7281660966f, 0.0000000000f),
vec3(0.0000936786f, -0.0721325464f, 1.0088251844f)
);


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

const mat3 nbl_glsl_ACESccttoXYZ = nbl_glsl_ACEScctoXYZ;
Expand Down
26 changes: 13 additions & 13 deletions include/nbl/builtin/hlsl/barycentric/utils.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#ifndef _NBL_BUILTIN_HLSL_BARYCENTRIC_UTILS_INCLUDED_
#define _NBL_BUILTIN_HLSL_BARYCENTRIC_UTILS_INCLUDED_

#include <nbl/builtin/hlsl/cpp_compat/cpp_compat.hlsl>
#include <nbl/builtin/hlsl/cpp_compat.hlsl>

namespace nbl
{
Expand All @@ -13,27 +13,27 @@ namespace hlsl
namespace barycentric
{

float2 reconstructBarycentrics(NBL_CONST_REF_ARG(float3) positionRelativeToV0, NBL_CONST_REF_ARG(float2x3) edges)
float32_t2 reconstructBarycentrics(NBL_CONST_REF_ARG(float32_t3) positionRelativeToV0, NBL_CONST_REF_ARG(float32_t2x3) edges)
{
const float e0_2 = dot(edges[0], edges[0]);
const float e0e1 = dot(edges[0], edges[1]);
const float e1_2 = dot(edges[1], edges[1]);
const float32_t e0_2 = dot(edges[0], edges[0]);
const float32_t e0e1 = dot(edges[0], edges[1]);
const float32_t e1_2 = dot(edges[1], edges[1]);

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

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

float3 expand(NBL_CONST_REF_ARG(float2) compactBarycentrics)
float32_t3 expand(NBL_CONST_REF_ARG(float32_t2) compactBarycentrics)
{
return float3(compactBarycentrics.xy,1.f-compactBarycentrics.x-compactBarycentrics.y);
return float32_t3(compactBarycentrics.xy,1.f-compactBarycentrics.x-compactBarycentrics.y);
}

}
Expand Down
84 changes: 0 additions & 84 deletions include/nbl/builtin/hlsl/blit/blit/descriptors.hlsl

This file was deleted.

Loading