Skip to content
Open

Fft2 #1050

Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion examples_tests
Submodule examples_tests updated 83 files
+1 −1 .gitignore
+17 −42 22_CppCompat/CIntrinsicsTester.h
+32 −51 22_CppCompat/CTgmathTester.h
+0 −6 22_CppCompat/app_resources/common.hlsl
+38 −0 30_ComputeShaderPathTracer/CMakeLists.txt
+822 −0 30_ComputeShaderPathTracer/app_resources/common.glsl
+182 −0 30_ComputeShaderPathTracer/app_resources/litByRectangle.comp
+60 −0 30_ComputeShaderPathTracer/app_resources/litBySphere.comp
+105 −0 30_ComputeShaderPathTracer/app_resources/litByTriangle.comp
+19 −0 30_ComputeShaderPathTracer/app_resources/present.frag.hlsl
+28 −0 30_ComputeShaderPathTracer/config.json.template
+11 −0 30_ComputeShaderPathTracer/include/nbl/this_example/common.hpp
+1,304 −0 30_ComputeShaderPathTracer/main.cpp
+50 −0 30_ComputeShaderPathTracer/pipeline.groovy
+22 −75 31_HLSLPathTracer/CMakeLists.txt
+0 −66 31_HLSLPathTracer/app_resources/hlsl/compute.render.common.hlsl
+0 −21 31_HLSLPathTracer/app_resources/hlsl/compute.render.linear.entrypoints.hlsl
+0 −21 31_HLSLPathTracer/app_resources/hlsl/compute.render.persistent.entrypoints.hlsl
+0 −160 31_HLSLPathTracer/app_resources/hlsl/compute_render_scene_impl.hlsl
+0 −9 31_HLSLPathTracer/app_resources/hlsl/imgui.unified.hlsl
+15 −30 31_HLSLPathTracer/app_resources/hlsl/next_event_estimator.hlsl
+4 −3 31_HLSLPathTracer/app_resources/hlsl/present.frag.hlsl
+40 −0 31_HLSLPathTracer/app_resources/hlsl/rand_gen.hlsl
+222 −0 31_HLSLPathTracer/app_resources/hlsl/render.comp.hlsl
+8 −39 31_HLSLPathTracer/app_resources/hlsl/render_common.hlsl
+0 −4 31_HLSLPathTracer/app_resources/hlsl/render_rwmc_common.hlsl
+1 −2 31_HLSLPathTracer/app_resources/hlsl/resolve.comp.hlsl
+2 −1 31_HLSLPathTracer/app_resources/hlsl/resolve_common.hlsl
+0 −8 31_HLSLPathTracer/app_resources/hlsl/rwmc_common.hlsl
+3 −10 31_HLSLPathTracer/app_resources/hlsl/scene_base.hlsl
+0 −1 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.rectangle.proxy.hlsl
+0 −1 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.rectangle.rwmc.persistent.proxy.hlsl
+0 −1 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.sphere.proxy.hlsl
+0 −1 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.sphere.rwmc.proxy.hlsl
+0 −71 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.methods.shared.hlsl
+0 −1 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.persistent.proxy.hlsl
+0 −1 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.triangle.rwmc.persistent.proxy.hlsl
+0 −55 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.compute.variant.shared.hlsl
+0 −5 31_HLSLPathTracer/app_resources/hlsl/spirv/pt.misc.proxy.hlsl
+0 −26 31_HLSLPathTracer/include/nbl/this_example/path_tracer_pipeline_state.hpp
+0 −137 31_HLSLPathTracer/include/nbl/this_example/path_tracer_ui.hpp
+0 −40 31_HLSLPathTracer/include/nbl/this_example/render_variant_config.hlsl
+0 −28 31_HLSLPathTracer/include/nbl/this_example/render_variant_enums.hlsl
+0 −55 31_HLSLPathTracer/include/nbl/this_example/render_variant_info.hpp
+0 −98 31_HLSLPathTracer/include/nbl/this_example/render_variant_strings.hpp
+391 −1,715 31_HLSLPathTracer/main.cpp
+0 −3 31_HLSLPathTracer/path_tracer.runtime.json.in
+0 −35 31_HLSLPathTracer/pt.cmake
+0 −4 31_HLSLPathTracer/pt.variant_ids.cmake
+0 −2 40_PathTracer/CMakeLists.txt
+13 −459 40_PathTracer/app_resources/pathtrace/beauty.hlsl
+0 −527 40_PathTracer/app_resources/pathtrace/common.hlsl
+9 −53 40_PathTracer/app_resources/pathtrace/debug.hlsl
+0 −5 40_PathTracer/app_resources/pathtrace/previs.hlsl
+37 −20 40_PathTracer/include/renderer/CRenderer.h
+3 −3 40_PathTracer/include/renderer/CSession.h
+0 −1 40_PathTracer/include/renderer/present/IPresenter.h
+0 −70 40_PathTracer/include/renderer/shaders/common.hlsl
+2 −2 40_PathTracer/include/renderer/shaders/pathtrace/common.hlsl
+8 −45 40_PathTracer/include/renderer/shaders/pathtrace/push_constants.hlsl
+4 −10 40_PathTracer/include/renderer/shaders/scene.hlsl
+25 −24 40_PathTracer/include/renderer/shaders/session.hlsl
+20 −30 40_PathTracer/main.cpp
+12 −13 40_PathTracer/src/io/CSceneLoader.cpp
+9 −100 40_PathTracer/src/renderer/CRenderer.cpp
+7 −10 40_PathTracer/src/renderer/CScene.cpp
+67 −136 40_PathTracer/src/renderer/CSession.cpp
+7 −8 40_PathTracer/src/renderer/present/CWindowPresenter.cpp
+4 −48 40_PathTracer/src/renderer/resolve/CBasicRWMCResolver.cpp
+1 −1 50.IESViewer/CMakeLists.txt
+4 −4 71_RayTracingPipeline/main.cpp
+4 −0 CMakeLists.txt
+62 −0 XX_NewFFT/CMakeLists.txt
+33 −0 XX_NewFFT/app_resources/common.hlsl
+132 −0 XX_NewFFT/app_resources/shader.comp.hlsl
+28 −0 XX_NewFFT/config.json.template
+491 −0 XX_NewFFT/main.cpp
+50 −0 XX_NewFFT/pipeline.groovy
+1 −1 common/CMakeLists.txt
+0 −22 common/include/nbl/examples/Tester/ITester.h
+0 −198 common/include/nbl/examples/common/CCachedOwenScrambledSequence.hpp
+0 −278 common/include/nbl/examples/common/CachedPipelineState.hpp
+0 −45 common/include/nbl/examples/common/KeyedQuantizedSequence.hlsl
3 changes: 3 additions & 0 deletions include/nbl/asset/utils/IShaderCompiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,9 @@ class NBL_API2 IShaderCompiler : public core::IReferenceCounted
SPreprocessorOptions preprocessorOptions = {};
CCache* readCache = nullptr;
CCache* writeCache = nullptr;
bool optimizerIsExtraPasses = false; // Instead of disabling the default opt passes, run the provided optimization passes at the end
std::string preprocessedOutputPath = "";
std::string spvOutputPath = "";
};

class CCache final : public IReferenceCounted
Expand Down
72 changes: 38 additions & 34 deletions include/nbl/builtin/hlsl/complex.hlsl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

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

using namespace nbl::hlsl;

Expand All @@ -32,22 +33,6 @@ struct complex_t : public std::complex<Scalar>
}
};

// Fast mul by i
template<typename Scalar>
complex_t<Scalar> rotateLeft(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
complex_t<Scalar> retVal = { -value.imag(), value.real() };
return retVal;
}

// Fast mul by -i
template<typename Scalar>
complex_t<Scalar> rotateRight(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
complex_t<Scalar> retVal = { value.imag(), -value.real() };
return retVal;
}

}
}

Expand Down Expand Up @@ -414,28 +399,11 @@ complex_t<Scalar> proj(const complex_t<Scalar> c)
template<typename Scalar>
complex_t<Scalar> polar(const Scalar r, const Scalar theta)
{
complex_t<Scalar> retVal = {r * cos(theta), r * sin(theta)};
complex_t<Scalar> retVal = {r * nbl::hlsl::cos<Scalar>(theta), r * nbl::hlsl::sin<Scalar>(theta)};
return retVal;
}


// --------------------------------------------- Some more functions that come in handy --------------------------------------
// Fast mul by i
template<typename Scalar>
complex_t<Scalar> rotateLeft(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
complex_t<Scalar> retVal = { -value.imag(), value.real() };
return retVal;
}

// Fast mul by -i
template<typename Scalar>
complex_t<Scalar> rotateRight(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
complex_t<Scalar> retVal = { value.imag(), -value.real() };
return retVal;
}

}
}

Expand All @@ -456,4 +424,40 @@ NBL_REGISTER_OBJ_TYPE(complex_t<float64_t4>,::nbl::hlsl::alignment_of_v<float64_
// -------------------------------------- END HLSL VERSION ---------------------------------------
#endif

// ---------------------------------------- COMMON ---------------------------------------

namespace nbl
{
namespace hlsl
{

// Fast mul by i
template<typename Scalar>
complex_t<Scalar> rotateLeft(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
complex_t<Scalar> retVal = { -value.imag(), value.real() };
return retVal;
}

// Fast mul by -i
template<typename Scalar>
complex_t<Scalar> rotateRight(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
complex_t<Scalar> retVal = { value.imag(), -value.real() };
return retVal;
}

// Fast square
template<typename Scalar>
complex_t<Scalar> square(NBL_CONST_REF_ARG(complex_t<Scalar>) value)
{
Scalar real = value.real() * value.real() - value.imag() * value.imag();
Scalar imag = 2 * value.real() * value.imag();
complex_t<Scalar> retVal = { real, imag };
return retVal;
}

}
}

#endif
Loading
Loading