├── .github └── workflows │ └── build-cpp.yml ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── binaries ├── SDL2-2.0.18 │ ├── BUGS.txt │ ├── COPYING.txt │ ├── README-SDL.txt │ ├── README.txt │ ├── WhatsNew.txt │ ├── include │ │ ├── SDL.h │ │ ├── SDL_assert.h │ │ ├── SDL_atomic.h │ │ ├── SDL_audio.h │ │ ├── SDL_bits.h │ │ ├── SDL_blendmode.h │ │ ├── SDL_clipboard.h │ │ ├── SDL_config.h │ │ ├── SDL_config.h.cmake │ │ ├── SDL_config.h.in │ │ ├── SDL_config_android.h │ │ ├── SDL_config_iphoneos.h │ │ ├── SDL_config_macosx.h │ │ ├── SDL_config_macosx.h.orig │ │ ├── SDL_config_minimal.h │ │ ├── SDL_config_pandora.h │ │ ├── SDL_config_psp.h │ │ ├── SDL_config_windows.h │ │ ├── SDL_config_winrt.h │ │ ├── SDL_config_wiz.h │ │ ├── SDL_copying.h │ │ ├── SDL_cpuinfo.h │ │ ├── SDL_egl.h │ │ ├── SDL_endian.h │ │ ├── SDL_error.h │ │ ├── SDL_events.h │ │ ├── SDL_filesystem.h │ │ ├── SDL_gamecontroller.h │ │ ├── SDL_gesture.h │ │ ├── SDL_haptic.h │ │ ├── SDL_hidapi.h │ │ ├── SDL_hints.h │ │ ├── SDL_joystick.h │ │ ├── SDL_keyboard.h │ │ ├── SDL_keycode.h │ │ ├── SDL_loadso.h │ │ ├── SDL_locale.h │ │ ├── SDL_log.h │ │ ├── SDL_main.h │ │ ├── SDL_messagebox.h │ │ ├── SDL_metal.h │ │ ├── SDL_misc.h │ │ ├── SDL_mouse.h │ │ ├── SDL_mutex.h │ │ ├── SDL_name.h │ │ ├── SDL_opengl.h │ │ ├── SDL_opengl_glext.h │ │ ├── SDL_opengles.h │ │ ├── SDL_opengles2.h │ │ ├── SDL_opengles2_gl2.h │ │ ├── SDL_opengles2_gl2ext.h │ │ ├── SDL_opengles2_gl2platform.h │ │ ├── SDL_opengles2_khrplatform.h │ │ ├── SDL_pixels.h │ │ ├── SDL_platform.h │ │ ├── SDL_power.h │ │ ├── SDL_quit.h │ │ ├── SDL_rect.h │ │ ├── SDL_render.h │ │ ├── SDL_revision.h │ │ ├── SDL_rwops.h │ │ ├── SDL_scancode.h │ │ ├── SDL_sensor.h │ │ ├── SDL_shape.h │ │ ├── SDL_stdinc.h │ │ ├── SDL_surface.h │ │ ├── SDL_system.h │ │ ├── SDL_syswm.h │ │ ├── SDL_test.h │ │ ├── SDL_test_assert.h │ │ ├── SDL_test_common.h │ │ ├── SDL_test_compare.h │ │ ├── SDL_test_crc32.h │ │ ├── SDL_test_font.h │ │ ├── SDL_test_fuzzer.h │ │ ├── SDL_test_harness.h │ │ ├── SDL_test_images.h │ │ ├── SDL_test_log.h │ │ ├── SDL_test_md5.h │ │ ├── SDL_test_memory.h │ │ ├── SDL_test_random.h │ │ ├── SDL_thread.h │ │ ├── SDL_timer.h │ │ ├── SDL_touch.h │ │ ├── SDL_types.h │ │ ├── SDL_version.h │ │ ├── SDL_video.h │ │ ├── SDL_vulkan.h │ │ ├── begin_code.h │ │ └── close_code.h │ └── lib │ │ ├── x64 │ │ ├── SDL2.dll │ │ ├── SDL2.lib │ │ ├── SDL2main.lib │ │ └── SDL2test.lib │ │ └── x86 │ │ ├── SDL2.dll │ │ ├── SDL2.lib │ │ ├── SDL2main.lib │ │ └── SDL2test.lib ├── assimp │ ├── include │ │ └── assimp │ │ │ ├── Base64.hpp │ │ │ ├── BaseImporter.h │ │ │ ├── Bitmap.h │ │ │ ├── BlobIOSystem.h │ │ │ ├── ByteSwapper.h │ │ │ ├── ColladaMetaData.h │ │ │ ├── Compiler │ │ │ ├── poppack1.h │ │ │ ├── pstdint.h │ │ │ └── pushpack1.h │ │ │ ├── CreateAnimMesh.h │ │ │ ├── DefaultIOStream.h │ │ │ ├── DefaultIOSystem.h │ │ │ ├── DefaultLogger.hpp │ │ │ ├── Exceptional.h │ │ │ ├── Exporter.hpp │ │ │ ├── GenericProperty.h │ │ │ ├── GltfMaterial.h │ │ │ ├── Hash.h │ │ │ ├── IOStream.hpp │ │ │ ├── IOStreamBuffer.h │ │ │ ├── IOSystem.hpp │ │ │ ├── Importer.hpp │ │ │ ├── LineSplitter.h │ │ │ ├── LogAux.h │ │ │ ├── LogStream.hpp │ │ │ ├── Logger.hpp │ │ │ ├── MathFunctions.h │ │ │ ├── MemoryIOWrapper.h │ │ │ ├── NullLogger.hpp │ │ │ ├── ParsingUtils.h │ │ │ ├── Profiler.h │ │ │ ├── ProgressHandler.hpp │ │ │ ├── RemoveComments.h │ │ │ ├── SGSpatialSort.h │ │ │ ├── SceneCombiner.h │ │ │ ├── SkeletonMeshBuilder.h │ │ │ ├── SmallVector.h │ │ │ ├── SmoothingGroups.h │ │ │ ├── SmoothingGroups.inl │ │ │ ├── SpatialSort.h │ │ │ ├── StandardShapes.h │ │ │ ├── StreamReader.h │ │ │ ├── StreamWriter.h │ │ │ ├── StringComparison.h │ │ │ ├── StringUtils.h │ │ │ ├── Subdivision.h │ │ │ ├── TinyFormatter.h │ │ │ ├── Vertex.h │ │ │ ├── XMLTools.h │ │ │ ├── XmlParser.h │ │ │ ├── ZipArchiveIOSystem.h │ │ │ ├── aabb.h │ │ │ ├── ai_assert.h │ │ │ ├── anim.h │ │ │ ├── camera.h │ │ │ ├── cexport.h │ │ │ ├── cfileio.h │ │ │ ├── cimport.h │ │ │ ├── color4.h │ │ │ ├── color4.inl │ │ │ ├── commonMetaData.h │ │ │ ├── config.h │ │ │ ├── defs.h │ │ │ ├── fast_atof.h │ │ │ ├── importerdesc.h │ │ │ ├── light.h │ │ │ ├── material.h │ │ │ ├── material.inl │ │ │ ├── matrix3x3.h │ │ │ ├── matrix3x3.inl │ │ │ ├── matrix4x4.h │ │ │ ├── matrix4x4.inl │ │ │ ├── mesh.h │ │ │ ├── metadata.h │ │ │ ├── pbrmaterial.h │ │ │ ├── postprocess.h │ │ │ ├── qnan.h │ │ │ ├── quaternion.h │ │ │ ├── quaternion.inl │ │ │ ├── scene.h │ │ │ ├── texture.h │ │ │ ├── types.h │ │ │ ├── vector2.h │ │ │ ├── vector2.inl │ │ │ ├── vector3.h │ │ │ ├── vector3.inl │ │ │ └── version.h │ ├── linux │ │ └── lib │ │ │ ├── libassimp.so │ │ │ ├── libassimp.so.5 │ │ │ └── libassimp.so.5.2.0 │ └── windows │ │ ├── bin │ │ └── assimp-vc142-mt.dll │ │ └── lib │ │ ├── assimp-vc142-mt.lib │ │ └── zlibstatic.lib └── data │ ├── BayerDither4x4.png │ ├── BayerDither8x8.png │ ├── LDR_RG01_0.png │ ├── cone.mtl │ ├── cone.obj │ ├── plane.mtl │ ├── plane.obj │ ├── sphere.mtl │ └── sphere.obj ├── screenshots ├── Snipaste_2023-06-03_11-50-50.png ├── Snipaste_2023-06-06_22-58-24.png ├── Snipaste_2023-06-06_22-58-34.png ├── Snipaste_2023-06-06_22-59-18.png ├── Snipaste_2023-06-07_23-23-35.png ├── Snipaste_2023-06-07_23-24-09.png ├── Snipaste_2023-06-09_22-19-27.png ├── Snipaste_2023-06-09_22-19-35.png ├── Snipaste_2023-06-10_00-03-42.png ├── Snipaste_2023-06-10_19-53-16.png ├── Snipaste_2023-06-10_23-16-09.png ├── Snipaste_2023-06-10_23-16-18.png ├── Snipaste_2023-06-13_20-46-51.png ├── Snipaste_2023-06-13_20-46-57.png └── Snipaste_2023-06-13_21-23-06.png └── source ├── CMakeLists.txt ├── external ├── StackWalker.cpp ├── StackWalker.h ├── cglm │ ├── LICENSE │ ├── affine-mat.h │ ├── affine.h │ ├── affine2d.h │ ├── applesimd.h │ ├── bezier.h │ ├── box.h │ ├── call.h │ ├── call │ │ ├── affine.h │ │ ├── affine2d.h │ │ ├── bezier.h │ │ ├── box.h │ │ ├── cam.h │ │ ├── clipspace │ │ │ ├── ortho_lh_no.h │ │ │ ├── ortho_lh_zo.h │ │ │ ├── ortho_rh_no.h │ │ │ ├── ortho_rh_zo.h │ │ │ ├── persp_lh_no.h │ │ │ ├── persp_lh_zo.h │ │ │ ├── persp_rh_no.h │ │ │ ├── persp_rh_zo.h │ │ │ ├── project_no.h │ │ │ ├── project_zo.h │ │ │ ├── view_lh_no.h │ │ │ ├── view_lh_zo.h │ │ │ ├── view_rh_no.h │ │ │ └── view_rh_zo.h │ │ ├── curve.h │ │ ├── ease.h │ │ ├── euler.h │ │ ├── frustum.h │ │ ├── io.h │ │ ├── mat2.h │ │ ├── mat3.h │ │ ├── mat4.h │ │ ├── plane.h │ │ ├── project.h │ │ ├── quat.h │ │ ├── ray.h │ │ ├── sphere.h │ │ ├── vec2.h │ │ ├── vec3.h │ │ └── vec4.h │ ├── cam.h │ ├── cglm.h │ ├── clipspace │ │ ├── ortho_lh_no.h │ │ ├── ortho_lh_zo.h │ │ ├── ortho_rh_no.h │ │ ├── ortho_rh_zo.h │ │ ├── persp.h │ │ ├── persp_lh_no.h │ │ ├── persp_lh_zo.h │ │ ├── persp_rh_no.h │ │ ├── persp_rh_zo.h │ │ ├── project_no.h │ │ ├── project_zo.h │ │ ├── view_lh.h │ │ ├── view_lh_no.h │ │ ├── view_lh_zo.h │ │ ├── view_rh.h │ │ ├── view_rh_no.h │ │ └── view_rh_zo.h │ ├── color.h │ ├── common.h │ ├── curve.h │ ├── ease.h │ ├── euler.h │ ├── frustum.h │ ├── io.h │ ├── mat2.h │ ├── mat3.h │ ├── mat4.h │ ├── plane.h │ ├── project.h │ ├── quat.h │ ├── ray.h │ ├── simd │ │ ├── arm.h │ │ ├── avx │ │ │ ├── affine.h │ │ │ └── mat4.h │ │ ├── intrin.h │ │ ├── neon │ │ │ ├── affine.h │ │ │ ├── mat2.h │ │ │ ├── mat4.h │ │ │ └── quat.h │ │ ├── sse2 │ │ │ ├── affine.h │ │ │ ├── mat2.h │ │ │ ├── mat3.h │ │ │ ├── mat4.h │ │ │ └── quat.h │ │ └── x86.h │ ├── sphere.h │ ├── struct.h │ ├── struct │ │ ├── affine.h │ │ ├── affine2d.h │ │ ├── box.h │ │ ├── cam.h │ │ ├── clipspace │ │ │ ├── ortho_lh_no.h │ │ │ ├── ortho_lh_zo.h │ │ │ ├── ortho_rh_no.h │ │ │ ├── ortho_rh_zo.h │ │ │ ├── persp_lh_no.h │ │ │ ├── persp_lh_zo.h │ │ │ ├── persp_rh_no.h │ │ │ ├── persp_rh_zo.h │ │ │ ├── view_lh_no.h │ │ │ ├── view_lh_zo.h │ │ │ ├── view_rh_no.h │ │ │ └── view_rh_zo.h │ │ ├── color.h │ │ ├── curve.h │ │ ├── euler.h │ │ ├── frustum.h │ │ ├── io.h │ │ ├── mat2.h │ │ ├── mat3.h │ │ ├── mat4.h │ │ ├── plane.h │ │ ├── project.h │ │ ├── quat.h │ │ ├── sphere.h │ │ ├── vec2-ext.h │ │ ├── vec2.h │ │ ├── vec3-ext.h │ │ ├── vec3.h │ │ ├── vec4-ext.h │ │ └── vec4.h │ ├── types-struct.h │ ├── types.h │ ├── util.h │ ├── vec2-ext.h │ ├── vec2.h │ ├── vec3-ext.h │ ├── vec3.h │ ├── vec4-ext.h │ ├── vec4.h │ └── version.h ├── enkiTS │ ├── License.txt │ ├── LockLessMultiReadPipe.h │ ├── TaskScheduler.cpp │ └── TaskScheduler.h ├── imgui │ ├── LICENSE.txt │ ├── TextEditor.cpp │ ├── TextEditor.h │ ├── imconfig.h │ ├── imgui.cpp │ ├── imgui.h │ ├── imgui_demo.cpp │ ├── imgui_draw.cpp │ ├── imgui_impl_sdl.cpp │ ├── imgui_impl_sdl.h │ ├── imgui_internal.h │ ├── imgui_memory_editor.h │ ├── imgui_tables.cpp │ ├── imgui_widgets.cpp │ ├── imstb_rectpack.h │ ├── imstb_textedit.h │ ├── imstb_truetype.h │ └── stb_image.h ├── json.hpp ├── meshoptimizer │ ├── LICENSE.md │ ├── allocator.cpp │ ├── clusterizer.cpp │ ├── indexcodec.cpp │ ├── indexgenerator.cpp │ ├── meshoptimizer.h │ ├── overdrawanalyzer.cpp │ ├── overdrawoptimizer.cpp │ ├── simplifier.cpp │ ├── spatialorder.cpp │ ├── stripifier.cpp │ ├── vcacheanalyzer.cpp │ ├── vcacheoptimizer.cpp │ ├── vertexcodec.cpp │ ├── vertexfilter.cpp │ ├── vfetchanalyzer.cpp │ └── vfetchoptimizer.cpp ├── stb_image.h ├── thsvs.h ├── tlsf.c ├── tlsf.h ├── tracy │ ├── LICENSE │ ├── TracyClient.cpp │ ├── client │ │ ├── TracyAlloc.cpp │ │ ├── TracyArmCpuTable.hpp │ │ ├── TracyCallstack.cpp │ │ ├── TracyCallstack.h │ │ ├── TracyCallstack.hpp │ │ ├── TracyCpuid.hpp │ │ ├── TracyDebug.hpp │ │ ├── TracyDxt1.cpp │ │ ├── TracyDxt1.hpp │ │ ├── TracyFastVector.hpp │ │ ├── TracyLock.hpp │ │ ├── TracyProfiler.cpp │ │ ├── TracyProfiler.hpp │ │ ├── TracyRingBuffer.hpp │ │ ├── TracyScoped.hpp │ │ ├── TracyStringHelpers.hpp │ │ ├── TracySysTime.cpp │ │ ├── TracySysTime.hpp │ │ ├── TracySysTrace.cpp │ │ ├── TracySysTrace.hpp │ │ ├── TracyThread.hpp │ │ ├── tracy_SPSCQueue.h │ │ ├── tracy_concurrentqueue.h │ │ ├── tracy_rpmalloc.cpp │ │ └── tracy_rpmalloc.hpp │ ├── common │ │ ├── TracyAlign.hpp │ │ ├── TracyAlloc.hpp │ │ ├── TracyApi.h │ │ ├── TracyColor.hpp │ │ ├── TracyForceInline.hpp │ │ ├── TracyMutex.hpp │ │ ├── TracyProtocol.hpp │ │ ├── TracyQueue.hpp │ │ ├── TracySocket.cpp │ │ ├── TracySocket.hpp │ │ ├── TracyStackFrames.cpp │ │ ├── TracyStackFrames.hpp │ │ ├── TracySystem.cpp │ │ ├── TracySystem.hpp │ │ ├── TracyUwp.hpp │ │ ├── TracyVersion.hpp │ │ ├── TracyYield.hpp │ │ ├── tracy_lz4.cpp │ │ ├── tracy_lz4.hpp │ │ ├── tracy_lz4hc.cpp │ │ └── tracy_lz4hc.hpp │ ├── libbacktrace │ │ ├── LICENSE │ │ ├── alloc.cpp │ │ ├── backtrace.hpp │ │ ├── config.h │ │ ├── dwarf.cpp │ │ ├── elf.cpp │ │ ├── fileline.cpp │ │ ├── filenames.hpp │ │ ├── internal.hpp │ │ ├── macho.cpp │ │ ├── mmapio.cpp │ │ ├── posix.cpp │ │ ├── sort.cpp │ │ └── state.cpp │ └── tracy │ │ ├── Tracy.hpp │ │ ├── TracyC.h │ │ ├── TracyD3D11.hpp │ │ ├── TracyD3D12.hpp │ │ ├── TracyLua.hpp │ │ ├── TracyOpenCL.hpp │ │ ├── TracyOpenGL.hpp │ │ └── TracyVulkan.hpp ├── vk_mem_alloc.h └── wyhash.h ├── graph.json ├── graph_meshlet.json ├── graph_ray_tracing.json ├── graphics ├── asynchronous_loader.cpp ├── asynchronous_loader.hpp ├── command_buffer.cpp ├── command_buffer.hpp ├── frame_graph.cpp ├── frame_graph.hpp ├── gltf_scene.cpp ├── gltf_scene.hpp ├── gpu_device.cpp ├── gpu_device.hpp ├── gpu_enum.hpp ├── gpu_profiler.cpp ├── gpu_profiler.hpp ├── gpu_resources.cpp ├── gpu_resources.hpp ├── obj_scene.cpp ├── obj_scene.hpp ├── raptor_imgui.cpp ├── raptor_imgui.hpp ├── render_resources_loader.cpp ├── render_resources_loader.hpp ├── render_scene.cpp ├── render_scene.hpp ├── renderer.cpp ├── renderer.hpp ├── scene_graph.cpp ├── scene_graph.hpp ├── spirv_parser.cpp └── spirv_parser.hpp ├── main.cpp ├── raptor ├── application │ ├── application.cpp │ ├── application.hpp │ ├── game_application.cpp │ ├── game_application.hpp │ ├── game_camera.cpp │ ├── game_camera.hpp │ ├── input.cpp │ ├── input.hpp │ ├── keys.cpp │ ├── keys.hpp │ ├── window.cpp │ └── window.hpp └── foundation │ ├── array.hpp │ ├── assert.cpp │ ├── assert.hpp │ ├── bit.cpp │ ├── bit.hpp │ ├── blob.hpp │ ├── blob_serialization.cpp │ ├── blob_serialization.hpp │ ├── camera.cpp │ ├── camera.hpp │ ├── color.cpp │ ├── color.hpp │ ├── data_structures.cpp │ ├── data_structures.hpp │ ├── file.cpp │ ├── file.hpp │ ├── gltf.cpp │ ├── gltf.hpp │ ├── hash_map.hpp │ ├── log.cpp │ ├── log.hpp │ ├── memory.cpp │ ├── memory.hpp │ ├── memory_utils.hpp │ ├── numerics.cpp │ ├── numerics.hpp │ ├── platform.hpp │ ├── process.cpp │ ├── process.hpp │ ├── relative_data_structures.hpp │ ├── resource_manager.cpp │ ├── resource_manager.hpp │ ├── serialization.cpp │ ├── serialization.hpp │ ├── service.cpp │ ├── service.hpp │ ├── service_manager.cpp │ ├── service_manager.hpp │ ├── string.cpp │ ├── string.hpp │ ├── time.cpp │ ├── time.hpp │ └── windows_declarations.h └── shaders ├── cloth.glsl ├── cloth.json ├── culling.glsl ├── culling.h ├── culling.json ├── ddgi.glsl ├── ddgi.h ├── ddgi.json ├── debug.json ├── debug_line.glsl ├── debug_mesh.glsl ├── debug_rendering.h ├── depth.glsl ├── depth_pyramid.glsl ├── depth_skinned.vert ├── dof.glsl ├── dof.json ├── fullscreen.glsl ├── fullscreen.json ├── gbuffer.glsl ├── lighting.h ├── main.json ├── mesh.h ├── meshlet.glsl ├── meshlet.h ├── meshlet.json ├── pbr.glsl ├── pbr_lighting.json ├── platform.h ├── ray_tracing.glsl ├── ray_tracing.json ├── reflections.glsl ├── reflections.json ├── scene.h ├── skinning.glsl ├── transparent.glsl ├── volumetric_fog.glsl └── volumetric_fog.json /.github/workflows/build-cpp.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019-2020-2021 Luca Cappa 2 | # Copyright (c) 2021 AICDG 3 | # Released under the term specified in file LICENSE.txt 4 | # SPDX short identifier: MIT 5 | name: Build with CMake 6 | on: 7 | push: 8 | branches: [ main ] 9 | pull_request: 10 | branches: [ main ] 11 | 12 | jobs: 13 | job: 14 | name: ${{ matrix.os }}-hosted-basic 15 | runs-on: ${{ matrix.os }} 16 | strategy: 17 | fail-fast: false 18 | matrix: 19 | os: [ windows-latest ] 20 | include: 21 | - os: windows-latest 22 | triplet: x64-windows 23 | cxx: cl.exe 24 | cc: cl.exe 25 | 26 | steps: 27 | - uses: actions/checkout@v2 28 | with: 29 | submodules: true 30 | 31 | - uses: lukka/get-cmake@latest 32 | 33 | - uses: ilammy/msvc-dev-cmd@v1 34 | 35 | - name: Set Compiler Environment 36 | uses: lukka/set-shell-env@v1 37 | with: 38 | CXX: ${{ matrix.cxx }} 39 | CC: ${{ matrix.cc }} 40 | 41 | - name: Install Vulkan SDK 42 | uses: humbletim/install-vulkan-sdk@v1.1.1 43 | with: 44 | version: 1.3.243.0 45 | cache: true 46 | 47 | - name: Run CMake+Ninja 48 | uses: lukka/run-cmake@v3 49 | id: runcmake 50 | with: 51 | cmakeGenerator: 'Ninja' 52 | cmakeListsOrSettingsJson: 'CMakeListsTxtBasic' 53 | cmakeListsTxtPath: '${{ github.workspace }}/CMakeLists.txt' 54 | useVcpkgToolchainFile: true 55 | buildWithCMakeArgs: '--config RelWithDebInfo -j 2' 56 | buildDirectory: '${{ runner.workspace }}/b/ninja/' -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | CMakeLists.txt.user 2 | CMakeCache.txt 3 | CMakeFiles 4 | CMakeScripts 5 | Testing 6 | Makefile 7 | cmake_install.cmake 8 | install_manifest.txt 9 | compile_commands.json 10 | CTestTestfile.cmake 11 | _deps 12 | 13 | # IntelliJ project files 14 | .idea 15 | *.iml 16 | out 17 | gen### macOS template 18 | # General 19 | .DS_Store 20 | .AppleDouble 21 | .LSOverride 22 | # Icon must end with two \r 23 | Icon 24 | # Thumbnails 25 | ._* 26 | # Files that might appear in the root of a volume 27 | .DocumentRevisions-V100 28 | .fseventsd 29 | .Spotlight-V100 30 | .TemporaryItems 31 | .Trashes 32 | .VolumeIcon.icns 33 | .com.apple.timemachine.donotpresent 34 | # Directories potentially created on remote AFP share 35 | .AppleDB 36 | .AppleDesktop 37 | Network Trash Folder 38 | Temporary Items 39 | .apdisk 40 | 41 | ### Windows template 42 | # Windows thumbnail cache files 43 | Thumbs.db 44 | ehthumbs.db 45 | ehthumbs_vista.db 46 | # Dump file 47 | *.stackdump 48 | # Folder config file 49 | Desktop.ini 50 | # Recycle Bin used on file shares 51 | $RECYCLE.BIN/ 52 | # Windows Installer files 53 | *.cab 54 | *.msi 55 | *.msm 56 | *.msp 57 | # Windows shortcuts 58 | *.lnk 59 | 60 | cmake-build-* 61 | 62 | /[Bb]in/ 63 | /[Bb]uild/ 64 | /[Dd]ebug/ 65 | /[Rr]elease/ 66 | /**/.vs/ 67 | 68 | # MSVC user extensions 69 | *.opensdf 70 | *.sdf 71 | *.suo 72 | *.user 73 | *.obj 74 | *.pdb 75 | *.idb 76 | *.log 77 | *.tlog 78 | *.lastbuildstate 79 | *.exp 80 | *.opendb 81 | *.ini 82 | *.exe 83 | *.ilk 84 | *.cache 85 | 86 | # Shader binaries 87 | *.spv 88 | 89 | # VS code 90 | .vscode 91 | *.code-workspace 92 | 93 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 CU-Production 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/BUGS.txt: -------------------------------------------------------------------------------- 1 | 2 | Bugs are now managed in the SDL issue tracker, here: 3 | 4 | https://github.com/libsdl-org/SDL/issues 5 | 6 | You may report bugs there, and search to see if a given issue has already 7 | been reported, discussed, and maybe even fixed. 8 | 9 | 10 | You may also find help at the SDL forums/mailing list: 11 | 12 | https://discourse.libsdl.org/ 13 | 14 | Bug reports are welcome here, but we really appreciate if you use the issue 15 | tracker, as bugs discussed on the mailing list may be forgotten or missed. 16 | 17 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2020 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | 21 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/README-SDL.txt: -------------------------------------------------------------------------------- 1 | 2 | Please distribute this file with the SDL runtime environment: 3 | 4 | The Simple DirectMedia Layer (SDL for short) is a cross-platform library 5 | designed to make it easy to write multi-media software, such as games 6 | and emulators. 7 | 8 | The Simple DirectMedia Layer library source code is available from: 9 | https://www.libsdl.org/ 10 | 11 | This library is distributed under the terms of the zlib license: 12 | http://www.zlib.net/zlib_license.html 13 | 14 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/README.txt: -------------------------------------------------------------------------------- 1 | 2 | Simple DirectMedia Layer 3 | 4 | (SDL) 5 | 6 | Version 2.0 7 | 8 | --- 9 | https://www.libsdl.org/ 10 | 11 | Simple DirectMedia Layer is a cross-platform development library designed 12 | to provide low level access to audio, keyboard, mouse, joystick, and graphics 13 | hardware via OpenGL and Direct3D. It is used by video playback software, 14 | emulators, and popular games including Valve's award winning catalog 15 | and many Humble Bundle games. 16 | 17 | More extensive documentation is available in the docs directory, starting 18 | with README.md 19 | 20 | Enjoy! 21 | Sam Lantinga (slouken@libsdl.org) 22 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_copying.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2017 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_name.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | #ifndef SDLname_h_ 23 | #define SDLname_h_ 24 | 25 | #if defined(__STDC__) || defined(__cplusplus) 26 | #define NeedFunctionPrototypes 1 27 | #endif 28 | 29 | #define SDL_NAME(X) SDL_##X 30 | 31 | #endif /* SDLname_h_ */ 32 | 33 | /* vi: set ts=4 sw=4 expandtab: */ 34 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_opengles.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 1.X API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #ifdef __IPHONEOS__ 30 | #include 31 | #include 32 | #else 33 | #include 34 | #include 35 | #endif 36 | 37 | #ifndef APIENTRY 38 | #define APIENTRY 39 | #endif 40 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_opengles2.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_opengles2.h 24 | * 25 | * This is a simple file to encapsulate the OpenGL ES 2.0 API headers. 26 | */ 27 | #include "SDL_config.h" 28 | 29 | #if !defined(_MSC_VER) && !defined(SDL_USE_BUILTIN_OPENGL_DEFINITIONS) 30 | 31 | #ifdef __IPHONEOS__ 32 | #include 33 | #include 34 | #else 35 | #include 36 | #include 37 | #include 38 | #endif 39 | 40 | #else /* _MSC_VER */ 41 | 42 | /* OpenGL ES2 headers for Visual Studio */ 43 | #include "SDL_opengles2_khrplatform.h" 44 | #include "SDL_opengles2_gl2platform.h" 45 | #include "SDL_opengles2_gl2.h" 46 | #include "SDL_opengles2_gl2ext.h" 47 | 48 | #endif /* _MSC_VER */ 49 | 50 | #ifndef APIENTRY 51 | #define APIENTRY GL_APIENTRY 52 | #endif 53 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_opengles2_gl2platform.h: -------------------------------------------------------------------------------- 1 | #ifndef __gl2platform_h_ 2 | #define __gl2platform_h_ 3 | 4 | /* $Revision: 10602 $ on $Date:: 2010-03-04 22:35:34 -0800 #$ */ 5 | 6 | /* 7 | * This document is licensed under the SGI Free Software B License Version 8 | * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ . 9 | */ 10 | 11 | /* Platform-specific types and definitions for OpenGL ES 2.X gl2.h 12 | * 13 | * Adopters may modify khrplatform.h and this file to suit their platform. 14 | * You are encouraged to submit all modifications to the Khronos group so that 15 | * they can be included in future versions of this file. Please submit changes 16 | * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 17 | * by filing a bug against product "OpenGL-ES" component "Registry". 18 | */ 19 | 20 | /*#include */ 21 | 22 | #ifndef GL_APICALL 23 | #define GL_APICALL KHRONOS_APICALL 24 | #endif 25 | 26 | #ifndef GL_APIENTRY 27 | #define GL_APIENTRY KHRONOS_APIENTRY 28 | #endif 29 | 30 | #endif /* __gl2platform_h_ */ 31 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_quit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_quit.h 24 | * 25 | * Include file for SDL quit event handling. 26 | */ 27 | 28 | #ifndef SDL_quit_h_ 29 | #define SDL_quit_h_ 30 | 31 | #include "SDL_stdinc.h" 32 | #include "SDL_error.h" 33 | 34 | /** 35 | * \file SDL_quit.h 36 | * 37 | * An ::SDL_QUIT event is generated when the user tries to close the application 38 | * window. If it is ignored or filtered out, the window will remain open. 39 | * If it is not ignored or filtered, it is queued normally and the window 40 | * is allowed to close. When the window is closed, screen updates will 41 | * complete, but have no effect. 42 | * 43 | * SDL_Init() installs signal handlers for SIGINT (keyboard interrupt) 44 | * and SIGTERM (system termination request), if handlers do not already 45 | * exist, that generate ::SDL_QUIT events as well. There is no way 46 | * to determine the cause of an ::SDL_QUIT event, but setting a signal 47 | * handler in your application will override the default generation of 48 | * quit events for that signal. 49 | * 50 | * \sa SDL_Quit() 51 | */ 52 | 53 | /* There are no functions directly affecting the quit event */ 54 | 55 | #define SDL_QuitRequested() \ 56 | (SDL_PumpEvents(), (SDL_PeepEvents(NULL,0,SDL_PEEKEVENT,SDL_QUIT,SDL_QUIT) > 0)) 57 | 58 | #endif /* SDL_quit_h_ */ 59 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_revision.h: -------------------------------------------------------------------------------- 1 | #define SDL_REVISION "https://github.com/libsdl-org/SDL.git@2e9821423a237a1206e3c09020778faacfe430be" 2 | #define SDL_REVISION_NUMBER 0 3 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_test.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_h_ 31 | #define SDL_test_h_ 32 | 33 | #include "SDL.h" 34 | #include "SDL_test_assert.h" 35 | #include "SDL_test_common.h" 36 | #include "SDL_test_compare.h" 37 | #include "SDL_test_crc32.h" 38 | #include "SDL_test_font.h" 39 | #include "SDL_test_fuzzer.h" 40 | #include "SDL_test_harness.h" 41 | #include "SDL_test_images.h" 42 | #include "SDL_test_log.h" 43 | #include "SDL_test_md5.h" 44 | #include "SDL_test_memory.h" 45 | #include "SDL_test_random.h" 46 | 47 | #include "begin_code.h" 48 | /* Set up for C function definitions, even when using C++ */ 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | /* Global definitions */ 54 | 55 | /* 56 | * Note: Maximum size of SDLTest log message is less than SDL's limit 57 | * to ensure we can fit additional information such as the timestamp. 58 | */ 59 | #define SDLTEST_MAX_LOGMESSAGE_LENGTH 3584 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_test_compare.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_compare.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines comparison functions (i.e. for surfaces). 33 | 34 | */ 35 | 36 | #ifndef SDL_test_compare_h_ 37 | #define SDL_test_compare_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "SDL_test_images.h" 42 | 43 | #include "begin_code.h" 44 | /* Set up for C function definitions, even when using C++ */ 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | /** 50 | * \brief Compares a surface and with reference image data for equality 51 | * 52 | * \param surface Surface used in comparison 53 | * \param referenceSurface Test Surface used in comparison 54 | * \param allowable_error Allowable difference (=sum of squared difference for each RGB component) in blending accuracy. 55 | * 56 | * \returns 0 if comparison succeeded, >0 (=number of pixels for which the comparison failed) if comparison failed, -1 if any of the surfaces were NULL, -2 if the surface sizes differ. 57 | */ 58 | int SDLTest_CompareSurfaces(SDL_Surface *surface, SDL_Surface *referenceSurface, int allowable_error); 59 | 60 | 61 | /* Ends C function definitions when using C++ */ 62 | #ifdef __cplusplus 63 | } 64 | #endif 65 | #include "close_code.h" 66 | 67 | #endif /* SDL_test_compare_h_ */ 68 | 69 | /* vi: set ts=4 sw=4 expandtab: */ 70 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_test_images.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_images.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | 32 | Defines some images for tests. 33 | 34 | */ 35 | 36 | #ifndef SDL_test_images_h_ 37 | #define SDL_test_images_h_ 38 | 39 | #include "SDL.h" 40 | 41 | #include "begin_code.h" 42 | /* Set up for C function definitions, even when using C++ */ 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | /** 48 | *Type for test images. 49 | */ 50 | typedef struct SDLTest_SurfaceImage_s { 51 | int width; 52 | int height; 53 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ 54 | const char *pixel_data; 55 | } SDLTest_SurfaceImage_t; 56 | 57 | /* Test images */ 58 | SDL_Surface *SDLTest_ImageBlit(void); 59 | SDL_Surface *SDLTest_ImageBlitColor(void); 60 | SDL_Surface *SDLTest_ImageBlitAlpha(void); 61 | SDL_Surface *SDLTest_ImageBlitBlendAdd(void); 62 | SDL_Surface *SDLTest_ImageBlitBlend(void); 63 | SDL_Surface *SDLTest_ImageBlitBlendMod(void); 64 | SDL_Surface *SDLTest_ImageBlitBlendNone(void); 65 | SDL_Surface *SDLTest_ImageBlitBlendAll(void); 66 | SDL_Surface *SDLTest_ImageFace(void); 67 | SDL_Surface *SDLTest_ImagePrimitives(void); 68 | SDL_Surface *SDLTest_ImagePrimitivesBlend(void); 69 | 70 | /* Ends C function definitions when using C++ */ 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | #include "close_code.h" 75 | 76 | #endif /* SDL_test_images_h_ */ 77 | 78 | /* vi: set ts=4 sw=4 expandtab: */ 79 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_test_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_log.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | /* 31 | * 32 | * Wrapper to log in the TEST category 33 | * 34 | */ 35 | 36 | #ifndef SDL_test_log_h_ 37 | #define SDL_test_log_h_ 38 | 39 | #include "begin_code.h" 40 | /* Set up for C function definitions, even when using C++ */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * \brief Prints given message with a timestamp in the TEST category and INFO priority. 47 | * 48 | * \param fmt Message to be logged 49 | */ 50 | void SDLTest_Log(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 51 | 52 | /** 53 | * \brief Prints given message with a timestamp in the TEST category and the ERROR priority. 54 | * 55 | * \param fmt Message to be logged 56 | */ 57 | void SDLTest_LogError(SDL_PRINTF_FORMAT_STRING const char *fmt, ...) SDL_PRINTF_VARARG_FUNC(1); 58 | 59 | /* Ends C function definitions when using C++ */ 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | #include "close_code.h" 64 | 65 | #endif /* SDL_test_log_h_ */ 66 | 67 | /* vi: set ts=4 sw=4 expandtab: */ 68 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_test_memory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_test_memory.h 24 | * 25 | * Include file for SDL test framework. 26 | * 27 | * This code is a part of the SDL2_test library, not the main SDL library. 28 | */ 29 | 30 | #ifndef SDL_test_memory_h_ 31 | #define SDL_test_memory_h_ 32 | 33 | #include "begin_code.h" 34 | /* Set up for C function definitions, even when using C++ */ 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | /** 41 | * \brief Start tracking SDL memory allocations 42 | * 43 | * \note This should be called before any other SDL functions for complete tracking coverage 44 | */ 45 | int SDLTest_TrackAllocations(void); 46 | 47 | /** 48 | * \brief Print a log of any outstanding allocations 49 | * 50 | * \note This can be called after SDL_Quit() 51 | */ 52 | void SDLTest_LogAllocations(void); 53 | 54 | 55 | /* Ends C function definitions when using C++ */ 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | #include "close_code.h" 60 | 61 | #endif /* SDL_test_memory_h_ */ 62 | 63 | /* vi: set ts=4 sw=4 expandtab: */ 64 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/SDL_types.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file SDL_types.h 24 | * 25 | * \deprecated 26 | */ 27 | 28 | /* DEPRECATED */ 29 | #include "SDL_stdinc.h" 30 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/include/close_code.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple DirectMedia Layer 3 | Copyright (C) 1997-2021 Sam Lantinga 4 | 5 | This software is provided 'as-is', without any express or implied 6 | warranty. In no event will the authors be held liable for any damages 7 | arising from the use of this software. 8 | 9 | Permission is granted to anyone to use this software for any purpose, 10 | including commercial applications, and to alter it and redistribute it 11 | freely, subject to the following restrictions: 12 | 13 | 1. The origin of this software must not be misrepresented; you must not 14 | claim that you wrote the original software. If you use this software 15 | in a product, an acknowledgment in the product documentation would be 16 | appreciated but is not required. 17 | 2. Altered source versions must be plainly marked as such, and must not be 18 | misrepresented as being the original software. 19 | 3. This notice may not be removed or altered from any source distribution. 20 | */ 21 | 22 | /** 23 | * \file close_code.h 24 | * 25 | * This file reverses the effects of begin_code.h and should be included 26 | * after you finish any function and structure declarations in your headers 27 | */ 28 | 29 | #ifndef _begin_code_h 30 | #error close_code.h included without matching begin_code.h 31 | #endif 32 | #undef _begin_code_h 33 | 34 | /* Reset structure packing at previous byte alignment */ 35 | #if defined(_MSC_VER) || defined(__MWERKS__) || defined(__BORLANDC__) 36 | #ifdef __BORLANDC__ 37 | #pragma nopackwarning 38 | #endif 39 | #pragma pack(pop) 40 | #endif /* Compiler needs structure packing set */ 41 | -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x64/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x64/SDL2.dll -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x64/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x64/SDL2.lib -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x64/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x64/SDL2main.lib -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x64/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x64/SDL2test.lib -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x86/SDL2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x86/SDL2.dll -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x86/SDL2.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x86/SDL2.lib -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x86/SDL2main.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x86/SDL2main.lib -------------------------------------------------------------------------------- /binaries/SDL2-2.0.18/lib/x86/SDL2test.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/SDL2-2.0.18/lib/x86/SDL2test.lib -------------------------------------------------------------------------------- /binaries/assimp/include/assimp/ColladaMetaData.h: -------------------------------------------------------------------------------- 1 | /* 2 | Open Asset Import Library (assimp) 3 | ---------------------------------------------------------------------- 4 | 5 | Copyright (c) 2006-2022, assimp team 6 | 7 | All rights reserved. 8 | 9 | Redistribution and use of this software in source and binary forms, 10 | with or without modification, are permitted provided that the 11 | following conditions are met: 12 | 13 | * Redistributions of source code must retain the above 14 | copyright notice, this list of conditions and the 15 | following disclaimer. 16 | 17 | * Redistributions in binary form must reproduce the above 18 | copyright notice, this list of conditions and the 19 | following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | * Neither the name of the assimp team, nor the names of its 23 | contributors may be used to endorse or promote products 24 | derived from this software without specific prior 25 | written permission of the assimp team. 26 | 27 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 30 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 31 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 32 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 33 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 34 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 35 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 36 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 37 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 38 | 39 | ---------------------------------------------------------------------- 40 | */ 41 | 42 | /** @file ColladaMetaData.h 43 | * Declares common metadata constants used by Collada files 44 | */ 45 | #pragma once 46 | #ifndef AI_COLLADAMETADATA_H_INC 47 | #define AI_COLLADAMETADATA_H_INC 48 | 49 | #ifdef __GNUC__ 50 | #pragma GCC system_header 51 | #endif 52 | 53 | #define AI_METADATA_COLLADA_ID "Collada_id" 54 | #define AI_METADATA_COLLADA_SID "Collada_sid" 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /binaries/assimp/include/assimp/Compiler/poppack1.h: -------------------------------------------------------------------------------- 1 | 2 | // =============================================================================== 3 | // May be included multiple times - resets structure packing to the defaults 4 | // for all supported compilers. Reverts the changes made by #include 5 | // 6 | // Currently this works on the following compilers: 7 | // MSVC 7,8,9 8 | // GCC 9 | // BORLAND (complains about 'pack state changed but not reverted', but works) 10 | // =============================================================================== 11 | 12 | #ifndef AI_PUSHPACK_IS_DEFINED 13 | # error pushpack1.h must be included after poppack1.h 14 | #endif 15 | 16 | // reset packing to the original value 17 | #if (defined(_MSC_VER) && !defined(__clang__)) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 18 | # pragma pack( pop ) 19 | #endif 20 | #undef PACK_STRUCT 21 | 22 | #undef AI_PUSHPACK_IS_DEFINED 23 | -------------------------------------------------------------------------------- /binaries/assimp/include/assimp/Compiler/pushpack1.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | // =============================================================================== 4 | // May be included multiple times - sets structure packing to 1 5 | // for all supported compilers. #include reverts the changes. 6 | // 7 | // Currently this works on the following compilers: 8 | // MSVC 7,8,9 9 | // GCC 10 | // BORLAND (complains about 'pack state changed but not reverted', but works) 11 | // Clang 12 | // 13 | // 14 | // USAGE: 15 | // 16 | // struct StructToBePacked { 17 | // } PACK_STRUCT; 18 | // 19 | // =============================================================================== 20 | 21 | #ifdef AI_PUSHPACK_IS_DEFINED 22 | # error poppack1.h must be included after pushpack1.h 23 | #endif 24 | 25 | #if (defined(_MSC_VER) && !defined(__clang__)) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) 26 | # pragma pack(push,1) 27 | # define PACK_STRUCT 28 | #elif defined( __GNUC__ ) || defined(__clang__) 29 | # if !defined(HOST_MINGW) 30 | # define PACK_STRUCT __attribute__((__packed__)) 31 | # else 32 | # define PACK_STRUCT __attribute__((gcc_struct, __packed__)) 33 | # endif 34 | #else 35 | # error Compiler not supported 36 | #endif 37 | 38 | #if defined(_MSC_VER) 39 | // C4103: Packing was changed after the inclusion of the header, probably missing #pragma pop 40 | # pragma warning (disable : 4103) 41 | #endif 42 | 43 | #define AI_PUSHPACK_IS_DEFINED 44 | -------------------------------------------------------------------------------- /binaries/assimp/linux/lib/libassimp.so: -------------------------------------------------------------------------------- 1 | libassimp.so.5 -------------------------------------------------------------------------------- /binaries/assimp/linux/lib/libassimp.so.5: -------------------------------------------------------------------------------- 1 | libassimp.so.5.2.0 -------------------------------------------------------------------------------- /binaries/assimp/linux/lib/libassimp.so.5.2.0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/assimp/linux/lib/libassimp.so.5.2.0 -------------------------------------------------------------------------------- /binaries/assimp/windows/bin/assimp-vc142-mt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/assimp/windows/bin/assimp-vc142-mt.dll -------------------------------------------------------------------------------- /binaries/assimp/windows/lib/assimp-vc142-mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/assimp/windows/lib/assimp-vc142-mt.lib -------------------------------------------------------------------------------- /binaries/assimp/windows/lib/zlibstatic.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/assimp/windows/lib/zlibstatic.lib -------------------------------------------------------------------------------- /binaries/data/BayerDither4x4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/data/BayerDither4x4.png -------------------------------------------------------------------------------- /binaries/data/BayerDither8x8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/data/BayerDither8x8.png -------------------------------------------------------------------------------- /binaries/data/LDR_RG01_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/binaries/data/LDR_RG01_0.png -------------------------------------------------------------------------------- /binaries/data/cone.mtl: -------------------------------------------------------------------------------- 1 | # Blender 3.1.0 MTL File: 'None' 2 | # www.blender.org 3 | -------------------------------------------------------------------------------- /binaries/data/plane.mtl: -------------------------------------------------------------------------------- 1 | # Blender 3.1.0 MTL File: 'None' 2 | # www.blender.org 3 | -------------------------------------------------------------------------------- /binaries/data/sphere.mtl: -------------------------------------------------------------------------------- 1 | # Blender 3.1.0 MTL File: 'None' 2 | # www.blender.org 3 | -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-03_11-50-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-03_11-50-50.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-06_22-58-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-06_22-58-24.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-06_22-58-34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-06_22-58-34.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-06_22-59-18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-06_22-59-18.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-07_23-23-35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-07_23-23-35.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-07_23-24-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-07_23-24-09.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-09_22-19-27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-09_22-19-27.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-09_22-19-35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-09_22-19-35.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-10_00-03-42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-10_00-03-42.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-10_19-53-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-10_19-53-16.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-10_23-16-09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-10_23-16-09.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-10_23-16-18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-10_23-16-18.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-13_20-46-51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-13_20-46-51.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-13_20-46-57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-13_20-46-57.png -------------------------------------------------------------------------------- /screenshots/Snipaste_2023-06-13_21-23-06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/screenshots/Snipaste_2023-06-13_21-23-06.png -------------------------------------------------------------------------------- /source/external/cglm/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Recep Aslantas 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/external/cglm/applesimd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_applesimd_h 9 | #define cglm_applesimd_h 10 | #if defined(__APPLE__) \ 11 | && defined(SIMD_COMPILER_HAS_REQUIRED_FEATURES) \ 12 | && defined(SIMD_BASE) \ 13 | && defined(SIMD_TYPES) \ 14 | && defined(SIMD_VECTOR_TYPES) 15 | 16 | #include "common.h" 17 | 18 | /*! 19 | * @brief converts mat4 to Apple's simd type simd_float4x4 20 | * @return simd_float4x4 21 | */ 22 | CGLM_INLINE 23 | simd_float4x4 24 | glm_mat4_applesimd(mat4 m) { 25 | simd_float4x4 t; 26 | 27 | t.columns[0][0] = m[0][0]; 28 | t.columns[0][1] = m[0][1]; 29 | t.columns[0][2] = m[0][2]; 30 | t.columns[0][3] = m[0][3]; 31 | 32 | t.columns[1][0] = m[1][0]; 33 | t.columns[1][1] = m[1][1]; 34 | t.columns[1][2] = m[1][2]; 35 | t.columns[1][3] = m[1][3]; 36 | 37 | t.columns[2][0] = m[2][0]; 38 | t.columns[2][1] = m[2][1]; 39 | t.columns[2][2] = m[2][2]; 40 | t.columns[2][3] = m[2][3]; 41 | 42 | t.columns[3][0] = m[3][0]; 43 | t.columns[3][1] = m[3][1]; 44 | t.columns[3][2] = m[3][2]; 45 | t.columns[3][3] = m[3][3]; 46 | 47 | return t; 48 | } 49 | 50 | /*! 51 | * @brief converts mat3 to Apple's simd type simd_float3x3 52 | * @return simd_float3x3 53 | */ 54 | CGLM_INLINE 55 | simd_float3x3 56 | glm_mat3_applesimd(mat3 m) { 57 | simd_float3x3 t; 58 | 59 | t.columns[0][0] = m[0][0]; 60 | t.columns[0][1] = m[0][1]; 61 | t.columns[0][2] = m[0][2]; 62 | 63 | t.columns[1][0] = m[1][0]; 64 | t.columns[1][1] = m[1][1]; 65 | t.columns[1][2] = m[1][2]; 66 | 67 | t.columns[2][0] = m[2][0]; 68 | t.columns[2][1] = m[2][1]; 69 | t.columns[2][2] = m[2][2]; 70 | 71 | return t; 72 | } 73 | 74 | /*! 75 | * @brief converts vec4 to Apple's simd type simd_float4 76 | * @return simd_float4 77 | */ 78 | CGLM_INLINE 79 | simd_float4 80 | glm_vec4_applesimd(vec4 v) { 81 | return (simd_float4){v[0], v[1], v[2], v[3]}; 82 | } 83 | 84 | /*! 85 | * @brief converts vec3 to Apple's simd type simd_float3 86 | * @return v 87 | */ 88 | CGLM_INLINE 89 | simd_float3 90 | glm_vec3_applesimd(vec3 v) { 91 | return (simd_float3){v[0], v[1], v[2]}; 92 | } 93 | 94 | #endif 95 | #endif /* cglm_applesimd_h */ 96 | -------------------------------------------------------------------------------- /source/external/cglm/call.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_call_h 9 | #define cglm_call_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "cglm.h" 15 | #include "call/vec2.h" 16 | #include "call/vec3.h" 17 | #include "call/vec4.h" 18 | #include "call/mat2.h" 19 | #include "call/mat3.h" 20 | #include "call/mat4.h" 21 | #include "call/affine.h" 22 | #include "call/cam.h" 23 | #include "call/quat.h" 24 | #include "call/euler.h" 25 | #include "call/plane.h" 26 | #include "call/frustum.h" 27 | #include "call/box.h" 28 | #include "call/io.h" 29 | #include "call/project.h" 30 | #include "call/sphere.h" 31 | #include "call/ease.h" 32 | #include "call/curve.h" 33 | #include "call/bezier.h" 34 | #include "call/ray.h" 35 | #include "call/affine2d.h" 36 | 37 | #ifdef __cplusplus 38 | } 39 | #endif 40 | #endif /* cglm_call_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/call/affine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_affine_h 9 | #define cglmc_affine_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_translate_make(mat4 m, vec3 v); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_translate_to(mat4 m, vec3 v, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_translate(mat4 m, vec3 v); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_translate_x(mat4 m, float to); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_translate_y(mat4 m, float to); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_translate_z(mat4 m, float to); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_scale_make(mat4 m, vec3 v); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_scale_to(mat4 m, vec3 v, mat4 dest); 47 | 48 | CGLM_EXPORT 49 | void 50 | glmc_scale(mat4 m, vec3 v); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_scale_uni(mat4 m, float s); 55 | 56 | CGLM_EXPORT 57 | void 58 | glmc_rotate_x(mat4 m, float rad, mat4 dest); 59 | 60 | CGLM_EXPORT 61 | void 62 | glmc_rotate_y(mat4 m, float rad, mat4 dest); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_rotate_z(mat4 m, float rad, mat4 dest); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_rotate_make(mat4 m, float angle, vec3 axis); 71 | 72 | CGLM_EXPORT 73 | void 74 | glmc_rotate(mat4 m, float angle, vec3 axis); 75 | 76 | CGLM_EXPORT 77 | void 78 | glmc_rotate_at(mat4 m, vec3 pivot, float angle, vec3 axis); 79 | 80 | CGLM_EXPORT 81 | void 82 | glmc_rotate_atm(mat4 m, vec3 pivot, float angle, vec3 axis); 83 | 84 | CGLM_EXPORT 85 | void 86 | glmc_decompose_scalev(mat4 m, vec3 s); 87 | 88 | CGLM_EXPORT 89 | bool 90 | glmc_uniscaled(mat4 m); 91 | 92 | CGLM_EXPORT 93 | void 94 | glmc_decompose_rs(mat4 m, mat4 r, vec3 s); 95 | 96 | CGLM_EXPORT 97 | void 98 | glmc_decompose(mat4 m, vec4 t, mat4 r, vec3 s); 99 | 100 | /* affine-mat */ 101 | 102 | CGLM_EXPORT 103 | void 104 | glmc_mul(mat4 m1, mat4 m2, mat4 dest); 105 | 106 | CGLM_EXPORT 107 | void 108 | glmc_mul_rot(mat4 m1, mat4 m2, mat4 dest); 109 | 110 | CGLM_EXPORT 111 | void 112 | glmc_inv_tr(mat4 mat); 113 | 114 | #ifdef __cplusplus 115 | } 116 | #endif 117 | #endif /* cglmc_affine_h */ 118 | -------------------------------------------------------------------------------- /source/external/cglm/call/affine2d.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_affine2d_h 9 | #define cglmc_affine2d_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_translate2d_make(mat3 m, vec2 v); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_translate2d_to(mat3 m, vec2 v, mat3 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_translate2d(mat3 m, vec2 v); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_translate2d_x(mat3 m, float to); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_translate2d_y(mat3 m, float to); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_scale2d_to(mat3 m, vec2 v, mat3 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_scale2d_make(mat3 m, vec2 v); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_scale2d(mat3 m, vec2 v); 47 | 48 | CGLM_EXPORT 49 | void 50 | glmc_scale2d_uni(mat3 m, float s); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_rotate2d_make(mat3 m, float angle); 55 | 56 | CGLM_EXPORT 57 | void 58 | glmc_rotate2d(mat3 m, float angle); 59 | 60 | CGLM_EXPORT 61 | void 62 | glmc_rotate2d_to(mat3 m, float angle, mat3 dest); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | #endif /* cglmc_affine2d_h */ 68 | -------------------------------------------------------------------------------- /source/external/cglm/call/bezier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_bezier_h 9 | #define cglmc_bezier_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | float 18 | glmc_bezier(float s, float p0, float c0, float c1, float p1); 19 | 20 | CGLM_EXPORT 21 | float 22 | glmc_hermite(float s, float p0, float t0, float t1, float p1); 23 | 24 | CGLM_EXPORT 25 | float 26 | glmc_decasteljau(float prm, float p0, float c0, float c1, float p1); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_bezier_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/box.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_box_h 9 | #define cglmc_box_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_aabb_transform(vec3 box[2], mat4 m, vec3 dest[2]); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_aabb_merge(vec3 box1[2], vec3 box2[2], vec3 dest[2]); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_aabb_crop(vec3 box[2], vec3 cropBox[2], vec3 dest[2]); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_aabb_crop_until(vec3 box[2], 31 | vec3 cropBox[2], 32 | vec3 clampBox[2], 33 | vec3 dest[2]); 34 | 35 | CGLM_EXPORT 36 | bool 37 | glmc_aabb_frustum(vec3 box[2], vec4 planes[6]); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_aabb_invalidate(vec3 box[2]); 42 | 43 | CGLM_EXPORT 44 | bool 45 | glmc_aabb_isvalid(vec3 box[2]); 46 | 47 | CGLM_EXPORT 48 | float 49 | glmc_aabb_size(vec3 box[2]); 50 | 51 | CGLM_EXPORT 52 | float 53 | glmc_aabb_radius(vec3 box[2]); 54 | 55 | CGLM_EXPORT 56 | void 57 | glmc_aabb_center(vec3 box[2], vec3 dest); 58 | 59 | CGLM_EXPORT 60 | bool 61 | glmc_aabb_aabb(vec3 box[2], vec3 other[2]); 62 | 63 | CGLM_EXPORT 64 | bool 65 | glmc_aabb_point(vec3 box[2], vec3 point); 66 | 67 | CGLM_EXPORT 68 | bool 69 | glmc_aabb_contains(vec3 box[2], vec3 other[2]); 70 | 71 | CGLM_EXPORT 72 | bool 73 | glmc_aabb_sphere(vec3 box[2], vec4 s); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | #endif /* cglmc_box_h */ 79 | 80 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_lh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_lh_no_h 9 | #define cglmc_ortho_lh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_lh_no(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_lh_no(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_lh_no(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_lh_no(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_lh_no(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_lh_no(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_lh_no_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_lh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_lh_zo_h 9 | #define cglmc_ortho_lh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_lh_zo(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_lh_zo(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_lh_zo(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_lh_zo(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_lh_zo(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_lh_zo(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_lh_zo_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_rh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_rh_no_h 9 | #define cglmc_ortho_rh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_rh_no(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_rh_no(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_rh_no(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_rh_no(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_rh_no(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_rh_no(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_rh_no_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/ortho_rh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ortho_rh_zo_h 9 | #define cglmc_ortho_rh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_ortho_rh_zo(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_ortho_aabb_rh_zo(vec3 box[2], mat4 dest); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_ortho_aabb_p_rh_zo(vec3 box[2], float padding, mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_ortho_aabb_pz_rh_zo(vec3 box[2], float padding, mat4 dest); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_ortho_default_rh_zo(float aspect, mat4 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_ortho_default_s_rh_zo(float aspect, float size, mat4 dest); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | #endif /* cglmc_ortho_rh_zo_h */ 47 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/persp_lh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_persp_lh_no_h 9 | #define cglmc_persp_lh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_frustum_lh_no(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_perspective_lh_no(float fovy, 26 | float aspect, 27 | float nearVal, 28 | float farVal, 29 | mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_persp_move_far_lh_no(mat4 proj, float deltaFar); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_persp_decomp_lh_no(mat4 proj, 38 | float * __restrict nearZ, float * __restrict farZ, 39 | float * __restrict top, float * __restrict bottom, 40 | float * __restrict left, float * __restrict right); 41 | 42 | CGLM_EXPORT 43 | void 44 | glmc_persp_decompv_lh_no(mat4 proj, float dest[6]); 45 | 46 | CGLM_EXPORT 47 | void 48 | glmc_persp_decomp_x_lh_no(mat4 proj, 49 | float * __restrict left, 50 | float * __restrict right); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_persp_decomp_y_lh_no(mat4 proj, 55 | float * __restrict top, 56 | float * __restrict bottom); 57 | 58 | CGLM_EXPORT 59 | void 60 | glmc_persp_decomp_z_lh_no(mat4 proj, 61 | float * __restrict nearZ, 62 | float * __restrict farZ); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_persp_decomp_far_lh_no(mat4 proj, float * __restrict farZ); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_persp_decomp_near_lh_no(mat4 proj, float * __restrict nearZ); 71 | 72 | CGLM_EXPORT 73 | void 74 | glmc_persp_sizes_lh_no(mat4 proj, float fovy, vec4 dest); 75 | 76 | CGLM_EXPORT 77 | float 78 | glmc_persp_fovy_lh_no(mat4 proj); 79 | 80 | CGLM_EXPORT 81 | float 82 | glmc_persp_aspect_lh_no(mat4 proj); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | #endif /* cglmc_persp_lh_no_h */ 88 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/persp_lh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_persp_lh_zo_h 9 | #define cglmc_persp_lh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_frustum_lh_zo(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_perspective_lh_zo(float fovy, 26 | float aspect, 27 | float nearVal, 28 | float farVal, 29 | mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_persp_move_far_lh_zo(mat4 proj, float deltaFar); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_persp_decomp_lh_zo(mat4 proj, 38 | float * __restrict nearZ, float * __restrict farZ, 39 | float * __restrict top, float * __restrict bottom, 40 | float * __restrict left, float * __restrict right); 41 | 42 | CGLM_EXPORT 43 | void 44 | glmc_persp_decompv_lh_zo(mat4 proj, float dest[6]); 45 | 46 | CGLM_EXPORT 47 | void 48 | glmc_persp_decomp_x_lh_zo(mat4 proj, 49 | float * __restrict left, 50 | float * __restrict right); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_persp_decomp_y_lh_zo(mat4 proj, 55 | float * __restrict top, 56 | float * __restrict bottom); 57 | 58 | CGLM_EXPORT 59 | void 60 | glmc_persp_decomp_z_lh_zo(mat4 proj, 61 | float * __restrict nearZ, 62 | float * __restrict farZ); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_persp_decomp_far_lh_zo(mat4 proj, float * __restrict farZ); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_persp_decomp_near_lh_zo(mat4 proj, float * __restrict nearZ); 71 | 72 | CGLM_EXPORT 73 | void 74 | glmc_persp_sizes_lh_zo(mat4 proj, float fovy, vec4 dest); 75 | 76 | CGLM_EXPORT 77 | float 78 | glmc_persp_fovy_lh_zo(mat4 proj); 79 | 80 | CGLM_EXPORT 81 | float 82 | glmc_persp_aspect_lh_zo(mat4 proj); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | #endif /* cglmc_persp_lh_zo_h */ 88 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/persp_rh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_persp_rh_no_h 9 | #define cglmc_persp_rh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_frustum_rh_no(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_perspective_rh_no(float fovy, 26 | float aspect, 27 | float nearVal, 28 | float farVal, 29 | mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_persp_move_far_rh_no(mat4 proj, float deltaFar); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_persp_decomp_rh_no(mat4 proj, 38 | float * __restrict nearZ, float * __restrict farZ, 39 | float * __restrict top, float * __restrict bottom, 40 | float * __restrict left, float * __restrict right); 41 | 42 | CGLM_EXPORT 43 | void 44 | glmc_persp_decompv_rh_no(mat4 proj, float dest[6]); 45 | 46 | CGLM_EXPORT 47 | void 48 | glmc_persp_decomp_x_rh_no(mat4 proj, 49 | float * __restrict left, 50 | float * __restrict right); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_persp_decomp_y_rh_no(mat4 proj, 55 | float * __restrict top, 56 | float * __restrict bottom); 57 | 58 | CGLM_EXPORT 59 | void 60 | glmc_persp_decomp_z_rh_no(mat4 proj, 61 | float * __restrict nearZ, 62 | float * __restrict farZ); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_persp_decomp_far_rh_no(mat4 proj, float * __restrict farZ); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_persp_decomp_near_rh_no(mat4 proj, float * __restrict nearZ); 71 | 72 | CGLM_EXPORT 73 | void 74 | glmc_persp_sizes_rh_no(mat4 proj, float fovy, vec4 dest); 75 | 76 | CGLM_EXPORT 77 | float 78 | glmc_persp_fovy_rh_no(mat4 proj); 79 | 80 | CGLM_EXPORT 81 | float 82 | glmc_persp_aspect_rh_no(mat4 proj); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | #endif /* cglmc_persp_rh_no_h */ 88 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/persp_rh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_persp_rh_zo_h 9 | #define cglmc_persp_rh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_frustum_rh_zo(float left, float right, 19 | float bottom, float top, 20 | float nearZ, float farZ, 21 | mat4 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_perspective_rh_zo(float fovy, 26 | float aspect, 27 | float nearVal, 28 | float farVal, 29 | mat4 dest); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_persp_move_far_rh_zo(mat4 proj, float deltaFar); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_persp_decomp_rh_zo(mat4 proj, 38 | float * __restrict nearZ, float * __restrict farZ, 39 | float * __restrict top, float * __restrict bottom, 40 | float * __restrict left, float * __restrict right); 41 | 42 | CGLM_EXPORT 43 | void 44 | glmc_persp_decompv_rh_zo(mat4 proj, float dest[6]); 45 | 46 | CGLM_EXPORT 47 | void 48 | glmc_persp_decomp_x_rh_zo(mat4 proj, 49 | float * __restrict left, 50 | float * __restrict right); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_persp_decomp_y_rh_zo(mat4 proj, 55 | float * __restrict top, 56 | float * __restrict bottom); 57 | 58 | CGLM_EXPORT 59 | void 60 | glmc_persp_decomp_z_rh_zo(mat4 proj, 61 | float * __restrict nearZ, 62 | float * __restrict farZ); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_persp_decomp_far_rh_zo(mat4 proj, float * __restrict farZ); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_persp_decomp_near_rh_zo(mat4 proj, float * __restrict nearZ); 71 | 72 | CGLM_EXPORT 73 | void 74 | glmc_persp_sizes_rh_zo(mat4 proj, float fovy, vec4 dest); 75 | 76 | CGLM_EXPORT 77 | float 78 | glmc_persp_fovy_rh_zo(mat4 proj); 79 | 80 | CGLM_EXPORT 81 | float 82 | glmc_persp_aspect_rh_zo(mat4 proj); 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | #endif /* cglmc_persp_rh_zo_h */ 88 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/project_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_project_no_h 9 | #define cglmc_project_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_unprojecti_no(vec3 pos, mat4 invMat, vec4 vp, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_project_no(vec3 pos, mat4 m, vec4 vp, vec3 dest); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* cglmc_project_no_h */ 28 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/project_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_project_zo_h 9 | #define cglmc_project_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_unprojecti_zo(vec3 pos, mat4 invMat, vec4 vp, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_project_zo(vec3 pos, mat4 m, vec4 vp, vec3 dest); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* cglmc_project_zo_h */ 28 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_lh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_lh_no_h 9 | #define cglmc_view_lh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_lh_no(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_lh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_lh_no(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_lh_no_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_lh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_lh_zo_h 9 | #define cglmc_view_lh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_lh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_lh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_lh_zo(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_lh_zo_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_rh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_rh_no_h 9 | #define cglmc_view_rh_no_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_rh_no(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_rh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_rh_no(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_rh_no_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/clipspace/view_rh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_view_rh_zo_h 9 | #define cglmc_view_rh_zo_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_lookat_rh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_look_rh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_look_anyup_rh_zo(vec3 eye, vec3 dir, mat4 dest); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | #endif /* cglmc_view_rh_zo_h */ 32 | -------------------------------------------------------------------------------- /source/external/cglm/call/curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_curve_h 9 | #define cglmc_curve_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | float 18 | glmc_smc(float s, mat4 m, vec4 c); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif /* cglmc_curve_h */ 24 | -------------------------------------------------------------------------------- /source/external/cglm/call/euler.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_euler_h 9 | #define cglmc_euler_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_euler_angles(mat4 m, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_euler(vec3 angles, mat4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_euler_xyz(vec3 angles, mat4 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_euler_zyx(vec3 angles, mat4 dest); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_euler_zxy(vec3 angles, mat4 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_euler_xzy(vec3 angles, mat4 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_euler_yzx(vec3 angles, mat4 dest); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_euler_yxz(vec3 angles, mat4 dest); 47 | 48 | CGLM_EXPORT 49 | void 50 | glmc_euler_by_order(vec3 angles, glm_euler_seq axis, mat4 dest); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | #endif /* cglmc_euler_h */ 56 | -------------------------------------------------------------------------------- /source/external/cglm/call/frustum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_frustum_h 9 | #define cglmc_frustum_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_frustum_planes(mat4 m, vec4 dest[6]); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_frustum_corners(mat4 invMat, vec4 dest[8]); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_frustum_center(vec4 corners[8], vec4 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_frustum_box(vec4 corners[8], mat4 m, vec3 box[2]); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_frustum_corners_at(vec4 corners[8], 35 | float splitDist, 36 | float farDist, 37 | vec4 planeCorners[4]); 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | #endif /* cglmc_frustum_h */ 42 | -------------------------------------------------------------------------------- /source/external/cglm/call/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_io_h 9 | #define cglmc_io_h 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | #include "../cglm.h" 16 | 17 | CGLM_EXPORT 18 | void 19 | glmc_mat4_print(mat4 matrix, 20 | FILE * __restrict ostream); 21 | 22 | CGLM_EXPORT 23 | void 24 | glmc_mat3_print(mat3 matrix, 25 | FILE * __restrict ostream); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_vec4_print(vec4 vec, 30 | FILE * __restrict ostream); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_vec3_print(vec3 vec, 35 | FILE * __restrict ostream); 36 | 37 | CGLM_EXPORT 38 | void 39 | glmc_versor_print(versor vec, 40 | FILE * __restrict ostream); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | #endif /* cglmc_io_h */ 46 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat2_h 9 | #define cglmc_mat2_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_mat2_copy(mat2 mat, mat2 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_mat2_identity(mat2 mat); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_mat2_identity_array(mat2 * __restrict mat, size_t count); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_mat2_zero(mat2 mat); 31 | 32 | CGLM_EXPORT 33 | void 34 | glmc_mat2_mul(mat2 m1, mat2 m2, mat2 dest); 35 | 36 | CGLM_EXPORT 37 | void 38 | glmc_mat2_transpose_to(mat2 m, mat2 dest); 39 | 40 | CGLM_EXPORT 41 | void 42 | glmc_mat2_transpose(mat2 m); 43 | 44 | CGLM_EXPORT 45 | void 46 | glmc_mat2_mulv(mat2 m, vec2 v, vec2 dest); 47 | 48 | CGLM_EXPORT 49 | float 50 | glmc_mat2_trace(mat2 m); 51 | 52 | CGLM_EXPORT 53 | void 54 | glmc_mat2_scale(mat2 m, float s); 55 | 56 | CGLM_EXPORT 57 | float 58 | glmc_mat2_det(mat2 mat); 59 | 60 | CGLM_EXPORT 61 | void 62 | glmc_mat2_inv(mat2 mat, mat2 dest); 63 | 64 | CGLM_EXPORT 65 | void 66 | glmc_mat2_swap_col(mat2 mat, int col1, int col2); 67 | 68 | CGLM_EXPORT 69 | void 70 | glmc_mat2_swap_row(mat2 mat, int row1, int row2); 71 | 72 | CGLM_EXPORT 73 | float 74 | glmc_mat2_rmc(vec2 r, mat2 m, vec2 c); 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | #endif /* cglmc_mat2_h */ 80 | -------------------------------------------------------------------------------- /source/external/cglm/call/mat3.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_mat3_h 9 | #define cglmc_mat3_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | /* DEPRECATED! use _copy, _ucopy versions */ 17 | #define glmc_mat3_dup(mat, dest) glmc_mat3_copy(mat, dest) 18 | 19 | CGLM_EXPORT 20 | void 21 | glmc_mat3_copy(mat3 mat, mat3 dest); 22 | 23 | CGLM_EXPORT 24 | void 25 | glmc_mat3_identity(mat3 mat); 26 | 27 | CGLM_EXPORT 28 | void 29 | glmc_mat3_zero(mat3 mat); 30 | 31 | CGLM_EXPORT 32 | void 33 | glmc_mat3_identity_array(mat3 * __restrict mat, size_t count); 34 | 35 | CGLM_EXPORT 36 | void 37 | glmc_mat3_mul(mat3 m1, mat3 m2, mat3 dest); 38 | 39 | CGLM_EXPORT 40 | void 41 | glmc_mat3_transpose_to(mat3 m, mat3 dest); 42 | 43 | CGLM_EXPORT 44 | void 45 | glmc_mat3_transpose(mat3 m); 46 | 47 | CGLM_EXPORT 48 | void 49 | glmc_mat3_mulv(mat3 m, vec3 v, vec3 dest); 50 | 51 | CGLM_EXPORT 52 | float 53 | glmc_mat3_trace(mat3 m); 54 | 55 | CGLM_EXPORT 56 | void 57 | glmc_mat3_quat(mat3 m, versor dest); 58 | 59 | CGLM_EXPORT 60 | void 61 | glmc_mat3_scale(mat3 m, float s); 62 | 63 | CGLM_EXPORT 64 | float 65 | glmc_mat3_det(mat3 mat); 66 | 67 | CGLM_EXPORT 68 | void 69 | glmc_mat3_inv(mat3 mat, mat3 dest); 70 | 71 | CGLM_EXPORT 72 | void 73 | glmc_mat3_swap_col(mat3 mat, int col1, int col2); 74 | 75 | CGLM_EXPORT 76 | void 77 | glmc_mat3_swap_row(mat3 mat, int row1, int row2); 78 | 79 | CGLM_EXPORT 80 | float 81 | glmc_mat3_rmc(vec3 r, mat3 m, vec3 c); 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | #endif /* cglmc_mat3_h */ 87 | -------------------------------------------------------------------------------- /source/external/cglm/call/plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_plane_h 9 | #define cglmc_plane_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_plane_normalize(vec4 plane); 19 | 20 | #ifdef __cplusplus 21 | } 22 | #endif 23 | #endif /* cglmc_plane_h */ 24 | -------------------------------------------------------------------------------- /source/external/cglm/call/project.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_project_h 9 | #define cglmc_project_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | void 18 | glmc_unprojecti(vec3 pos, mat4 invMat, vec4 vp, vec3 dest); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_unproject(vec3 pos, mat4 m, vec4 vp, vec3 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_project(vec3 pos, mat4 m, vec4 vp, vec3 dest); 27 | 28 | CGLM_EXPORT 29 | void 30 | glmc_pickmatrix(vec2 center, vec2 size, vec4 vp, mat4 dest); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | #endif /* cglmc_project_h */ 36 | 37 | 38 | -------------------------------------------------------------------------------- /source/external/cglm/call/ray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_ray_h 9 | #define cglmc_ray_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | #include "../cglm.h" 14 | 15 | CGLM_EXPORT 16 | bool 17 | glmc_ray_triangle(vec3 origin, 18 | vec3 direction, 19 | vec3 v0, 20 | vec3 v1, 21 | vec3 v2, 22 | float *d); 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | #endif /* cglmc_ray_h */ 28 | -------------------------------------------------------------------------------- /source/external/cglm/call/sphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglmc_sphere_h 9 | #define cglmc_sphere_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "../cglm.h" 15 | 16 | CGLM_EXPORT 17 | float 18 | glmc_sphere_radii(vec4 s); 19 | 20 | CGLM_EXPORT 21 | void 22 | glmc_sphere_transform(vec4 s, mat4 m, vec4 dest); 23 | 24 | CGLM_EXPORT 25 | void 26 | glmc_sphere_merge(vec4 s1, vec4 s2, vec4 dest); 27 | 28 | CGLM_EXPORT 29 | bool 30 | glmc_sphere_sphere(vec4 s1, vec4 s2); 31 | 32 | CGLM_EXPORT 33 | bool 34 | glmc_sphere_point(vec4 s, vec3 point); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif /* cglmc_sphere_h */ 40 | -------------------------------------------------------------------------------- /source/external/cglm/cglm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_h 9 | #define cglm_h 10 | 11 | #include "common.h" 12 | #include "vec2.h" 13 | #include "vec3.h" 14 | #include "vec4.h" 15 | #include "mat4.h" 16 | #include "mat3.h" 17 | #include "mat2.h" 18 | #include "affine.h" 19 | #include "cam.h" 20 | #include "frustum.h" 21 | #include "quat.h" 22 | #include "euler.h" 23 | #include "plane.h" 24 | #include "box.h" 25 | #include "color.h" 26 | #include "util.h" 27 | #include "io.h" 28 | #include "project.h" 29 | #include "sphere.h" 30 | #include "ease.h" 31 | #include "curve.h" 32 | #include "bezier.h" 33 | #include "ray.h" 34 | #include "affine2d.h" 35 | 36 | #endif /* cglm_h */ 37 | -------------------------------------------------------------------------------- /source/external/cglm/clipspace/persp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_persp_decomp_far(mat4 proj, float *farZ) 11 | CGLM_INLINE float glm_persp_fovy(mat4 proj) 12 | CGLM_INLINE float glm_persp_aspect(mat4 proj) 13 | CGLM_INLINE void glm_persp_sizes(mat4 proj, float fovy, vec4 dest) 14 | */ 15 | 16 | #ifndef cglm_persp_h 17 | #define cglm_persp_h 18 | 19 | #include "../common.h" 20 | #include "../plane.h" 21 | #include "../mat4.h" 22 | 23 | /*! 24 | * @brief returns field of view angle along the Y-axis (in radians) 25 | * 26 | * if you need to degrees, use glm_deg to convert it or use this: 27 | * fovy_deg = glm_deg(glm_persp_fovy(projMatrix)) 28 | * 29 | * @param[in] proj perspective projection matrix 30 | */ 31 | CGLM_INLINE 32 | float 33 | glm_persp_fovy(mat4 proj) { 34 | return 2.0f * atanf(1.0f / proj[1][1]); 35 | } 36 | 37 | /*! 38 | * @brief returns aspect ratio of perspective projection 39 | * 40 | * @param[in] proj perspective projection matrix 41 | */ 42 | CGLM_INLINE 43 | float 44 | glm_persp_aspect(mat4 proj) { 45 | return proj[1][1] / proj[0][0]; 46 | } 47 | 48 | #endif /* cglm_persp_h */ 49 | -------------------------------------------------------------------------------- /source/external/cglm/clipspace/view_lh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_lookat_lh_no(vec3 eye, vec3 center, vec3 up, mat4 dest) 11 | CGLM_INLINE void glm_look_lh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest) 12 | CGLM_INLINE void glm_look_anyup_lh_no(vec3 eye, vec3 dir, mat4 dest) 13 | */ 14 | 15 | #ifndef cglm_view_lh_no_h 16 | #define cglm_view_lh_no_h 17 | 18 | #include "../common.h" 19 | #include "view_lh.h" 20 | 21 | /*! 22 | * @brief set up view matrix with left handed coordinate system. 23 | * 24 | * NOTE: The UP vector must not be parallel to the line of sight from 25 | * the eye point to the reference point 26 | * 27 | * @param[in] eye eye vector 28 | * @param[in] center center vector 29 | * @param[in] up up vector 30 | * @param[out] dest result matrix 31 | */ 32 | CGLM_INLINE 33 | void 34 | glm_lookat_lh_no(vec3 eye, vec3 center, vec3 up, mat4 dest) { 35 | glm_lookat_lh(eye, center, up, dest); 36 | } 37 | 38 | /*! 39 | * @brief set up view matrix with left handed coordinate system. 40 | * 41 | * convenient wrapper for lookat: if you only have direction not target self 42 | * then this might be useful. Because you need to get target from direction. 43 | * 44 | * NOTE: The UP vector must not be parallel to the line of sight from 45 | * the eye point to the reference point 46 | * 47 | * @param[in] eye eye vector 48 | * @param[in] dir direction vector 49 | * @param[in] up up vector 50 | * @param[out] dest result matrix 51 | */ 52 | CGLM_INLINE 53 | void 54 | glm_look_lh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest) { 55 | glm_look_lh(eye, dir, up, dest); 56 | } 57 | 58 | /*! 59 | * @brief set up view matrix with left handed coordinate system. 60 | * 61 | * convenient wrapper for look: if you only have direction and if you don't 62 | * care what UP vector is then this might be useful to create view matrix 63 | * 64 | * @param[in] eye eye vector 65 | * @param[in] dir direction vector 66 | * @param[out] dest result matrix 67 | */ 68 | CGLM_INLINE 69 | void 70 | glm_look_anyup_lh_no(vec3 eye, vec3 dir, mat4 dest) { 71 | glm_look_anyup_lh(eye, dir, dest); 72 | } 73 | 74 | #endif /*cglm_view_lh_no_h*/ 75 | -------------------------------------------------------------------------------- /source/external/cglm/clipspace/view_lh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_lookat_lh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest) 11 | CGLM_INLINE void glm_look_lh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest) 12 | CGLM_INLINE void glm_look_anyup_lh_zo(vec3 eye, vec3 dir, mat4 dest) 13 | */ 14 | 15 | #ifndef cglm_view_lh_zo_h 16 | #define cglm_view_lh_zo_h 17 | 18 | #include "../common.h" 19 | #include "view_lh.h" 20 | 21 | /*! 22 | * @brief set up view matrix with left handed coordinate system. 23 | * 24 | * NOTE: The UP vector must not be parallel to the line of sight from 25 | * the eye point to the reference point 26 | * 27 | * @param[in] eye eye vector 28 | * @param[in] center center vector 29 | * @param[in] up up vector 30 | * @param[out] dest result matrix 31 | */ 32 | CGLM_INLINE 33 | void 34 | glm_lookat_lh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest) { 35 | glm_lookat_lh(eye, center, up, dest); 36 | } 37 | 38 | /*! 39 | * @brief set up view matrix with left handed coordinate system. 40 | * 41 | * convenient wrapper for lookat: if you only have direction not target self 42 | * then this might be useful. Because you need to get target from direction. 43 | * 44 | * NOTE: The UP vector must not be parallel to the line of sight from 45 | * the eye point to the reference point 46 | * 47 | * @param[in] eye eye vector 48 | * @param[in] dir direction vector 49 | * @param[in] up up vector 50 | * @param[out] dest result matrix 51 | */ 52 | CGLM_INLINE 53 | void 54 | glm_look_lh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest) { 55 | glm_look_lh(eye, dir, up, dest); 56 | } 57 | 58 | /*! 59 | * @brief set up view matrix with left handed coordinate system. 60 | * 61 | * convenient wrapper for look: if you only have direction and if you don't 62 | * care what UP vector is then this might be useful to create view matrix 63 | * 64 | * @param[in] eye eye vector 65 | * @param[in] dir direction vector 66 | * @param[out] dest result matrix 67 | */ 68 | CGLM_INLINE 69 | void 70 | glm_look_anyup_lh_zo(vec3 eye, vec3 dir, mat4 dest) { 71 | glm_look_anyup_lh(eye, dir, dest); 72 | } 73 | 74 | #endif /*cglm_view_lh_zo_h*/ 75 | -------------------------------------------------------------------------------- /source/external/cglm/clipspace/view_rh_no.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_lookat_rh_no(vec3 eye, vec3 center, vec3 up, mat4 dest) 11 | CGLM_INLINE void glm_look_rh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest) 12 | CGLM_INLINE void glm_look_anyup_rh_no(vec3 eye, vec3 dir, mat4 dest) 13 | */ 14 | 15 | #ifndef cglm_view_rh_no_h 16 | #define cglm_view_rh_no_h 17 | 18 | #include "../common.h" 19 | #include "view_rh.h" 20 | 21 | /*! 22 | * @brief set up view matrix with right handed coordinate system. 23 | * 24 | * NOTE: The UP vector must not be parallel to the line of sight from 25 | * the eye point to the reference point 26 | * 27 | * @param[in] eye eye vector 28 | * @param[in] center center vector 29 | * @param[in] up up vector 30 | * @param[out] dest result matrix 31 | */ 32 | CGLM_INLINE 33 | void 34 | glm_lookat_rh_no(vec3 eye, vec3 center, vec3 up, mat4 dest) { 35 | glm_lookat_rh(eye, center, up, dest); 36 | } 37 | 38 | /*! 39 | * @brief set up view matrix with right handed coordinate system. 40 | * 41 | * convenient wrapper for lookat: if you only have direction not target self 42 | * then this might be useful. Because you need to get target from direction. 43 | * 44 | * NOTE: The UP vector must not be parallel to the line of sight from 45 | * the eye point to the reference point 46 | * 47 | * @param[in] eye eye vector 48 | * @param[in] dir direction vector 49 | * @param[in] up up vector 50 | * @param[out] dest result matrix 51 | */ 52 | CGLM_INLINE 53 | void 54 | glm_look_rh_no(vec3 eye, vec3 dir, vec3 up, mat4 dest) { 55 | glm_look_rh(eye, dir, up, dest); 56 | } 57 | 58 | /*! 59 | * @brief set up view matrix with right handed coordinate system. 60 | * 61 | * convenient wrapper for look: if you only have direction and if you don't 62 | * care what UP vector is then this might be useful to create view matrix 63 | * 64 | * @param[in] eye eye vector 65 | * @param[in] dir direction vector 66 | * @param[out] dest result matrix 67 | */ 68 | CGLM_INLINE 69 | void 70 | glm_look_anyup_rh_no(vec3 eye, vec3 dir, mat4 dest) { 71 | glm_look_anyup_rh(eye, dir, dest); 72 | } 73 | 74 | #endif /*cglm_view_rh_no_h*/ 75 | -------------------------------------------------------------------------------- /source/external/cglm/clipspace/view_rh_zo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_lookat_rh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest) 11 | CGLM_INLINE void glm_look_rh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest) 12 | CGLM_INLINE void glm_look_anyup_rh_zo(vec3 eye, vec3 dir, mat4 dest) 13 | */ 14 | 15 | #ifndef cglm_view_rh_zo_h 16 | #define cglm_view_rh_zo_h 17 | 18 | #include "../common.h" 19 | #include "view_rh.h" 20 | 21 | /*! 22 | * @brief set up view matrix with right handed coordinate system. 23 | * 24 | * NOTE: The UP vector must not be parallel to the line of sight from 25 | * the eye point to the reference point 26 | * 27 | * @param[in] eye eye vector 28 | * @param[in] center center vector 29 | * @param[in] up up vector 30 | * @param[out] dest result matrix 31 | */ 32 | CGLM_INLINE 33 | void 34 | glm_lookat_rh_zo(vec3 eye, vec3 center, vec3 up, mat4 dest) { 35 | glm_lookat_rh(eye, center, up, dest); 36 | } 37 | 38 | /*! 39 | * @brief set up view matrix with right handed coordinate system. 40 | * 41 | * convenient wrapper for lookat: if you only have direction not target self 42 | * then this might be useful. Because you need to get target from direction. 43 | * 44 | * NOTE: The UP vector must not be parallel to the line of sight from 45 | * the eye point to the reference point 46 | * 47 | * @param[in] eye eye vector 48 | * @param[in] dir direction vector 49 | * @param[in] up up vector 50 | * @param[out] dest result matrix 51 | */ 52 | CGLM_INLINE 53 | void 54 | glm_look_rh_zo(vec3 eye, vec3 dir, vec3 up, mat4 dest) { 55 | glm_look_rh(eye, dir, up, dest); 56 | } 57 | 58 | /*! 59 | * @brief set up view matrix with right handed coordinate system. 60 | * 61 | * convenient wrapper for look: if you only have direction and if you don't 62 | * care what UP vector is then this might be useful to create view matrix 63 | * 64 | * @param[in] eye eye vector 65 | * @param[in] dir direction vector 66 | * @param[out] dest result matrix 67 | */ 68 | CGLM_INLINE 69 | void 70 | glm_look_anyup_rh_zo(vec3 eye, vec3 dir, mat4 dest) { 71 | glm_look_anyup_rh(eye, dir, dest); 72 | } 73 | 74 | #endif /*cglm_view_rh_zo_h*/ 75 | -------------------------------------------------------------------------------- /source/external/cglm/color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_color_h 9 | #define cglm_color_h 10 | 11 | #include "common.h" 12 | #include "vec3.h" 13 | 14 | /*! 15 | * @brief averages the color channels into one value 16 | * 17 | * @param[in] rgb RGB color 18 | */ 19 | CGLM_INLINE 20 | float 21 | glm_luminance(vec3 rgb) { 22 | vec3 l = {0.212671f, 0.715160f, 0.072169f}; 23 | return glm_dot(rgb, l); 24 | } 25 | 26 | #endif /* cglm_color_h */ 27 | -------------------------------------------------------------------------------- /source/external/cglm/curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_curve_h 9 | #define cglm_curve_h 10 | 11 | #include "common.h" 12 | #include "vec4.h" 13 | #include "mat4.h" 14 | 15 | /*! 16 | * @brief helper function to calculate S*M*C multiplication for curves 17 | * 18 | * This function does not encourage you to use SMC, 19 | * instead it is a helper if you use SMC. 20 | * 21 | * if you want to specify S as vector then use more generic glm_mat4_rmc() func. 22 | * 23 | * Example usage: 24 | * B(s) = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1}) 25 | * 26 | * @param[in] s parameter between 0 and 1 (this will be [s3, s2, s, 1]) 27 | * @param[in] m basis matrix 28 | * @param[in] c position/control vector 29 | * 30 | * @return B(s) 31 | */ 32 | CGLM_INLINE 33 | float 34 | glm_smc(float s, mat4 m, vec4 c) { 35 | vec4 vs; 36 | glm_vec4_cubic(s, vs); 37 | return glm_mat4_rmc(vs, m, c); 38 | } 39 | 40 | #endif /* cglm_curve_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_plane_h 9 | #define cglm_plane_h 10 | 11 | #include "common.h" 12 | #include "vec3.h" 13 | #include "vec4.h" 14 | 15 | /* 16 | Plane equation: Ax + By + Cz + D = 0; 17 | 18 | It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance 19 | */ 20 | 21 | /* 22 | Functions: 23 | CGLM_INLINE void glm_plane_normalize(vec4 plane); 24 | */ 25 | 26 | /*! 27 | * @brief normalizes a plane 28 | * 29 | * @param[in, out] plane plane to normalize 30 | */ 31 | CGLM_INLINE 32 | void 33 | glm_plane_normalize(vec4 plane) { 34 | float norm; 35 | 36 | if ((norm = glm_vec3_norm(plane)) == 0.0f) { 37 | glm_vec4_zero(plane); 38 | return; 39 | } 40 | 41 | glm_vec4_scale(plane, 1.0f / norm, plane); 42 | } 43 | 44 | #endif /* cglm_plane_h */ 45 | -------------------------------------------------------------------------------- /source/external/cglm/ray.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE bool glm_line_triangle_intersect(vec3 origin, 11 | vec3 direction, 12 | vec3 v0, 13 | vec3 v1, 14 | vec3 v2, 15 | float *d); 16 | */ 17 | 18 | #ifndef cglm_ray_h 19 | #define cglm_ray_h 20 | 21 | #include "vec3.h" 22 | 23 | /*! 24 | * @brief Möller–Trumbore ray-triangle intersection algorithm 25 | * 26 | * @param[in] origin origin of ray 27 | * @param[in] direction direction of ray 28 | * @param[in] v0 first vertex of triangle 29 | * @param[in] v1 second vertex of triangle 30 | * @param[in] v2 third vertex of triangle 31 | * @param[in, out] d distance to intersection 32 | * @return whether there is intersection 33 | */ 34 | 35 | CGLM_INLINE 36 | bool 37 | glm_ray_triangle(vec3 origin, 38 | vec3 direction, 39 | vec3 v0, 40 | vec3 v1, 41 | vec3 v2, 42 | float *d) { 43 | vec3 edge1, edge2, p, t, q; 44 | float det, inv_det, u, v, dist; 45 | const float epsilon = 0.000001f; 46 | 47 | glm_vec3_sub(v1, v0, edge1); 48 | glm_vec3_sub(v2, v0, edge2); 49 | glm_vec3_cross(direction, edge2, p); 50 | 51 | det = glm_vec3_dot(edge1, p); 52 | if (det > -epsilon && det < epsilon) 53 | return false; 54 | 55 | inv_det = 1.0f / det; 56 | 57 | glm_vec3_sub(origin, v0, t); 58 | 59 | u = inv_det * glm_vec3_dot(t, p); 60 | if (u < 0.0f || u > 1.0f) 61 | return false; 62 | 63 | glm_vec3_cross(t, edge1, q); 64 | 65 | v = inv_det * glm_vec3_dot(direction, q); 66 | if (v < 0.0f || u + v > 1.0f) 67 | return false; 68 | 69 | dist = inv_det * glm_vec3_dot(edge2, q); 70 | 71 | if (d) 72 | *d = dist; 73 | 74 | return dist > epsilon; 75 | } 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /source/external/cglm/simd/avx/affine.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_affine_mat_avx_h 9 | #define cglm_affine_mat_avx_h 10 | #ifdef __AVX__ 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | #include 16 | 17 | CGLM_INLINE 18 | void 19 | glm_mul_avx(mat4 m1, mat4 m2, mat4 dest) { 20 | /* D = R * L (Column-Major) */ 21 | 22 | __m256 y0, y1, y2, y3, y4, y5, y6, y7, y8, y9; 23 | 24 | y0 = glmm_load256(m2[0]); /* h g f e d c b a */ 25 | y1 = glmm_load256(m2[2]); /* p o n m l k j i */ 26 | 27 | y2 = glmm_load256(m1[0]); /* h g f e d c b a */ 28 | y3 = glmm_load256(m1[2]); /* p o n m l k j i */ 29 | 30 | /* 0x03: 0b00000011 */ 31 | y4 = _mm256_permute2f128_ps(y2, y2, 0x03); /* d c b a h g f e */ 32 | y5 = _mm256_permute2f128_ps(y3, y3, 0x03); /* l k j i p o n m */ 33 | 34 | /* f f f f a a a a */ 35 | /* h h h h c c c c */ 36 | /* e e e e b b b b */ 37 | /* g g g g d d d d */ 38 | y6 = _mm256_permutevar_ps(y0, _mm256_set_epi32(1, 1, 1, 1, 0, 0, 0, 0)); 39 | y7 = _mm256_permutevar_ps(y0, _mm256_set_epi32(3, 3, 3, 3, 2, 2, 2, 2)); 40 | y8 = _mm256_permutevar_ps(y0, _mm256_set_epi32(0, 0, 0, 0, 1, 1, 1, 1)); 41 | y9 = _mm256_permutevar_ps(y0, _mm256_set_epi32(2, 2, 2, 2, 3, 3, 3, 3)); 42 | 43 | glmm_store256(dest[0], 44 | _mm256_add_ps(_mm256_add_ps(_mm256_mul_ps(y2, y6), 45 | _mm256_mul_ps(y3, y7)), 46 | _mm256_add_ps(_mm256_mul_ps(y4, y8), 47 | _mm256_mul_ps(y5, y9)))); 48 | 49 | /* n n n n i i i i */ 50 | /* p p p p k k k k */ 51 | /* m m m m j j j j */ 52 | /* o o o o l l l l */ 53 | y6 = _mm256_permutevar_ps(y1, _mm256_set_epi32(1, 1, 1, 1, 0, 0, 0, 0)); 54 | y7 = _mm256_permutevar_ps(y1, _mm256_set_epi32(3, 3, 3, 3, 2, 2, 2, 2)); 55 | y8 = _mm256_permutevar_ps(y1, _mm256_set_epi32(0, 0, 0, 0, 1, 1, 1, 1)); 56 | y9 = _mm256_permutevar_ps(y1, _mm256_set_epi32(2, 2, 2, 2, 3, 3, 3, 3)); 57 | 58 | glmm_store256(dest[2], 59 | _mm256_add_ps(_mm256_add_ps(_mm256_mul_ps(y2, y6), 60 | _mm256_mul_ps(y3, y7)), 61 | _mm256_add_ps(_mm256_mul_ps(y4, y8), 62 | _mm256_mul_ps(y5, y9)))); 63 | } 64 | 65 | #endif 66 | #endif /* cglm_affine_mat_avx_h */ 67 | -------------------------------------------------------------------------------- /source/external/cglm/simd/intrin.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_intrin_h 9 | #define cglm_intrin_h 10 | 11 | #if defined( _MSC_VER ) 12 | # if (defined(_M_AMD64) || defined(_M_X64)) || _M_IX86_FP == 2 13 | # ifndef __SSE2__ 14 | # define __SSE2__ 15 | # endif 16 | # elif _M_IX86_FP == 1 17 | # ifndef __SSE__ 18 | # define __SSE__ 19 | # endif 20 | # endif 21 | /* do not use alignment for older visual studio versions */ 22 | # if _MSC_VER < 1913 /* Visual Studio 2017 version 15.6 */ 23 | # define CGLM_ALL_UNALIGNED 24 | # endif 25 | #endif 26 | 27 | #if defined( __SSE__ ) || defined( __SSE2__ ) 28 | # include 29 | # include 30 | # define CGLM_SSE_FP 1 31 | # ifndef CGLM_SIMD_x86 32 | # define CGLM_SIMD_x86 33 | # endif 34 | #endif 35 | 36 | #if defined(__SSE3__) 37 | # include 38 | # ifndef CGLM_SIMD_x86 39 | # define CGLM_SIMD_x86 40 | # endif 41 | #endif 42 | 43 | #if defined(__SSE4_1__) 44 | # include 45 | # ifndef CGLM_SIMD_x86 46 | # define CGLM_SIMD_x86 47 | # endif 48 | #endif 49 | 50 | #if defined(__SSE4_2__) 51 | # include 52 | # ifndef CGLM_SIMD_x86 53 | # define CGLM_SIMD_x86 54 | # endif 55 | #endif 56 | 57 | #ifdef __AVX__ 58 | # include 59 | # define CGLM_AVX_FP 1 60 | # ifndef CGLM_SIMD_x86 61 | # define CGLM_SIMD_x86 62 | # endif 63 | #endif 64 | 65 | /* ARM Neon */ 66 | #if defined(__ARM_NEON) 67 | # include 68 | # if defined(__ARM_NEON_FP) 69 | # define CGLM_NEON_FP 1 70 | # ifndef CGLM_SIMD_ARM 71 | # define CGLM_SIMD_ARM 72 | # endif 73 | # endif 74 | #endif 75 | 76 | #if defined(CGLM_SIMD_x86) || defined(CGLM_NEON_FP) 77 | # ifndef CGLM_SIMD 78 | # define CGLM_SIMD 79 | # endif 80 | #endif 81 | 82 | #if defined(CGLM_SIMD_x86) 83 | # include "x86.h" 84 | #endif 85 | 86 | #if defined(CGLM_SIMD_ARM) 87 | # include "arm.h" 88 | #endif 89 | 90 | #endif /* cglm_intrin_h */ 91 | -------------------------------------------------------------------------------- /source/external/cglm/simd/neon/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_mat2_neon_h 9 | #define cglm_mat2_neon_h 10 | #if defined(__ARM_NEON_FP) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_mat2_mul_neon(mat2 m1, mat2 m2, mat2 dest) { 18 | float32x4x2_t a1; 19 | glmm_128 x0, x1, x2; 20 | float32x2_t dc, ba; 21 | 22 | x1 = glmm_load(m1[0]); /* d c b a */ 23 | x2 = glmm_load(m2[0]); /* h g f e */ 24 | 25 | dc = vget_high_f32(x1); 26 | ba = vget_low_f32(x1); 27 | 28 | /* g g e e, h h f f */ 29 | a1 = vtrnq_f32(x2, x2); 30 | 31 | /* 32 | dest[0][0] = a * e + c * f; 33 | dest[0][1] = b * e + d * f; 34 | dest[1][0] = a * g + c * h; 35 | dest[1][1] = b * g + d * h; 36 | */ 37 | x0 = glmm_fmadd(vcombine_f32(ba, ba), a1.val[0], 38 | vmulq_f32(vcombine_f32(dc, dc), a1.val[1])); 39 | 40 | glmm_store(dest[0], x0); 41 | } 42 | 43 | #endif 44 | #endif /* cglm_mat2_neon_h */ 45 | -------------------------------------------------------------------------------- /source/external/cglm/simd/neon/quat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_quat_neon_h 9 | #define cglm_quat_neon_h 10 | #if defined(__ARM_NEON_FP) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_quat_mul_neon(versor p, versor q, versor dest) { 18 | /* 19 | + (a1 b2 + b1 a2 + c1 d2 − d1 c2)i 20 | + (a1 c2 − b1 d2 + c1 a2 + d1 b2)j 21 | + (a1 d2 + b1 c2 − c1 b2 + d1 a2)k 22 | a1 a2 − b1 b2 − c1 c2 − d1 d2 23 | */ 24 | 25 | glmm_128 xp, xq, xqr, r, x, y, z, s2, s3; 26 | glmm_128 s1 = {-0.f, 0.f, 0.f, -0.f}; 27 | float32x2_t qh, ql; 28 | 29 | xp = glmm_load(p); /* 3 2 1 0 */ 30 | xq = glmm_load(q); 31 | 32 | r = vmulq_f32(glmm_splat_w(xp), xq); 33 | x = glmm_splat_x(xp); 34 | y = glmm_splat_y(xp); 35 | z = glmm_splat_z(xp); 36 | 37 | ql = vget_high_f32(s1); 38 | s3 = vcombine_f32(ql, ql); 39 | s2 = vzipq_f32(s3, s3).val[0]; 40 | 41 | xqr = vrev64q_f32(xq); 42 | qh = vget_high_f32(xqr); 43 | ql = vget_low_f32(xqr); 44 | 45 | r = glmm_fmadd(glmm_xor(x, s3), vcombine_f32(qh, ql), r); 46 | 47 | r = glmm_fmadd(glmm_xor(y, s2), vcombine_f32(vget_high_f32(xq), 48 | vget_low_f32(xq)), r); 49 | 50 | r = glmm_fmadd(glmm_xor(z, s1), vcombine_f32(ql, qh), r); 51 | 52 | glmm_store(dest, r); 53 | } 54 | 55 | #endif 56 | #endif /* cglm_quat_neon_h */ 57 | -------------------------------------------------------------------------------- /source/external/cglm/simd/sse2/mat2.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_mat2_sse_h 9 | #define cglm_mat2_sse_h 10 | #if defined( __SSE__ ) || defined( __SSE2__ ) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_mat2_mul_sse2(mat2 m1, mat2 m2, mat2 dest) { 18 | __m128 x0, x1, x2, x3, x4; 19 | 20 | x1 = glmm_load(m1[0]); /* d c b a */ 21 | x2 = glmm_load(m2[0]); /* h g f e */ 22 | 23 | x3 = glmm_shuff1(x2, 2, 2, 0, 0); 24 | x4 = glmm_shuff1(x2, 3, 3, 1, 1); 25 | x0 = _mm_movelh_ps(x1, x1); 26 | x2 = _mm_movehl_ps(x1, x1); 27 | 28 | /* 29 | dest[0][0] = a * e + c * f; 30 | dest[0][1] = b * e + d * f; 31 | dest[1][0] = a * g + c * h; 32 | dest[1][1] = b * g + d * h; 33 | */ 34 | x0 = glmm_fmadd(x0, x3, _mm_mul_ps(x2, x4)); 35 | 36 | glmm_store(dest[0], x0); 37 | } 38 | 39 | CGLM_INLINE 40 | void 41 | glm_mat2_transp_sse2(mat2 m, mat2 dest) { 42 | /* d c b a */ 43 | /* d b c a */ 44 | glmm_store(dest[0], glmm_shuff1(glmm_load(m[0]), 3, 1, 2, 0)); 45 | } 46 | 47 | #endif 48 | #endif /* cglm_mat2_sse_h */ 49 | -------------------------------------------------------------------------------- /source/external/cglm/simd/sse2/quat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_quat_simd_h 9 | #define cglm_quat_simd_h 10 | #if defined( __SSE__ ) || defined( __SSE2__ ) 11 | 12 | #include "../../common.h" 13 | #include "../intrin.h" 14 | 15 | CGLM_INLINE 16 | void 17 | glm_quat_mul_sse2(versor p, versor q, versor dest) { 18 | /* 19 | + (a1 b2 + b1 a2 + c1 d2 − d1 c2)i 20 | + (a1 c2 − b1 d2 + c1 a2 + d1 b2)j 21 | + (a1 d2 + b1 c2 − c1 b2 + d1 a2)k 22 | a1 a2 − b1 b2 − c1 c2 − d1 d2 23 | */ 24 | 25 | __m128 xp, xq, x1, x2, x3, r, x, y, z; 26 | 27 | xp = glmm_load(p); /* 3 2 1 0 */ 28 | xq = glmm_load(q); 29 | x1 = _mm_set_ps(-0.f, 0.f, -0.f, 0.f); /* TODO: _mm_set1_ss() + shuff ? */ 30 | r = _mm_mul_ps(glmm_splat_w(xp), xq); 31 | 32 | x2 = _mm_unpackhi_ps(x1, x1); 33 | x3 = glmm_shuff1(x1, 3, 2, 0, 1); 34 | x = glmm_splat_x(xp); 35 | y = glmm_splat_y(xp); 36 | z = glmm_splat_z(xp); 37 | 38 | x = _mm_xor_ps(x, x1); 39 | y = _mm_xor_ps(y, x2); 40 | z = _mm_xor_ps(z, x3); 41 | 42 | x1 = glmm_shuff1(xq, 0, 1, 2, 3); 43 | x2 = glmm_shuff1(xq, 1, 0, 3, 2); 44 | x3 = glmm_shuff1(xq, 2, 3, 0, 1); 45 | 46 | r = glmm_fmadd(x, x1, r); 47 | r = glmm_fmadd(y, x2, r); 48 | r = glmm_fmadd(z, x3, r); 49 | 50 | glmm_store(dest, r); 51 | } 52 | 53 | #endif 54 | #endif /* cglm_quat_simd_h */ 55 | -------------------------------------------------------------------------------- /source/external/cglm/sphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_sphere_h 9 | #define cglm_sphere_h 10 | 11 | #include "common.h" 12 | #include "mat4.h" 13 | 14 | /* 15 | Sphere Representation in cglm: [center.x, center.y, center.z, radii] 16 | 17 | You could use this representation or you can convert it to vec4 before call 18 | any function 19 | */ 20 | 21 | /*! 22 | * @brief helper for getting sphere radius 23 | * 24 | * @param[in] s sphere 25 | * 26 | * @return returns radii 27 | */ 28 | CGLM_INLINE 29 | float 30 | glm_sphere_radii(vec4 s) { 31 | return s[3]; 32 | } 33 | 34 | /*! 35 | * @brief apply transform to sphere, it is just wrapper for glm_mat4_mulv3 36 | * 37 | * @param[in] s sphere 38 | * @param[in] m transform matrix 39 | * @param[out] dest transformed sphere 40 | */ 41 | CGLM_INLINE 42 | void 43 | glm_sphere_transform(vec4 s, mat4 m, vec4 dest) { 44 | glm_mat4_mulv3(m, s, 1.0f, dest); 45 | dest[3] = s[3]; 46 | } 47 | 48 | /*! 49 | * @brief merges two spheres and creates a new one 50 | * 51 | * two sphere must be in same space, for instance if one in world space then 52 | * the other must be in world space too, not in local space. 53 | * 54 | * @param[in] s1 sphere 1 55 | * @param[in] s2 sphere 2 56 | * @param[out] dest merged/extended sphere 57 | */ 58 | CGLM_INLINE 59 | void 60 | glm_sphere_merge(vec4 s1, vec4 s2, vec4 dest) { 61 | float dist, radii; 62 | 63 | dist = glm_vec3_distance(s1, s2); 64 | radii = dist + s1[3] + s2[3]; 65 | 66 | radii = glm_max(radii, s1[3]); 67 | radii = glm_max(radii, s2[3]); 68 | 69 | glm_vec3_center(s1, s2, dest); 70 | dest[3] = radii; 71 | } 72 | 73 | /*! 74 | * @brief check if two sphere intersects 75 | * 76 | * @param[in] s1 sphere 77 | * @param[in] s2 other sphere 78 | */ 79 | CGLM_INLINE 80 | bool 81 | glm_sphere_sphere(vec4 s1, vec4 s2) { 82 | return glm_vec3_distance2(s1, s2) <= glm_pow2(s1[3] + s2[3]); 83 | } 84 | 85 | /*! 86 | * @brief check if sphere intersects with point 87 | * 88 | * @param[in] s sphere 89 | * @param[in] point point 90 | */ 91 | CGLM_INLINE 92 | bool 93 | glm_sphere_point(vec4 s, vec3 point) { 94 | float rr; 95 | rr = s[3] * s[3]; 96 | return glm_vec3_distance2(point, s) <= rr; 97 | } 98 | 99 | #endif /* cglm_sphere_h */ 100 | -------------------------------------------------------------------------------- /source/external/cglm/struct.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_structs_h 9 | #define cglm_structs_h 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #include "cglm.h" 15 | #include "types-struct.h" 16 | #include "struct/vec2.h" 17 | #include "struct/vec3.h" 18 | #include "struct/vec4.h" 19 | #include "struct/mat2.h" 20 | #include "struct/mat3.h" 21 | #include "struct/mat4.h" 22 | #include "struct/affine.h" 23 | #include "struct/frustum.h" 24 | #include "struct/plane.h" 25 | #include "struct/box.h" 26 | #include "struct/color.h" 27 | #include "struct/io.h" 28 | #include "struct/cam.h" 29 | #include "struct/quat.h" 30 | #include "struct/euler.h" 31 | #include "struct/project.h" 32 | #include "struct/sphere.h" 33 | #include "struct/curve.h" 34 | #include "struct/affine2d.h" 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | #endif /* cglm_structs_h */ 40 | -------------------------------------------------------------------------------- /source/external/cglm/struct/color.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_colors_h 9 | #define cglms_colors_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../color.h" 14 | #include "vec3.h" 15 | 16 | /*! 17 | * @brief averages the color channels into one value 18 | * 19 | * @param[in] rgb RGB color 20 | */ 21 | CGLM_INLINE 22 | float 23 | glms_luminance(vec3s rgb) { 24 | return glm_luminance(rgb.raw); 25 | } 26 | 27 | #endif /* cglms_colors_h */ 28 | -------------------------------------------------------------------------------- /source/external/cglm/struct/curve.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_curves_h 9 | #define cglms_curves_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../curve.h" 14 | #include "vec4.h" 15 | #include "mat4.h" 16 | 17 | /*! 18 | * @brief helper function to calculate S*M*C multiplication for curves 19 | * 20 | * This function does not encourage you to use SMC, 21 | * instead it is a helper if you use SMC. 22 | * 23 | * if you want to specify S as vector then use more generic glm_mat4_rmc() func. 24 | * 25 | * Example usage: 26 | * B(s) = glm_smc(s, GLM_BEZIER_MAT, (vec4){p0, c0, c1, p1}) 27 | * 28 | * @param[in] s parameter between 0 and 1 (this will be [s3, s2, s, 1]) 29 | * @param[in] m basis matrix 30 | * @param[in] c position/control vector 31 | * 32 | * @return B(s) 33 | */ 34 | CGLM_INLINE 35 | float 36 | glms_smc(float s, mat4s m, vec4s c) { 37 | return glm_smc(s, m.raw, c.raw); 38 | } 39 | 40 | #endif /* cglms_curves_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/struct/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | /* 9 | Functions: 10 | CGLM_INLINE void glm_mat4_print(mat4 matrix, FILE *ostream); 11 | CGLM_INLINE void glm_mat3_print(mat3 matrix, FILE *ostream); 12 | CGLM_INLINE void glm_vec4_print(vec4 vec, FILE *ostream); 13 | CGLM_INLINE void glm_vec3_print(vec3 vec, FILE *ostream); 14 | CGLM_INLINE void glm_ivec3_print(ivec3 vec, FILE *ostream); 15 | CGLM_INLINE void glm_versor_print(versor vec, FILE *ostream); 16 | */ 17 | 18 | #ifndef cglms_ios_h 19 | #define cglms_ios_h 20 | 21 | #include "../common.h" 22 | #include "../io.h" 23 | #include "mat4.h" 24 | 25 | #include 26 | #include 27 | 28 | CGLM_INLINE 29 | void 30 | glms_mat4_print(mat4s matrix, 31 | FILE * __restrict ostream) { 32 | 33 | glm_mat4_print(matrix.raw, ostream); 34 | } 35 | 36 | CGLM_INLINE 37 | void 38 | glms_mat3_print(mat3s matrix, 39 | FILE * __restrict ostream) { 40 | glm_mat3_print(matrix.raw, ostream); 41 | } 42 | 43 | CGLM_INLINE 44 | void 45 | glms_vec4_print(vec4s vec, 46 | FILE * __restrict ostream) { 47 | glm_vec4_print(vec.raw, ostream); 48 | } 49 | 50 | CGLM_INLINE 51 | void 52 | glms_vec3_print(vec3s vec, 53 | FILE * __restrict ostream) { 54 | glm_vec3_print(vec.raw, ostream); 55 | } 56 | 57 | CGLM_INLINE 58 | void 59 | glms_ivec3_print(ivec3s vec, 60 | FILE * __restrict ostream) { 61 | glm_ivec3_print(vec.raw, ostream); 62 | } 63 | 64 | CGLM_INLINE 65 | void 66 | glms_versor_print(versors vec, 67 | FILE * __restrict ostream) { 68 | glm_versor_print(vec.raw, ostream); 69 | } 70 | 71 | CGLM_INLINE 72 | void 73 | glms_aabb_print(vec3s bbox[2], 74 | const char * __restrict tag, 75 | FILE * __restrict ostream) { 76 | vec3 rawBbox[2]; 77 | 78 | glms_vec3_unpack(rawBbox, bbox, 2); 79 | glm_aabb_print(rawBbox, tag, ostream); 80 | } 81 | 82 | #endif /* cglms_ios_h */ 83 | -------------------------------------------------------------------------------- /source/external/cglm/struct/plane.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_planes_h 9 | #define cglms_planes_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../plane.h" 14 | #include "vec4.h" 15 | 16 | /* 17 | Plane equation: Ax + By + Cz + D = 0; 18 | 19 | It stored in vec4 as [A, B, C, D]. (A, B, C) is normal and D is distance 20 | */ 21 | 22 | /* 23 | Functions: 24 | CGLM_INLINE vec4s glms_plane_normalize(vec4s plane); 25 | */ 26 | 27 | /*! 28 | * @brief normalizes a plane 29 | * 30 | * @param[in] plane plane to normalize 31 | * @returns normalized plane 32 | */ 33 | CGLM_INLINE 34 | vec4s 35 | glms_plane_normalize(vec4s plane) { 36 | glm_plane_normalize(plane.raw); 37 | return plane; 38 | } 39 | 40 | #endif /* cglms_planes_h */ 41 | -------------------------------------------------------------------------------- /source/external/cglm/struct/sphere.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglms_spheres_h 9 | #define cglms_spheres_h 10 | 11 | #include "../common.h" 12 | #include "../types-struct.h" 13 | #include "../sphere.h" 14 | #include "mat4.h" 15 | 16 | /* 17 | Sphere Representation in cglm: [center.x, center.y, center.z, radii] 18 | 19 | You could use this representation or you can convert it to vec4 before call 20 | any function 21 | */ 22 | 23 | /*! 24 | * @brief helper for getting sphere radius 25 | * 26 | * @param[in] s sphere 27 | * 28 | * @return returns radii 29 | */ 30 | CGLM_INLINE 31 | float 32 | glms_sphere_radii(vec4s s) { 33 | return glm_sphere_radii(s.raw); 34 | } 35 | 36 | /*! 37 | * @brief apply transform to sphere, it is just wrapper for glm_mat4_mulv3 38 | * 39 | * @param[in] s sphere 40 | * @param[in] m transform matrix 41 | * @returns transformed sphere 42 | */ 43 | CGLM_INLINE 44 | vec4s 45 | glms_sphere_transform(vec4s s, mat4s m) { 46 | vec4s r; 47 | glm_sphere_transform(s.raw, m.raw, r.raw); 48 | return r; 49 | } 50 | 51 | /*! 52 | * @brief merges two spheres and creates a new one 53 | * 54 | * two sphere must be in same space, for instance if one in world space then 55 | * the other must be in world space too, not in local space. 56 | * 57 | * @param[in] s1 sphere 1 58 | * @param[in] s2 sphere 2 59 | * returns merged/extended sphere 60 | */ 61 | CGLM_INLINE 62 | vec4s 63 | glms_sphere_merge(vec4s s1, vec4s s2) { 64 | vec4s r; 65 | glm_sphere_merge(s1.raw, s2.raw, r.raw); 66 | return r; 67 | } 68 | 69 | /*! 70 | * @brief check if two sphere intersects 71 | * 72 | * @param[in] s1 sphere 73 | * @param[in] s2 other sphere 74 | */ 75 | CGLM_INLINE 76 | bool 77 | glms_sphere_sphere(vec4s s1, vec4s s2) { 78 | return glm_sphere_sphere(s1.raw, s2.raw); 79 | } 80 | 81 | /*! 82 | * @brief check if sphere intersects with point 83 | * 84 | * @param[in] s sphere 85 | * @param[in] point point 86 | */ 87 | CGLM_INLINE 88 | bool 89 | glms_sphere_point(vec4s s, vec3s point) { 90 | return glm_sphere_point(s.raw, point.raw); 91 | } 92 | 93 | #endif /* cglms_spheres_h */ 94 | -------------------------------------------------------------------------------- /source/external/cglm/version.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c), Recep Aslantas. 3 | * 4 | * MIT License (MIT), http://opensource.org/licenses/MIT 5 | * Full license can be found in the LICENSE file 6 | */ 7 | 8 | #ifndef cglm_version_h 9 | #define cglm_version_h 10 | 11 | #define CGLM_VERSION_MAJOR 0 12 | #define CGLM_VERSION_MINOR 8 13 | #define CGLM_VERSION_PATCH 4 14 | 15 | #endif /* cglm_version_h */ 16 | -------------------------------------------------------------------------------- /source/external/enkiTS/License.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Doug Binks 2 | 3 | This software is provided 'as-is', without any express or implied 4 | warranty. In no event will the authors be held liable for any damages 5 | arising from the use of this software. 6 | 7 | Permission is granted to anyone to use this software for any purpose, 8 | including commercial applications, and to alter it and redistribute it 9 | freely, subject to the following restrictions: 10 | 11 | 1. The origin of this software must not be misrepresented; you must not 12 | claim that you wrote the original software. If you use this software 13 | in a product, an acknowledgement in the product documentation would be 14 | appreciated but is not required. 15 | 2. Altered source versions must be plainly marked as such, and must not be 16 | misrepresented as being the original software. 17 | 3. This notice may not be removed or altered from any source distribution. 18 | -------------------------------------------------------------------------------- /source/external/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2021 Omar Cornut 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/external/imgui/imgui_impl_sdl.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for SDL2 2 | // This needs to be used along with a Renderer (e.g. DirectX11, OpenGL3, Vulkan..) 3 | // (Info: SDL2 is a cross-platform general purpose library for handling windows, inputs, graphics context creation, etc.) 4 | 5 | // Implemented features: 6 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange'. 7 | // [X] Platform: Clipboard support. 8 | // [X] Platform: Keyboard arrays indexed using SDL_SCANCODE_* codes, e.g. ImGui::IsKeyPressed(SDL_SCANCODE_SPACE). 9 | // [X] Platform: Gamepad support. Enabled with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 10 | // [X] Platform: Multi-viewport support (multiple windows). Enable with 'io.ConfigFlags |= ImGuiConfigFlags_ViewportsEnable'. 11 | // Missing features: 12 | // [ ] Platform: SDL2 handling of IME under Windows appears to be broken and it explicitly disable the regular Windows IME. You can restore Windows IME by compiling SDL with SDL_DISABLE_WINDOWS_IME. 13 | // [ ] Platform: Multi-viewport + Minimized windows seems to break mouse wheel events (at least under Windows). 14 | 15 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 16 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 17 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 18 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | struct SDL_Window; 24 | typedef union SDL_Event SDL_Event; 25 | 26 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForOpenGL(SDL_Window* window, void* sdl_gl_context); 27 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForVulkan(SDL_Window* window); 28 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForD3D(SDL_Window* window); 29 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForMetal(SDL_Window* window); 30 | IMGUI_IMPL_API bool ImGui_ImplSDL2_InitForSDLRenderer(SDL_Window* window); 31 | IMGUI_IMPL_API void ImGui_ImplSDL2_Shutdown(); 32 | IMGUI_IMPL_API void ImGui_ImplSDL2_NewFrame(); 33 | IMGUI_IMPL_API bool ImGui_ImplSDL2_ProcessEvent(const SDL_Event* event); 34 | 35 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 36 | static inline void ImGui_ImplSDL2_NewFrame(SDL_Window*) { ImGui_ImplSDL2_NewFrame(); } // 1.84: removed unnecessary parameter 37 | #endif 38 | -------------------------------------------------------------------------------- /source/external/meshoptimizer/LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016-2023 Arseny Kapoulkine 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /source/external/meshoptimizer/allocator.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details 2 | #include "meshoptimizer.h" 3 | 4 | void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*)) 5 | { 6 | meshopt_Allocator::Storage::allocate = allocate; 7 | meshopt_Allocator::Storage::deallocate = deallocate; 8 | } 9 | -------------------------------------------------------------------------------- /source/external/meshoptimizer/vcacheanalyzer.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details 2 | #include "meshoptimizer.h" 3 | 4 | #include 5 | #include 6 | 7 | meshopt_VertexCacheStatistics meshopt_analyzeVertexCache(const unsigned int* indices, size_t index_count, size_t vertex_count, unsigned int cache_size, unsigned int warp_size, unsigned int primgroup_size) 8 | { 9 | assert(index_count % 3 == 0); 10 | assert(cache_size >= 3); 11 | assert(warp_size == 0 || warp_size >= 3); 12 | 13 | meshopt_Allocator allocator; 14 | 15 | meshopt_VertexCacheStatistics result = {}; 16 | 17 | unsigned int warp_offset = 0; 18 | unsigned int primgroup_offset = 0; 19 | 20 | unsigned int* cache_timestamps = allocator.allocate(vertex_count); 21 | memset(cache_timestamps, 0, vertex_count * sizeof(unsigned int)); 22 | 23 | unsigned int timestamp = cache_size + 1; 24 | 25 | for (size_t i = 0; i < index_count; i += 3) 26 | { 27 | unsigned int a = indices[i + 0], b = indices[i + 1], c = indices[i + 2]; 28 | assert(a < vertex_count && b < vertex_count && c < vertex_count); 29 | 30 | bool ac = (timestamp - cache_timestamps[a]) > cache_size; 31 | bool bc = (timestamp - cache_timestamps[b]) > cache_size; 32 | bool cc = (timestamp - cache_timestamps[c]) > cache_size; 33 | 34 | // flush cache if triangle doesn't fit into warp or into the primitive buffer 35 | if ((primgroup_size && primgroup_offset == primgroup_size) || (warp_size && warp_offset + ac + bc + cc > warp_size)) 36 | { 37 | result.warps_executed += warp_offset > 0; 38 | 39 | warp_offset = 0; 40 | primgroup_offset = 0; 41 | 42 | // reset cache 43 | timestamp += cache_size + 1; 44 | } 45 | 46 | // update cache and add vertices to warp 47 | for (int j = 0; j < 3; ++j) 48 | { 49 | unsigned int index = indices[i + j]; 50 | 51 | if (timestamp - cache_timestamps[index] > cache_size) 52 | { 53 | cache_timestamps[index] = timestamp++; 54 | result.vertices_transformed++; 55 | warp_offset++; 56 | } 57 | } 58 | 59 | primgroup_offset++; 60 | } 61 | 62 | size_t unique_vertex_count = 0; 63 | 64 | for (size_t i = 0; i < vertex_count; ++i) 65 | unique_vertex_count += cache_timestamps[i] > 0; 66 | 67 | result.warps_executed += warp_offset > 0; 68 | 69 | result.acmr = index_count == 0 ? 0 : float(result.vertices_transformed) / float(index_count / 3); 70 | result.atvr = unique_vertex_count == 0 ? 0 : float(result.vertices_transformed) / float(unique_vertex_count); 71 | 72 | return result; 73 | } 74 | -------------------------------------------------------------------------------- /source/external/meshoptimizer/vfetchanalyzer.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details 2 | #include "meshoptimizer.h" 3 | 4 | #include 5 | #include 6 | 7 | meshopt_VertexFetchStatistics meshopt_analyzeVertexFetch(const unsigned int* indices, size_t index_count, size_t vertex_count, size_t vertex_size) 8 | { 9 | assert(index_count % 3 == 0); 10 | assert(vertex_size > 0 && vertex_size <= 256); 11 | 12 | meshopt_Allocator allocator; 13 | 14 | meshopt_VertexFetchStatistics result = {}; 15 | 16 | unsigned char* vertex_visited = allocator.allocate(vertex_count); 17 | memset(vertex_visited, 0, vertex_count); 18 | 19 | const size_t kCacheLine = 64; 20 | const size_t kCacheSize = 128 * 1024; 21 | 22 | // simple direct mapped cache; on typical mesh data this is close to 4-way cache, and this model is a gross approximation anyway 23 | size_t cache[kCacheSize / kCacheLine] = {}; 24 | 25 | for (size_t i = 0; i < index_count; ++i) 26 | { 27 | unsigned int index = indices[i]; 28 | assert(index < vertex_count); 29 | 30 | vertex_visited[index] = 1; 31 | 32 | size_t start_address = index * vertex_size; 33 | size_t end_address = start_address + vertex_size; 34 | 35 | size_t start_tag = start_address / kCacheLine; 36 | size_t end_tag = (end_address + kCacheLine - 1) / kCacheLine; 37 | 38 | assert(start_tag < end_tag); 39 | 40 | for (size_t tag = start_tag; tag < end_tag; ++tag) 41 | { 42 | size_t line = tag % (sizeof(cache) / sizeof(cache[0])); 43 | 44 | // we store +1 since cache is filled with 0 by default 45 | result.bytes_fetched += (cache[line] != tag + 1) * kCacheLine; 46 | cache[line] = tag + 1; 47 | } 48 | } 49 | 50 | size_t unique_vertex_count = 0; 51 | 52 | for (size_t i = 0; i < vertex_count; ++i) 53 | unique_vertex_count += vertex_visited[i]; 54 | 55 | result.overfetch = unique_vertex_count == 0 ? 0 : float(result.bytes_fetched) / float(unique_vertex_count * vertex_size); 56 | 57 | return result; 58 | } 59 | -------------------------------------------------------------------------------- /source/external/meshoptimizer/vfetchoptimizer.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of meshoptimizer library; see meshoptimizer.h for version/license details 2 | #include "meshoptimizer.h" 3 | 4 | #include 5 | #include 6 | 7 | size_t meshopt_optimizeVertexFetchRemap(unsigned int* destination, const unsigned int* indices, size_t index_count, size_t vertex_count) 8 | { 9 | assert(index_count % 3 == 0); 10 | 11 | memset(destination, -1, vertex_count * sizeof(unsigned int)); 12 | 13 | unsigned int next_vertex = 0; 14 | 15 | for (size_t i = 0; i < index_count; ++i) 16 | { 17 | unsigned int index = indices[i]; 18 | assert(index < vertex_count); 19 | 20 | if (destination[index] == ~0u) 21 | { 22 | destination[index] = next_vertex++; 23 | } 24 | } 25 | 26 | assert(next_vertex <= vertex_count); 27 | 28 | return next_vertex; 29 | } 30 | 31 | size_t meshopt_optimizeVertexFetch(void* destination, unsigned int* indices, size_t index_count, const void* vertices, size_t vertex_count, size_t vertex_size) 32 | { 33 | assert(index_count % 3 == 0); 34 | assert(vertex_size > 0 && vertex_size <= 256); 35 | 36 | meshopt_Allocator allocator; 37 | 38 | // support in-place optimization 39 | if (destination == vertices) 40 | { 41 | unsigned char* vertices_copy = allocator.allocate(vertex_count * vertex_size); 42 | memcpy(vertices_copy, vertices, vertex_count * vertex_size); 43 | vertices = vertices_copy; 44 | } 45 | 46 | // build vertex remap table 47 | unsigned int* vertex_remap = allocator.allocate(vertex_count); 48 | memset(vertex_remap, -1, vertex_count * sizeof(unsigned int)); 49 | 50 | unsigned int next_vertex = 0; 51 | 52 | for (size_t i = 0; i < index_count; ++i) 53 | { 54 | unsigned int index = indices[i]; 55 | assert(index < vertex_count); 56 | 57 | unsigned int& remap = vertex_remap[index]; 58 | 59 | if (remap == ~0u) // vertex was not added to destination VB 60 | { 61 | // add vertex 62 | memcpy(static_cast(destination) + next_vertex * vertex_size, static_cast(vertices) + index * vertex_size, vertex_size); 63 | 64 | remap = next_vertex++; 65 | } 66 | 67 | // modify indices in place 68 | indices[i] = remap; 69 | } 70 | 71 | assert(next_vertex <= vertex_count); 72 | 73 | return next_vertex; 74 | } 75 | -------------------------------------------------------------------------------- /source/external/tracy/LICENSE: -------------------------------------------------------------------------------- 1 | Tracy Profiler (https://github.com/wolfpld/tracy) is licensed under the 2 | 3-clause BSD license. 3 | 4 | Copyright (c) 2017-2022, Bartosz Taudul 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | * Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | * Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | * Neither the name of the nor the 15 | names of its contributors may be used to endorse or promote products 16 | derived from this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /source/external/tracy/TracyClient.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Tracy profiler 3 | // ---------------- 4 | // 5 | // For fast integration, compile and 6 | // link with this source file (and none 7 | // other) in your executable (or in the 8 | // main DLL / shared object on multi-DLL 9 | // projects). 10 | // 11 | 12 | // Define TRACY_ENABLE to enable profiler. 13 | 14 | #include "common/TracySystem.cpp" 15 | 16 | #ifdef TRACY_ENABLE 17 | 18 | #ifdef _MSC_VER 19 | # pragma warning(push, 0) 20 | #endif 21 | 22 | #include "common/tracy_lz4.cpp" 23 | #include "client/TracyProfiler.cpp" 24 | #include "client/TracyCallstack.cpp" 25 | #include "client/TracySysTime.cpp" 26 | #include "client/TracySysTrace.cpp" 27 | #include "common/TracySocket.cpp" 28 | #include "client/tracy_rpmalloc.cpp" 29 | #include "client/TracyDxt1.cpp" 30 | #include "client/TracyAlloc.cpp" 31 | 32 | #if TRACY_HAS_CALLSTACK == 2 || TRACY_HAS_CALLSTACK == 3 || TRACY_HAS_CALLSTACK == 4 || TRACY_HAS_CALLSTACK == 6 33 | # include "libbacktrace/alloc.cpp" 34 | # include "libbacktrace/dwarf.cpp" 35 | # include "libbacktrace/fileline.cpp" 36 | # include "libbacktrace/mmapio.cpp" 37 | # include "libbacktrace/posix.cpp" 38 | # include "libbacktrace/sort.cpp" 39 | # include "libbacktrace/state.cpp" 40 | # if TRACY_HAS_CALLSTACK == 4 41 | # include "libbacktrace/macho.cpp" 42 | # else 43 | # include "libbacktrace/elf.cpp" 44 | # endif 45 | # include "common/TracyStackFrames.cpp" 46 | #endif 47 | 48 | #ifdef _MSC_VER 49 | # pragma comment(lib, "ws2_32.lib") 50 | # pragma comment(lib, "dbghelp.lib") 51 | # pragma comment(lib, "advapi32.lib") 52 | # pragma comment(lib, "user32.lib") 53 | # pragma warning(pop) 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyAlloc.cpp: -------------------------------------------------------------------------------- 1 | #include "../common/TracyAlloc.hpp" 2 | 3 | #ifdef TRACY_USE_RPMALLOC 4 | 5 | #include 6 | 7 | #include "../common/TracyForceInline.hpp" 8 | #include "../common/TracyYield.hpp" 9 | 10 | namespace tracy 11 | { 12 | 13 | extern thread_local bool RpThreadInitDone; 14 | extern std::atomic RpInitDone; 15 | extern std::atomic RpInitLock; 16 | 17 | tracy_no_inline static void InitRpmallocPlumbing() 18 | { 19 | const auto done = RpInitDone.load( std::memory_order_acquire ); 20 | if( !done ) 21 | { 22 | int expected = 0; 23 | while( !RpInitLock.compare_exchange_weak( expected, 1, std::memory_order_release, std::memory_order_relaxed ) ) { expected = 0; YieldThread(); } 24 | const auto done = RpInitDone.load( std::memory_order_acquire ); 25 | if( !done ) 26 | { 27 | rpmalloc_initialize(); 28 | RpInitDone.store( 1, std::memory_order_release ); 29 | } 30 | RpInitLock.store( 0, std::memory_order_release ); 31 | } 32 | rpmalloc_thread_initialize(); 33 | RpThreadInitDone = true; 34 | } 35 | 36 | TRACY_API void InitRpmalloc() 37 | { 38 | if( !RpThreadInitDone ) InitRpmallocPlumbing(); 39 | } 40 | 41 | } 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyCallstack.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYCALLSTACK_H__ 2 | #define __TRACYCALLSTACK_H__ 3 | 4 | #ifndef TRACY_NO_CALLSTACK 5 | 6 | # if !defined _WIN32 7 | # include 8 | # endif 9 | 10 | # if defined _WIN32 11 | # include "../common/TracyUwp.hpp" 12 | # ifndef TRACY_UWP 13 | # define TRACY_HAS_CALLSTACK 1 14 | # endif 15 | # elif defined __ANDROID__ 16 | # if !defined __arm__ || __ANDROID_API__ >= 21 17 | # define TRACY_HAS_CALLSTACK 2 18 | # else 19 | # define TRACY_HAS_CALLSTACK 5 20 | # endif 21 | # elif defined __linux 22 | # if defined _GNU_SOURCE && defined __GLIBC__ 23 | # define TRACY_HAS_CALLSTACK 3 24 | # else 25 | # define TRACY_HAS_CALLSTACK 2 26 | # endif 27 | # elif defined __APPLE__ 28 | # define TRACY_HAS_CALLSTACK 4 29 | # elif defined BSD 30 | # define TRACY_HAS_CALLSTACK 6 31 | # endif 32 | 33 | #endif 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyCpuid.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYCPUID_HPP__ 2 | #define __TRACYCPUID_HPP__ 3 | 4 | // Prior to GCC 11 the cpuid.h header did not have any include guards and thus 5 | // including it more than once would cause a compiler error due to symbol 6 | // redefinitions. In order to support older GCC versions, we have to wrap this 7 | // include between custom include guards to prevent this issue. 8 | // See also https://github.com/wolfpld/tracy/issues/452 9 | 10 | #include 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyDebug.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYPRINT_HPP__ 2 | #define __TRACYPRINT_HPP__ 3 | 4 | #ifdef TRACY_VERBOSE 5 | # include 6 | # define TracyDebug(...) fprintf( stderr, __VA_ARGS__ ); 7 | #else 8 | # define TracyDebug(...) 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyDxt1.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYDXT1_HPP__ 2 | #define __TRACYDXT1_HPP__ 3 | 4 | namespace tracy 5 | { 6 | 7 | void CompressImageDxt1( const char* src, char* dst, int w, int h ); 8 | 9 | } 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyStringHelpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSTRINGHELPERS_HPP__ 2 | #define __TRACYSTRINGHELPERS_HPP__ 3 | 4 | #include 5 | #include 6 | 7 | #include "../common/TracyAlloc.hpp" 8 | #include "../common/TracyForceInline.hpp" 9 | 10 | namespace tracy 11 | { 12 | 13 | static tracy_force_inline char* CopyString( const char* src, size_t sz ) 14 | { 15 | auto dst = (char*)tracy_malloc( sz + 1 ); 16 | memcpy( dst, src, sz ); 17 | dst[sz] = '\0'; 18 | return dst; 19 | } 20 | 21 | static tracy_force_inline char* CopyString( const char* src ) 22 | { 23 | return CopyString( src, strlen( src ) ); 24 | } 25 | 26 | static tracy_force_inline char* CopyStringFast( const char* src, size_t sz ) 27 | { 28 | auto dst = (char*)tracy_malloc_fast( sz + 1 ); 29 | memcpy( dst, src, sz ); 30 | dst[sz] = '\0'; 31 | return dst; 32 | } 33 | 34 | static tracy_force_inline char* CopyStringFast( const char* src ) 35 | { 36 | return CopyStringFast( src, strlen( src ) ); 37 | } 38 | 39 | } 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracySysTime.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSTIME_HPP__ 2 | #define __TRACYSYSTIME_HPP__ 3 | 4 | #if defined _WIN32 || defined __linux__ || defined __APPLE__ 5 | # define TRACY_HAS_SYSTIME 6 | #else 7 | # include 8 | #endif 9 | 10 | #ifdef BSD 11 | # define TRACY_HAS_SYSTIME 12 | #endif 13 | 14 | #ifdef TRACY_HAS_SYSTIME 15 | 16 | #include 17 | 18 | namespace tracy 19 | { 20 | 21 | class SysTime 22 | { 23 | public: 24 | SysTime(); 25 | float Get(); 26 | 27 | void ReadTimes(); 28 | 29 | private: 30 | uint64_t idle, used; 31 | }; 32 | 33 | } 34 | #endif 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracySysTrace.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSTRACE_HPP__ 2 | #define __TRACYSYSTRACE_HPP__ 3 | 4 | #if !defined TRACY_NO_SYSTEM_TRACING && ( defined _WIN32 || defined __linux__ ) 5 | # include "../common/TracyUwp.hpp" 6 | # ifndef TRACY_UWP 7 | # define TRACY_HAS_SYSTEM_TRACING 8 | # endif 9 | #endif 10 | 11 | #ifdef TRACY_HAS_SYSTEM_TRACING 12 | 13 | #include 14 | 15 | namespace tracy 16 | { 17 | 18 | bool SysTraceStart( int64_t& samplingPeriod ); 19 | void SysTraceStop(); 20 | void SysTraceWorker( void* ptr ); 21 | 22 | void SysTraceGetExternalName( uint64_t thread, const char*& threadName, const char*& name ); 23 | 24 | } 25 | 26 | #endif 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /source/external/tracy/client/TracyThread.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYTHREAD_HPP__ 2 | #define __TRACYTHREAD_HPP__ 3 | 4 | #if defined _WIN32 5 | # include 6 | #else 7 | # include 8 | #endif 9 | 10 | #ifdef TRACY_MANUAL_LIFETIME 11 | # include "tracy_rpmalloc.hpp" 12 | #endif 13 | 14 | namespace tracy 15 | { 16 | 17 | #ifdef TRACY_MANUAL_LIFETIME 18 | extern thread_local bool RpThreadInitDone; 19 | #endif 20 | 21 | class ThreadExitHandler 22 | { 23 | public: 24 | ~ThreadExitHandler() 25 | { 26 | #ifdef TRACY_MANUAL_LIFETIME 27 | rpmalloc_thread_finalize( 1 ); 28 | RpThreadInitDone = false; 29 | #endif 30 | } 31 | }; 32 | 33 | #if defined _WIN32 34 | 35 | class Thread 36 | { 37 | public: 38 | Thread( void(*func)( void* ptr ), void* ptr ) 39 | : m_func( func ) 40 | , m_ptr( ptr ) 41 | , m_hnd( CreateThread( nullptr, 0, Launch, this, 0, nullptr ) ) 42 | {} 43 | 44 | ~Thread() 45 | { 46 | WaitForSingleObject( m_hnd, INFINITE ); 47 | CloseHandle( m_hnd ); 48 | } 49 | 50 | HANDLE Handle() const { return m_hnd; } 51 | 52 | private: 53 | static DWORD WINAPI Launch( void* ptr ) { ((Thread*)ptr)->m_func( ((Thread*)ptr)->m_ptr ); return 0; } 54 | 55 | void(*m_func)( void* ptr ); 56 | void* m_ptr; 57 | HANDLE m_hnd; 58 | }; 59 | 60 | #else 61 | 62 | class Thread 63 | { 64 | public: 65 | Thread( void(*func)( void* ptr ), void* ptr ) 66 | : m_func( func ) 67 | , m_ptr( ptr ) 68 | { 69 | pthread_create( &m_thread, nullptr, Launch, this ); 70 | } 71 | 72 | ~Thread() 73 | { 74 | pthread_join( m_thread, nullptr ); 75 | } 76 | 77 | pthread_t Handle() const { return m_thread; } 78 | 79 | private: 80 | static void* Launch( void* ptr ) { ((Thread*)ptr)->m_func( ((Thread*)ptr)->m_ptr ); return nullptr; } 81 | void(*m_func)( void* ptr ); 82 | void* m_ptr; 83 | pthread_t m_thread; 84 | }; 85 | 86 | #endif 87 | 88 | } 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyAlign.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYALIGN_HPP__ 2 | #define __TRACYALIGN_HPP__ 3 | 4 | #include 5 | 6 | #include "TracyForceInline.hpp" 7 | 8 | namespace tracy 9 | { 10 | 11 | template 12 | tracy_force_inline T MemRead( const void* ptr ) 13 | { 14 | T val; 15 | memcpy( &val, ptr, sizeof( T ) ); 16 | return val; 17 | } 18 | 19 | template 20 | tracy_force_inline void MemWrite( void* ptr, T val ) 21 | { 22 | memcpy( ptr, &val, sizeof( T ) ); 23 | } 24 | 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyAlloc.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYALLOC_HPP__ 2 | #define __TRACYALLOC_HPP__ 3 | 4 | #include 5 | 6 | #if defined TRACY_ENABLE && !defined __EMSCRIPTEN__ 7 | # include "TracyApi.h" 8 | # include "TracyForceInline.hpp" 9 | # include "../client/tracy_rpmalloc.hpp" 10 | # define TRACY_USE_RPMALLOC 11 | #endif 12 | 13 | namespace tracy 14 | { 15 | 16 | #ifdef TRACY_USE_RPMALLOC 17 | TRACY_API void InitRpmalloc(); 18 | #else 19 | static inline void InitRpmalloc() {} 20 | #endif 21 | 22 | static inline void* tracy_malloc( size_t size ) 23 | { 24 | #ifdef TRACY_USE_RPMALLOC 25 | InitRpmalloc(); 26 | return rpmalloc( size ); 27 | #else 28 | return malloc( size ); 29 | #endif 30 | } 31 | 32 | static inline void* tracy_malloc_fast( size_t size ) 33 | { 34 | #ifdef TRACY_USE_RPMALLOC 35 | return rpmalloc( size ); 36 | #else 37 | return malloc( size ); 38 | #endif 39 | } 40 | 41 | static inline void tracy_free( void* ptr ) 42 | { 43 | #ifdef TRACY_USE_RPMALLOC 44 | InitRpmalloc(); 45 | rpfree( ptr ); 46 | #else 47 | free( ptr ); 48 | #endif 49 | } 50 | 51 | static inline void tracy_free_fast( void* ptr ) 52 | { 53 | #ifdef TRACY_USE_RPMALLOC 54 | rpfree( ptr ); 55 | #else 56 | free( ptr ); 57 | #endif 58 | } 59 | 60 | static inline void* tracy_realloc( void* ptr, size_t size ) 61 | { 62 | #ifdef TRACY_USE_RPMALLOC 63 | InitRpmalloc(); 64 | return rprealloc( ptr, size ); 65 | #else 66 | return realloc( ptr, size ); 67 | #endif 68 | } 69 | 70 | } 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyApi.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYAPI_H__ 2 | #define __TRACYAPI_H__ 3 | 4 | #if defined _WIN32 5 | # if defined TRACY_EXPORTS 6 | # define TRACY_API __declspec(dllexport) 7 | # elif defined TRACY_IMPORTS 8 | # define TRACY_API __declspec(dllimport) 9 | # else 10 | # define TRACY_API 11 | # endif 12 | #else 13 | # define TRACY_API __attribute__((visibility("default"))) 14 | #endif 15 | 16 | #endif // __TRACYAPI_H__ 17 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyForceInline.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYFORCEINLINE_HPP__ 2 | #define __TRACYFORCEINLINE_HPP__ 3 | 4 | #if defined(__GNUC__) 5 | # define tracy_force_inline __attribute__((always_inline)) inline 6 | #elif defined(_MSC_VER) 7 | # define tracy_force_inline __forceinline 8 | #else 9 | # define tracy_force_inline inline 10 | #endif 11 | 12 | #if defined(__GNUC__) 13 | # define tracy_no_inline __attribute__((noinline)) 14 | #elif defined(_MSC_VER) 15 | # define tracy_no_inline __declspec(noinline) 16 | #else 17 | # define tracy_no_inline 18 | #endif 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyMutex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYMUTEX_HPP__ 2 | #define __TRACYMUTEX_HPP__ 3 | 4 | #if defined _MSC_VER 5 | 6 | # include 7 | 8 | namespace tracy 9 | { 10 | using TracyMutex = std::shared_mutex; 11 | } 12 | 13 | #else 14 | 15 | #include 16 | 17 | namespace tracy 18 | { 19 | using TracyMutex = std::mutex; 20 | } 21 | 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyStackFrames.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSTACKFRAMES_HPP__ 2 | #define __TRACYSTACKFRAMES_HPP__ 3 | 4 | #include 5 | 6 | namespace tracy 7 | { 8 | 9 | struct StringMatch 10 | { 11 | const char* str; 12 | size_t len; 13 | }; 14 | 15 | extern const char** s_tracyStackFrames; 16 | extern const StringMatch* s_tracySkipSubframes; 17 | 18 | static constexpr int s_tracySkipSubframesMinLen = 7; 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracySystem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYSYSTEM_HPP__ 2 | #define __TRACYSYSTEM_HPP__ 3 | 4 | #include 5 | 6 | #include "TracyApi.h" 7 | 8 | namespace tracy 9 | { 10 | 11 | namespace detail 12 | { 13 | TRACY_API uint32_t GetThreadHandleImpl(); 14 | } 15 | 16 | #ifdef TRACY_ENABLE 17 | TRACY_API uint32_t GetThreadHandle(); 18 | #else 19 | static inline uint32_t GetThreadHandle() 20 | { 21 | return detail::GetThreadHandleImpl(); 22 | } 23 | #endif 24 | 25 | TRACY_API void SetThreadName( const char* name ); 26 | TRACY_API const char* GetThreadName( uint32_t id ); 27 | 28 | TRACY_API const char* GetEnvVar(const char* name); 29 | 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyUwp.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYUWP_HPP__ 2 | #define __TRACYUWP_HPP__ 3 | 4 | #ifdef _WIN32 5 | # include 6 | # if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) 7 | # define TRACY_UWP 8 | # endif 9 | #endif 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyVersion.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYVERSION_HPP__ 2 | #define __TRACYVERSION_HPP__ 3 | 4 | namespace tracy 5 | { 6 | namespace Version 7 | { 8 | enum { Major = 0 }; 9 | enum { Minor = 9 }; 10 | enum { Patch = 0 }; 11 | } 12 | } 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /source/external/tracy/common/TracyYield.hpp: -------------------------------------------------------------------------------- 1 | #ifndef __TRACYYIELD_HPP__ 2 | #define __TRACYYIELD_HPP__ 3 | 4 | #if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2) 5 | # include 6 | #else 7 | # include 8 | #endif 9 | 10 | #include "TracyForceInline.hpp" 11 | 12 | namespace tracy 13 | { 14 | 15 | static tracy_force_inline void YieldThread() 16 | { 17 | #if defined __SSE2__ || defined _M_AMD64 || (defined _M_IX86_FP && _M_IX86_FP == 2) 18 | _mm_pause(); 19 | #elif defined __aarch64__ 20 | asm volatile( "isb" : : ); 21 | #else 22 | std::this_thread::yield(); 23 | #endif 24 | } 25 | 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /source/external/tracy/libbacktrace/LICENSE: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012-2016 Free Software Foundation, Inc. 2 | 3 | # Redistribution and use in source and binary forms, with or without 4 | # modification, are permitted provided that the following conditions are 5 | # met: 6 | 7 | # (1) Redistributions of source code must retain the above copyright 8 | # notice, this list of conditions and the following disclaimer. 9 | 10 | # (2) Redistributions in binary form must reproduce the above copyright 11 | # notice, this list of conditions and the following disclaimer in 12 | # the documentation and/or other materials provided with the 13 | # distribution. 14 | 15 | # (3) The name of the author may not be used to 16 | # endorse or promote products derived from this software without 17 | # specific prior written permission. 18 | 19 | # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 | # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 | # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 | # DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 23 | # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 | # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 28 | # IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 | # POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /source/external/tracy/libbacktrace/config.h: -------------------------------------------------------------------------------- 1 | #include 2 | #if __WORDSIZE == 64 3 | # define BACKTRACE_ELF_SIZE 64 4 | #else 5 | # define BACKTRACE_ELF_SIZE 32 6 | #endif 7 | 8 | #define HAVE_DLFCN_H 1 9 | #define HAVE_FCNTL 1 10 | #define HAVE_INTTYPES_H 1 11 | #define HAVE_LSTAT 1 12 | #define HAVE_READLINK 1 13 | #define HAVE_DL_ITERATE_PHDR 1 14 | #define HAVE_ATOMIC_FUNCTIONS 1 15 | #define HAVE_DECL_STRNLEN 1 16 | 17 | #ifdef __APPLE__ 18 | # define HAVE_MACH_O_DYLD_H 1 19 | #elif defined BSD 20 | # define HAVE_KERN_PROC 1 21 | # define HAVE_KERN_PROC_ARGS 1 22 | #endif 23 | -------------------------------------------------------------------------------- /source/external/tracy/libbacktrace/filenames.hpp: -------------------------------------------------------------------------------- 1 | /* btest.c -- Filename header for libbacktrace library 2 | Copyright (C) 2012-2018 Free Software Foundation, Inc. 3 | Written by Ian Lance Taylor, Google. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are 7 | met: 8 | 9 | (1) Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 12 | (2) Redistributions in binary form must reproduce the above copyright 13 | notice, this list of conditions and the following disclaimer in 14 | the documentation and/or other materials provided with the 15 | distribution. 16 | 17 | (3) The name of the author may not be used to 18 | endorse or promote products derived from this software without 19 | specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 22 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 25 | INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 29 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 31 | POSSIBILITY OF SUCH DAMAGE. */ 32 | 33 | #ifndef GCC_VERSION 34 | # define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__) 35 | #endif 36 | 37 | #if (GCC_VERSION < 2007) 38 | # define __attribute__(x) 39 | #endif 40 | 41 | #ifndef ATTRIBUTE_UNUSED 42 | # define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) 43 | #endif 44 | 45 | #if defined(__MSDOS__) || defined(_WIN32) || defined(__OS2__) || defined (__CYGWIN__) 46 | # define IS_DIR_SEPARATOR(c) ((c) == '/' || (c) == '\\') 47 | # define HAS_DRIVE_SPEC(f) ((f)[0] != '\0' && (f)[1] == ':') 48 | # define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0]) || HAS_DRIVE_SPEC(f)) 49 | #else 50 | # define IS_DIR_SEPARATOR(c) ((c) == '/') 51 | # define IS_ABSOLUTE_PATH(f) (IS_DIR_SEPARATOR((f)[0])) 52 | #endif 53 | -------------------------------------------------------------------------------- /source/graphics/gltf_scene.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graphics/gpu_resources.hpp" 4 | #include "graphics/render_scene.hpp" 5 | 6 | #include "foundation/gltf.hpp" 7 | 8 | namespace raptor { 9 | // 10 | // 11 | struct glTFScene : public RenderScene { 12 | 13 | void init( SceneGraph* scene_graph, Allocator* resident_allocator, Renderer* renderer ) override; 14 | void add_mesh( cstring filename, cstring path, StackAllocator* temp_allocator, AsynchronousLoader* async_loader ) override; 15 | void shutdown( Renderer* renderer ) override; 16 | 17 | void prepare_draws( Renderer* renderer, StackAllocator* scratch_allocator, SceneGraph* scene_graph ) override; 18 | 19 | void get_mesh_vertex_buffer( glTF::glTF& gltf_scene, u32 buffers_offset, i32 accessor_index, u32 flag, BufferHandle& out_buffer_handle, u32& out_buffer_offset, u32& out_flags ); 20 | u16 get_material_texture( GpuDevice& gpu, glTF::glTF& gltf_scene, glTF::TextureInfo* texture_info ); 21 | u16 get_material_texture( GpuDevice& gpu, glTF::glTF& gltf_scene, i32 gltf_texture_index ); 22 | 23 | void fill_pbr_material( glTF::glTF& gltf_scene, Renderer& renderer, glTF::Material& material, PBRMaterial& pbr_material ); 24 | 25 | // All graphics resources used by the scene 26 | Array images; 27 | Array samplers; 28 | Array buffers; 29 | 30 | Array gltf_scenes; // Source gltf scene 31 | 32 | }; // struct GltfScene 33 | 34 | } // namespace raptor 35 | -------------------------------------------------------------------------------- /source/graphics/obj_scene.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graphics/gpu_resources.hpp" 4 | #include "graphics/render_scene.hpp" 5 | #include "graphics/renderer.hpp" 6 | 7 | struct aiScene; 8 | 9 | namespace raptor 10 | { 11 | // 12 | // 13 | struct ObjScene : public RenderScene { 14 | 15 | void init( SceneGraph* scene_graph, Allocator* resident_allocator, Renderer* renderer_ ) override; 16 | void add_mesh( cstring filename, cstring path, StackAllocator* temp_allocator, AsynchronousLoader* async_loader ) override; 17 | void shutdown( Renderer* renderer ) override; 18 | 19 | void prepare_draws( Renderer* renderer, StackAllocator* scratch_allocator, SceneGraph* scene_graph ) override; 20 | 21 | u32 load_texture( cstring texture_path, cstring path, AsynchronousLoader* async_loader, StackAllocator* temp_allocator ); 22 | 23 | // All graphics resources used by the scene 24 | Array images; 25 | SamplerResource* sampler; 26 | Array cpu_buffers; 27 | Array gpu_buffers; 28 | 29 | Array assimp_scenes; 30 | 31 | }; // struct ObjScene 32 | 33 | } // namespace raptor 34 | -------------------------------------------------------------------------------- /source/graphics/render_resources_loader.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "graphics/renderer.hpp" 4 | 5 | namespace raptor { 6 | 7 | struct FrameGraph; 8 | 9 | // 10 | // 11 | struct RenderResourcesLoader { 12 | 13 | void init( raptor::Renderer* renderer, raptor::StackAllocator* temp_allocator, raptor::FrameGraph* frame_graph ); 14 | void shutdown(); 15 | 16 | GpuTechnique* load_gpu_technique( cstring json_path, bool use_shader_cache, bool& is_shader_changed ); 17 | TextureResource* load_texture( cstring path, bool generate_mipmaps = true ); 18 | 19 | void parse_gpu_technique( GpuTechniqueCreation& technique_creation, cstring json_path, bool use_shader_cache, bool& is_techinque_changed ); 20 | void reload_gpu_technique( cstring json_path, bool use_shader_cache, bool& is_techinque_changed ); 21 | 22 | Renderer* renderer; 23 | FrameGraph* frame_graph; 24 | StackAllocator* temp_allocator; 25 | 26 | }; // struct RenderResourcesLoader 27 | 28 | } // namespace raptor 29 | -------------------------------------------------------------------------------- /source/graphics/scene_graph.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/array.hpp" 4 | #include "foundation/bit.hpp" 5 | 6 | #include "external/cglm/struct/mat4.h" 7 | 8 | namespace raptor { 9 | 10 | // 11 | struct Hierarchy { 12 | i32 parent : 24; 13 | i32 level : 8; 14 | }; // struct Hierarchy 15 | 16 | // 17 | struct SceneGraphNodeDebugData { 18 | cstring name; 19 | }; // struct SceneGraphNodeDebugData 20 | 21 | 22 | // 23 | // 24 | struct SceneGraph { 25 | 26 | void init( Allocator* resident_allocator, u32 num_nodes ); 27 | void shutdown(); 28 | 29 | void init_new_nodes( u32 offset, u32 num_nodes ); 30 | void resize( u32 num_nodes ); 31 | void update_matrices(); 32 | 33 | void set_hierarchy( u32 node_index, u32 parent_index, u32 level ); 34 | void set_local_matrix( u32 node_index, const mat4s& local_matrix ); 35 | void set_debug_data( u32 node_index, cstring name ); 36 | 37 | u32 node_count(); 38 | 39 | Array local_matrices; 40 | Array world_matrices; 41 | Array nodes_hierarchy; 42 | Array< SceneGraphNodeDebugData> nodes_debug_data; 43 | 44 | BitSet updated_nodes; 45 | 46 | bool sort_update_order = true; 47 | 48 | }; // struct SceneGraph 49 | 50 | } // namespace raptor -------------------------------------------------------------------------------- /source/graphics/spirv_parser.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/array.hpp" 4 | #include "graphics/gpu_resources.hpp" 5 | 6 | #if defined(_MSC_VER) 7 | #include 8 | #else 9 | #include 10 | #endif 11 | 12 | namespace raptor { 13 | 14 | struct StringBuffer; 15 | 16 | namespace spirv { 17 | 18 | static const u32 k_max_count = 8; 19 | static const u32 k_max_specialization_constants = 4; 20 | 21 | 22 | struct ConstantValue { 23 | 24 | enum class Type : u8 { 25 | Type_i32 = 0, 26 | Type_u32, 27 | Type_f32, 28 | Type_count 29 | }; // enum Type 30 | 31 | union Value { 32 | 33 | i32 value_i; 34 | u32 value_u; 35 | f32 value_f; 36 | }; // union Value 37 | 38 | Value value; 39 | Type type; 40 | }; // struct ConstantValue 41 | 42 | struct SpecializationConstant { 43 | 44 | u16 binding = 0; 45 | u16 byte_stride = 0; 46 | 47 | ConstantValue default_value; 48 | 49 | }; // struct SpecializationConstant 50 | 51 | struct SpecializationName { 52 | char name[ 32 ]; 53 | }; // struct SpecializationName 54 | 55 | struct ParseResult { 56 | u32 set_count = 0; 57 | u32 specialization_constants_count = 0; 58 | u32 push_constants_stride = 0; 59 | 60 | DescriptorSetLayoutCreation sets[k_max_count]; 61 | SpecializationConstant specialization_constants[ k_max_specialization_constants ]; 62 | SpecializationName specialization_names[ k_max_specialization_constants ]; 63 | 64 | ComputeLocalSize compute_local_size; 65 | }; // struct ParseResult 66 | 67 | void parse_binary( const u32* data, size_t data_size, StringBuffer& name_buffer, ParseResult* parse_result ); 68 | 69 | } // namespace spirv 70 | } // namespace raptor 71 | -------------------------------------------------------------------------------- /source/raptor/application/application.cpp: -------------------------------------------------------------------------------- 1 | #include "application.hpp" 2 | 3 | namespace raptor { 4 | 5 | void Application::run( const ApplicationConfiguration& configuration ) { 6 | 7 | create( configuration ); 8 | main_loop(); 9 | destroy(); 10 | } 11 | 12 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/application/application.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | struct ServiceManager; 8 | 9 | struct ApplicationConfiguration { 10 | 11 | u32 width; 12 | u32 height; 13 | 14 | cstring name = nullptr; 15 | 16 | bool init_base_services = false; 17 | 18 | ApplicationConfiguration& w( u32 value ) { width = value; return *this; } 19 | ApplicationConfiguration& h( u32 value ) { height = value; return *this; } 20 | ApplicationConfiguration& name_( cstring value ) { name = value; return *this; } 21 | 22 | }; // struct ApplicationConfiguration 23 | 24 | struct Application { 25 | // 26 | virtual void create( const ApplicationConfiguration& configuration ) {} 27 | virtual void destroy() {} 28 | virtual bool main_loop() { return false; } 29 | 30 | // Fixed update. Can be called more than once compared to rendering. 31 | virtual void fixed_update( f32 delta ) {} 32 | // Variable time update. Called only once per frame. 33 | virtual void variable_update( f32 delta ) {} 34 | // Rendering with optional interpolation factor. 35 | virtual void render( f32 interpolation ) {} 36 | // Per frame begin/end. 37 | virtual void frame_begin() {} 38 | virtual void frame_end() {} 39 | 40 | void run( const ApplicationConfiguration& configuration ); 41 | 42 | ServiceManager* service_manager = nullptr; 43 | 44 | }; // struct Application 45 | 46 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/application/game_application.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if 0 4 | 5 | #include "application/application.hpp" 6 | 7 | #include "graphics/debug_renderer.hpp" 8 | #include "graphics/camera.hpp" 9 | 10 | #include "foundation/array.hpp" 11 | 12 | // Forward declarations 13 | namespace raptor { 14 | struct ApplicationConfiguration; 15 | struct Window; 16 | struct InputService; 17 | struct MemoryService; 18 | struct LogService; 19 | struct ImGuiService; 20 | 21 | struct Device; 22 | struct Renderer; 23 | struct Texture; 24 | } // namespace raptor 25 | 26 | // GameApplication /////////////////////////////////////////////////////// 27 | 28 | namespace raptor { 29 | 30 | struct GameApplication : public Application { 31 | 32 | void create( const raptor::ApplicationConfiguration& configuration ) override; 33 | void destroy() override; 34 | bool main_loop() override; 35 | 36 | void fixed_update( f32 delta ) override; 37 | void variable_update( f32 delta ) override; 38 | 39 | void frame_begin() override; 40 | void frame_end() override; 41 | 42 | void render( f32 interpolation ) override; 43 | 44 | void on_resize( u32 new_width, u32 new_height ); 45 | 46 | f64 accumulator = 0.0; 47 | f64 current_time = 0.0; 48 | f32 step = 1.0f / 60.0f; 49 | 50 | raptor::Window* window = nullptr; 51 | 52 | raptor::InputService* input = nullptr; 53 | raptor::gfx::Renderer* renderer = nullptr; 54 | raptor::ImGuiService* imgui = nullptr; 55 | 56 | }; // struct GameApp 57 | 58 | } // namespace raptor 59 | 60 | #endif -------------------------------------------------------------------------------- /source/raptor/application/game_camera.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/camera.hpp" 4 | #include "application/keys.hpp" 5 | #include "application/input.hpp" 6 | 7 | namespace raptor { 8 | 9 | // 10 | // 11 | struct GameCamera { 12 | 13 | 14 | void init( bool enabled = true, f32 rotation_speed = 10.f, f32 movement_speed = 10.f, f32 movement_delta = 0.1f ); 15 | void reset(); 16 | 17 | void update( raptor::InputService* input, u32 window_width, u32 window_height, f32 delta_time ); 18 | void apply_jittering( f32 x, f32 y ); 19 | 20 | Camera camera; 21 | 22 | f32 target_yaw; 23 | f32 target_pitch; 24 | 25 | f32 mouse_sensitivity; 26 | f32 movement_delta; 27 | u32 ignore_dragging_frames; 28 | 29 | vec3s target_movement; 30 | 31 | bool enabled; 32 | bool mouse_dragging; 33 | 34 | f32 rotation_speed; 35 | f32 movement_speed; 36 | }; // struct GameCamera 37 | 38 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/application/window.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/service.hpp" 4 | #include "foundation/array.hpp" 5 | 6 | namespace raptor { 7 | 8 | struct WindowConfiguration { 9 | 10 | u32 width; 11 | u32 height; 12 | 13 | cstring name; 14 | 15 | Allocator* allocator; 16 | 17 | }; // struct WindowConfiguration 18 | 19 | typedef void ( *OsMessagesCallback )( void* os_event, void* user_data ); 20 | 21 | struct Window : public Service { 22 | 23 | void init( void* configuration ) override; 24 | void shutdown() override; 25 | 26 | void handle_os_messages(); 27 | 28 | void set_fullscreen( bool value ); 29 | 30 | void register_os_messages_callback( OsMessagesCallback callback, void* user_data ); 31 | void unregister_os_messages_callback( OsMessagesCallback callback ); 32 | 33 | void center_mouse( bool dragging ); 34 | 35 | Array os_messages_callbacks; 36 | Array os_messages_callbacks_data; 37 | 38 | void* platform_handle = nullptr; 39 | bool requested_exit = false; 40 | bool resized = false; 41 | bool minimized = false; 42 | u32 width = 0; 43 | u32 height = 0; 44 | f32 display_refresh = 1.0f / 60.0f; 45 | 46 | static constexpr cstring k_name = "raptor_window_service"; 47 | 48 | }; // struct Window 49 | 50 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/assert.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/source/raptor/foundation/assert.cpp -------------------------------------------------------------------------------- /source/raptor/foundation/assert.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/log.hpp" 4 | 5 | namespace raptor { 6 | 7 | #define RASSERT( condition ) if (!(condition)) { rprint(RAPTOR_FILELINE("FALSE\n")); RAPTOR_DEBUG_BREAK } 8 | #if defined(_MSC_VER) 9 | #define RASSERTM( condition, message, ... ) if (!(condition)) { rprint(RAPTOR_FILELINE(RAPTOR_CONCAT(message, "\n")), __VA_ARGS__); RAPTOR_DEBUG_BREAK } 10 | #else 11 | #define RASSERTM( condition, message, ... ) if (!(condition)) { rprint(RAPTOR_FILELINE(RAPTOR_CONCAT(message, "\n")), ## __VA_ARGS__); RAPTOR_DEBUG_BREAK } 12 | #endif 13 | 14 | } // namespace raptor 15 | -------------------------------------------------------------------------------- /source/raptor/foundation/blob.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | 8 | // 9 | // 10 | // Memory blob used to serialize versioned data. 11 | // Uses a serialized offset to track where to read/write memory from/to, and an allocated 12 | // offset to track where to allocate memory from when writing, so that Relative structures 13 | // like pointers and arrays can be serialized. 14 | // 15 | // TODO: when finalized and when reading, if data version matches between the one written in 16 | // the file and the root structure is marked as 'relative only', memory mappable is doable and 17 | // thus serialization is automatic. 18 | // 19 | struct BlobHeader { 20 | u32 version; 21 | u32 mappable; 22 | }; // struct BlobHeader 23 | 24 | // 25 | // 26 | struct Blob { 27 | BlobHeader header; 28 | }; // struct Blob 29 | 30 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/camera.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | #include "external/cglm/struct/mat4.h" 6 | 7 | namespace raptor { 8 | 9 | // 10 | // Camera struct - can be both perspective and orthographic. 11 | // 12 | struct Camera { 13 | 14 | void init_perpective( f32 near_plane, f32 far_plane, f32 fov_y, f32 aspect_ratio ); 15 | void init_orthographic( f32 near_plane, f32 far_plane, f32 viewport_width, f32 viewport_height, f32 zoom ); 16 | 17 | void reset(); 18 | 19 | void set_viewport_size( f32 width, f32 height ); 20 | void set_zoom( f32 zoom ); 21 | void set_aspect_ratio( f32 aspect_ratio ); 22 | void set_fov_y( f32 fov_y ); 23 | 24 | void update(); 25 | void rotate( f32 delta_pitch, f32 delta_yaw ); 26 | 27 | void calculate_projection_matrix(); 28 | void calculate_view_projection(); 29 | 30 | // Project/unproject 31 | vec3s unproject( const vec3s& screen_coordinates ); 32 | 33 | // Unproject by inverting the y of the screen coordinate. 34 | vec3s unproject_inverted_y( const vec3s& screen_coordinates ); 35 | 36 | void get_projection_ortho_2d( mat4& out_matrix ); 37 | 38 | static void yaw_pitch_from_direction( const vec3s& direction, f32 & yaw, f32& pitch ); 39 | 40 | mat4s view; 41 | mat4s projection; 42 | mat4s view_projection; 43 | 44 | vec3s position; 45 | vec3s right; 46 | vec3s direction; 47 | vec3s up; 48 | 49 | f32 yaw; 50 | f32 pitch; 51 | 52 | f32 near_plane; 53 | f32 far_plane; 54 | 55 | f32 field_of_view_y; 56 | f32 aspect_ratio; 57 | 58 | f32 zoom; 59 | f32 viewport_width; 60 | f32 viewport_height; 61 | 62 | bool perspective; 63 | bool update_projection; 64 | 65 | }; // struct Camera 66 | 67 | } // namespace raptor 68 | -------------------------------------------------------------------------------- /source/raptor/foundation/color.cpp: -------------------------------------------------------------------------------- 1 | #include "color.hpp" 2 | 3 | namespace raptor { 4 | 5 | // 6 | // 64 Distinct Colors. Used for graphs and anything that needs random colors. 7 | // 8 | static const u32 k_distinct_colors[] = { 9 | 0xFF000000, 0xFF00FF00, 0xFFFF0000, 0xFF0000FF, 0xFFFEFF01, 0xFFFEA6FF, 0xFF66DBFF, 0xFF016400, 10 | 0xFF670001, 0xFF3A0095, 0xFFB57D00, 0xFFF600FF, 0xFFE8EEFF, 0xFF004D77, 0xFF92FB90, 0xFFFF7600, 11 | 0xFF00FFD5, 0xFF7E93FF, 0xFF6C826A, 0xFF9D02FF, 0xFF0089FE, 0xFF82477A, 0xFFD22D7E, 0xFF00A985, 12 | 0xFF5600FF, 0xFF0024A4, 0xFF7EAE00, 0xFF3B3D68, 0xFFFFC6BD, 0xFF003426, 0xFF93D3BD, 0xFF17B900, 13 | 0xFF8E009E, 0xFF441500, 0xFF9F8CC2, 0xFFA374FF, 0xFFFFD001, 0xFF544700, 0xFFFE6FE5, 0xFF318278, 14 | 0xFFA14C0E, 0xFFCBD091, 0xFF7099BE, 0xFFE88A96, 0xFF0088BB, 0xFF2C0043, 0xFF74FFDE, 0xFFC6FF00, 15 | 0xFF02E5FF, 0xFF000E62, 0xFF9C8F00, 0xFF52FF98, 0xFFB14475, 0xFFFF00B5, 0xFF78FF00, 0xFF416EFF, 16 | 0xFF395F00, 0xFF82686B, 0xFF4EAD5F, 0xFF4057A7, 0xFFD2FFA5, 0xFF67B1FF, 0xFFFF9B00, 0xFFBE5EE8 17 | }; 18 | 19 | u32 Color::get_distinct_color( u32 index ) { 20 | return k_distinct_colors[ index % 64 ]; 21 | } 22 | 23 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/color.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | // 8 | // Color class that embeds color in a uint32. 9 | // 10 | struct Color { 11 | 12 | void set( float r, float g, float b, float a ) { abgr = uint8_t( r * 255.f ) | ( uint8_t( g * 255.f ) << 8 ) | ( uint8_t( b * 255.f ) << 16 ) | ( uint8_t( a * 255.f ) << 24 ); } 13 | 14 | f32 r() const { return ( abgr & 0xff ) / 255.f; } 15 | f32 g() const { return ( ( abgr >> 8 ) & 0xff ) / 255.f; } 16 | f32 b() const { return ( ( abgr >> 16 ) & 0xff ) / 255.f; } 17 | f32 a() const { return ( ( abgr >> 24 ) & 0xff ) / 255.f; } 18 | 19 | Color operator=( const u32 color ) { abgr = color; return *this; } 20 | 21 | static u32 from_u8( u8 r, u8 g, u8 b, u8 a ) { return ( r | ( g << 8 ) | ( b << 16 ) | ( a << 24 ) ); } 22 | 23 | static u32 get_distinct_color( u32 index ); 24 | 25 | static const u32 red = 0xff0000ff; 26 | static const u32 green = 0xff00ff00; 27 | static const u32 blue = 0xffff0000; 28 | static const u32 yellow = 0xff00ffff; 29 | static const u32 black = 0xff000000; 30 | static const u32 white = 0xffffffff; 31 | static const u32 transparent = 0x00000000; 32 | 33 | u32 abgr; 34 | 35 | }; // struct Color 36 | 37 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/log.cpp: -------------------------------------------------------------------------------- 1 | #include "log.hpp" 2 | 3 | #if defined(_MSC_VER) 4 | #define WIN32_LEAN_AND_MEAN 5 | #include 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | namespace raptor { 12 | 13 | LogService s_log_service; 14 | 15 | static constexpr u32 k_string_buffer_size = 1024 * 1024; 16 | static char log_buffer[ k_string_buffer_size ]; 17 | 18 | static void output_console( char* log_buffer_ ) { 19 | printf( "%s", log_buffer_ ); 20 | } 21 | 22 | #if defined(_MSC_VER) 23 | static void output_visual_studio( char* log_buffer_ ) { 24 | OutputDebugStringA( log_buffer_ ); 25 | } 26 | #endif 27 | 28 | LogService* LogService::instance() { 29 | return &s_log_service; 30 | } 31 | 32 | void LogService::print_format( cstring format, ... ) { 33 | va_list args; 34 | 35 | va_start( args, format ); 36 | #if defined(_MSC_VER) 37 | vsnprintf_s( log_buffer, ArraySize( log_buffer ), format, args ); 38 | #else 39 | vsnprintf( log_buffer, ArraySize( log_buffer), format, args ); 40 | #endif 41 | log_buffer[ ArraySize( log_buffer ) - 1 ] = '\0'; 42 | va_end( args ); 43 | 44 | output_console( log_buffer ); 45 | #if defined(_MSC_VER) 46 | output_visual_studio( log_buffer ); 47 | #endif // _MSC_VER 48 | 49 | if ( print_callback ) 50 | print_callback( log_buffer ); 51 | } 52 | 53 | void LogService::set_callback( PrintCallback callback ) { 54 | print_callback = callback; 55 | } 56 | 57 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/log.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | #include "foundation/service.hpp" 5 | 6 | namespace raptor { 7 | 8 | typedef void ( *PrintCallback )( const char* ); // Additional callback for printing 9 | 10 | struct LogService : public Service { 11 | 12 | RAPTOR_DECLARE_SERVICE( LogService ); 13 | 14 | void print_format( cstring format, ... ); 15 | 16 | void set_callback( PrintCallback callback ); 17 | 18 | PrintCallback print_callback = nullptr; 19 | 20 | static constexpr cstring k_name = "raptor_log_service"; 21 | }; 22 | 23 | #if defined(_MSC_VER) 24 | #define rprint(format, ...) raptor::LogService::instance()->print_format(format, __VA_ARGS__); 25 | #define rprintret(format, ...) raptor::LogService::instance()->print_format(format, __VA_ARGS__); raptor::LogService::instance()->print_format("\n"); 26 | #else 27 | #define rprint(format, ...) raptor::LogService::instance()->print_format(format, ## __VA_ARGS__); 28 | #define rprintret(format, ...) raptor::LogService::instance()->print_format(format, ## __VA_ARGS__); raptor::LogService::instance()->print_format("\n"); 29 | #endif 30 | 31 | } // namespace raptor 32 | -------------------------------------------------------------------------------- /source/raptor/foundation/memory_utils.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | 8 | 9 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/process.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | bool process_execute( cstring working_directory, cstring process_fullpath, cstring arguments, cstring search_error_string = "" ); 8 | cstring process_get_output(); 9 | 10 | } // namespace raptor 11 | -------------------------------------------------------------------------------- /source/raptor/foundation/resource_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "resource_manager.hpp" 2 | 3 | namespace raptor { 4 | 5 | void ResourceManager::init( Allocator* allocator_, ResourceFilenameResolver* resolver ) { 6 | 7 | this->allocator = allocator_; 8 | this->filename_resolver = resolver; 9 | 10 | loaders.init( allocator, 8 ); 11 | compilers.init( allocator, 8 ); 12 | } 13 | 14 | void ResourceManager::shutdown() { 15 | 16 | loaders.shutdown(); 17 | compilers.shutdown(); 18 | } 19 | 20 | void ResourceManager::set_loader( cstring resource_type, ResourceLoader* loader ) { 21 | const u64 hashed_name = hash_calculate( resource_type ); 22 | loaders.insert( hashed_name, loader ); 23 | } 24 | 25 | void ResourceManager::set_compiler( cstring resource_type, ResourceCompiler* compiler ) { 26 | const u64 hashed_name = hash_calculate( resource_type ); 27 | compilers.insert( hashed_name, compiler ); 28 | } 29 | 30 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/serialization.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | #include "foundation/file.hpp" 5 | 6 | namespace raptor { 7 | 8 | // Serialization taken from article https://yave.handmade.network/blogs/p/2723-how_media_molecule_does_serialization 9 | /* 10 | struct Serializer { 11 | 12 | void start_writing( FILE* file, u32 data_version ); 13 | void start_reading( FILE* file ); 14 | 15 | FILE* file_handle; 16 | u32 data_version; 17 | u8 is_writing; 18 | 19 | }; // struct Serializer 20 | 21 | // Serialization methods 22 | void Serialize( Serializer* s, i8* data ); 23 | void Serialize( Serializer* s, u8* data ); 24 | void Serialize( Serializer* s, i16* data ); 25 | void Serialize( Serializer* s, u16* data ); 26 | void Serialize( Serializer* s, i32* data ); 27 | void Serialize( Serializer* s, u32* data ); 28 | void Serialize( Serializer* s, i64* data ); 29 | void Serialize( Serializer* s, u64* data ); 30 | void Serialize( Serializer* s, f32* data ); 31 | void Serialize( Serializer* s, f64* data ); 32 | void Serialize( Serializer* s, bool* data ); 33 | 34 | 35 | // Serialization macros 36 | #define VERSION_IN_RANGE(_from, _to) \ 37 | (s->data_version >= (_from) && serializer->data_version < (_to)) 38 | 39 | #define ADD(_fieldAdded, _fieldName) \ 40 | if (s->data_version >= (_fieldAdded)) \ 41 | { \ 42 | Serialize(s, &(data->_fieldName)); \ 43 | } 44 | 45 | #define ADD_TYPED(_fieldAdded, _fieldName, _castType) \ 46 | if (s->data_version >= (_fieldAdded)) \ 47 | { \ 48 | Serialize(s, (_castType*)&(data->_fieldName)); \ 49 | } 50 | 51 | #define ADD_LOCAL(_localAdded, _type, _localName, _defaultValue) \ 52 | _type _localName = (_defaultValue); \ 53 | if (s->data_version >= (_localAdded)) \ 54 | { \ 55 | Serialize(s, &(_localName)); \ 56 | } 57 | 58 | #define REM(_fieldAdded, _fieldRemoved, _type, _fieldName, _defaultValue) \ 59 | _type _fieldName = (_defaultValue); \ 60 | if (VERSION_IN_RANGE((_fieldAdded),(_fieldRemoved))) \ 61 | { \ 62 | Serialize(s, &(_fieldName)); \ 63 | } 64 | */ 65 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/service.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CU-Production/VulkanRenderer/1f8b81e1483f289df50315df42dd3683109ceb86/source/raptor/foundation/service.cpp -------------------------------------------------------------------------------- /source/raptor/foundation/service.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | struct Service { 8 | 9 | virtual void init( void* configuration ) { } 10 | virtual void shutdown() { } 11 | 12 | }; // struct Service 13 | 14 | #define RAPTOR_DECLARE_SERVICE(Type) static Type* instance(); 15 | 16 | } // namespace raptor 17 | -------------------------------------------------------------------------------- /source/raptor/foundation/service_manager.cpp: -------------------------------------------------------------------------------- 1 | #include "service_manager.hpp" 2 | #include "assert.hpp" 3 | 4 | namespace raptor { 5 | 6 | static ServiceManager s_service_manager; 7 | ServiceManager* ServiceManager::instance = &s_service_manager; 8 | 9 | void ServiceManager::init( Allocator* allocator_ ) { 10 | 11 | rprint( "ServiceManager init\n" ); 12 | allocator = allocator_; 13 | 14 | services.init( allocator, 8 ); 15 | } 16 | 17 | void ServiceManager::shutdown() { 18 | 19 | services.shutdown(); 20 | 21 | rprint( "ServiceManager shutdown\n" ); 22 | } 23 | 24 | void ServiceManager::add_service( Service* service, cstring name ) { 25 | u64 hash_name = hash_calculate( name ); 26 | FlatHashMapIterator it = services.find( hash_name ); 27 | RASSERTM( it.is_invalid(), "Overwriting service %s, is this intended ?", name ); 28 | services.insert( hash_name, service ); 29 | } 30 | 31 | void ServiceManager::remove_service( cstring name ) { 32 | u64 hash_name = hash_calculate( name ); 33 | services.remove( hash_name ); 34 | } 35 | 36 | Service* ServiceManager::get_service( cstring name ) { 37 | u64 hash_name = hash_calculate( name ); 38 | return services.get( hash_name ); 39 | } 40 | 41 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/service_manager.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/array.hpp" 4 | #include "foundation/hash_map.hpp" 5 | 6 | namespace raptor { 7 | 8 | struct Service; 9 | 10 | struct ServiceManager { 11 | 12 | void init( Allocator* allocator ); 13 | void shutdown(); 14 | 15 | void add_service( Service* service, cstring name ); 16 | void remove_service( cstring name ); 17 | 18 | Service* get_service( cstring name ); 19 | 20 | template 21 | T* get(); 22 | 23 | static ServiceManager* instance; 24 | 25 | FlatHashMap services; 26 | Allocator* allocator = nullptr; 27 | 28 | }; // struct ServiceManager 29 | 30 | template 31 | inline T* ServiceManager::get() { 32 | T* service = ( T* )get_service( T::k_name ); 33 | if ( !service ) { 34 | add_service( T::instance(), T::k_name ); 35 | } 36 | 37 | return T::instance(); 38 | } 39 | 40 | } // namespace raptor 41 | -------------------------------------------------------------------------------- /source/raptor/foundation/time.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "foundation/platform.hpp" 4 | 5 | namespace raptor { 6 | 7 | void time_service_init(); // Needs to be called once at startup. 8 | void time_service_shutdown(); // Needs to be called at shutdown. 9 | 10 | i64 time_now(); // Get current time ticks. 11 | 12 | double time_microseconds( i64 time ); // Get microseconds from time ticks 13 | double time_milliseconds( i64 time ); // Get milliseconds from time ticks 14 | double time_seconds( i64 time ); // Get seconds from time ticks 15 | 16 | i64 time_from( i64 starting_time ); // Get time difference from start to current time. 17 | double time_from_microseconds( i64 starting_time ); // Convenience method. 18 | double time_from_milliseconds( i64 starting_time ); // Convenience method. 19 | double time_from_seconds( i64 starting_time ); // Convenience method. 20 | 21 | double time_delta_seconds( i64 starting_time, i64 ending_time ); 22 | double time_delta_milliseconds( i64 starting_time, i64 ending_time ); 23 | 24 | } // namespace raptor -------------------------------------------------------------------------------- /source/raptor/foundation/windows_declarations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef int BOOL; 4 | typedef char CHAR; 5 | typedef unsigned long DWORD; 6 | typedef DWORD* LPDWORD; 7 | typedef unsigned long long DWORD64; 8 | typedef unsigned long long ULONGLONG; 9 | typedef const wchar_t* LPCWSTR; 10 | typedef const char* LPCSTR; 11 | typedef char* LPSTR; 12 | typedef void* HANDLE; 13 | typedef void* PVOID; 14 | typedef void* LPVOID; 15 | 16 | typedef struct _SECURITY_ATTRIBUTES SECURITY_ATTRIBUTES; 17 | 18 | #define FORWARD_DECLARE_HANDLE(name) struct name##__; typedef struct name##__ *name 19 | 20 | FORWARD_DECLARE_HANDLE( HINSTANCE ); 21 | FORWARD_DECLARE_HANDLE( HWND ); 22 | FORWARD_DECLARE_HANDLE( HMONITOR ); 23 | 24 | #define NULL 0 25 | -------------------------------------------------------------------------------- /source/shaders/cloth.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "cloth", 3 | "pipelines" : [ 4 | { 5 | "name" : "compute", 6 | "render_pass" : "", 7 | "shaders" : [ 8 | { 9 | "stage" : "compute", 10 | "shader" : "cloth.glsl", 11 | "includes" : [ "platform.h" ] 12 | } 13 | ] 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /source/shaders/culling.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "culling", 3 | "pipelines" : [ 4 | { 5 | "name" : "gpu_mesh_culling", 6 | "render_pass" : "culling_pass", 7 | "shaders" : [ 8 | { 9 | "stage" : "compute", 10 | "shader" : "culling.glsl", 11 | "includes" : [ "platform.h", "scene.h", "mesh.h", "debug_rendering.h", "culling.h" ] 12 | } 13 | ] 14 | }, 15 | { 16 | "name" : "depth_pyramid", 17 | "render_pass" : "depth_pre_pass", 18 | "shaders" : [ 19 | { 20 | "stage" : "compute", 21 | "shader" : "depth_pyramid.glsl", 22 | "includes" : [ "platform.h" ] 23 | } 24 | ] 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /source/shaders/debug_mesh.glsl: -------------------------------------------------------------------------------- 1 | struct PhysicsVertex { 2 | vec3 position; 3 | vec3 start_position; 4 | vec3 previous_position; 5 | vec3 normal; 6 | uint joint_count; 7 | vec3 velocity; 8 | float mass; 9 | vec3 force; // TODO(marco): maybe we can remove this 10 | uint joints[ 12 ]; 11 | }; 12 | 13 | layout ( set = MATERIAL_SET, binding = 1 ) readonly buffer SphereTransforms { 14 | mat4 transforms[]; 15 | }; 16 | 17 | #if defined(VERTEX_DEBUG_MESH) 18 | 19 | layout(location=0) in vec3 position; 20 | 21 | layout(location=0) flat out uint draw_id; 22 | 23 | void main() { 24 | draw_id = gl_DrawIDARB; 25 | gl_Position = view_projection * vec4( transforms[gl_DrawIDARB] * vec4( position, 1.0 ) ); 26 | } 27 | 28 | #endif // VERTEX 29 | 30 | 31 | #if defined (FRAGMENT_DEBUG_MESH) 32 | 33 | layout (location = 0) flat in uint draw_id; 34 | 35 | layout (location = 0) out vec4 colour; 36 | 37 | uint hash(uint a) 38 | { 39 | a = (a+0x7ed55d16) + (a<<12); 40 | a = (a^0xc761c23c) ^ (a>>19); 41 | a = (a+0x165667b1) + (a<<5); 42 | a = (a+0xd3a2646c) ^ (a<<9); 43 | a = (a+0xfd7046c5) + (a<<3); 44 | a = (a^0xb55a4f09) ^ (a>>16); 45 | return a; 46 | } 47 | 48 | void main() { 49 | 50 | uint mhash = hash(draw_id); 51 | colour = vec4( vec3(float(mhash & 255), float((mhash >> 8) & 255), float((mhash >> 16) & 255)) / 255.0, 0.6 ); 52 | } 53 | 54 | #endif // FRAGMENT 55 | -------------------------------------------------------------------------------- /source/shaders/depth.glsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | #if defined(VERTEX_DEPTH_PRE) 4 | 5 | layout(location=0) in vec3 position; 6 | 7 | void main() { 8 | MeshInstanceDraw mesh_draw = mesh_instance_draws[gl_InstanceIndex]; 9 | gl_Position = view_projection * mesh_draw.model * vec4(position, 1.0); 10 | } 11 | 12 | #endif // VERTEX 13 | 14 | #if defined (VERTEX_DEPTH_CUBEMAP) 15 | 16 | #extension GL_EXT_multiview : require 17 | 18 | layout ( std140, set = 2, binding = 0 ) readonly uniform Views { 19 | 20 | mat4 view_projections[6]; 21 | vec4 camera_sphere; 22 | }; 23 | 24 | layout(location=0) in vec3 position; 25 | 26 | void main() { 27 | MeshInstanceDraw mesh_draw = mesh_instance_draws[gl_InstanceIndex]; 28 | gl_Position = view_projections[gl_ViewIndex] * mesh_draw.model * vec4(position, 1.0); 29 | } 30 | 31 | #endif // VERTEX_DEPTH_CUBEMAP 32 | 33 | 34 | #if defined (FRAGMENT_DEPTH_PRE_SKINNING) 35 | 36 | layout (location = 0) in vec2 vTexcoord0; 37 | layout (location = 1) in flat uint mesh_draw_index; 38 | 39 | void main() { 40 | 41 | MeshDraw mesh_draw = mesh_draws[mesh_draw_index]; 42 | uint flags = mesh_draw.flags; 43 | uvec4 textures = mesh_draw.textures; 44 | 45 | float texture_alpha = texture(global_textures[nonuniformEXT(textures.x)], vTexcoord0).a; 46 | 47 | bool useAlphaMask = (flags & DrawFlags_AlphaMask) != 0; 48 | if (useAlphaMask && texture_alpha < mesh_draw.alpha_cutoff) { 49 | discard; 50 | } 51 | 52 | bool use_alpha_dither = (flags & DrawFlags_AlphaDither) != 0; 53 | if ( use_alpha_dither ) { 54 | float dithered_alpha = dither(gl_FragCoord.xy, texture_alpha); 55 | if (dithered_alpha < 0.001f) { 56 | discard; 57 | } 58 | } 59 | } 60 | 61 | #endif // FRAGMENT -------------------------------------------------------------------------------- /source/shaders/depth_pyramid.glsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | #if defined(COMPUTE_DEPTH_PYRAMID) 4 | 5 | layout(set = MATERIAL_SET, binding = 0) uniform sampler2D src; 6 | 7 | layout(set = MATERIAL_SET, binding = 1) uniform writeonly image2D dst; 8 | 9 | // TODO(marco): use push constants to select LOD 10 | 11 | layout (local_size_x = 8, local_size_y = 8, local_size_z = 1) in; 12 | 13 | void main() { 14 | ivec2 texel_position00 = ivec2( gl_GlobalInvocationID.xy ) * 2; 15 | ivec2 texel_position01 = texel_position00 + ivec2(0, 1); 16 | ivec2 texel_position10 = texel_position00 + ivec2(1, 0); 17 | ivec2 texel_position11 = texel_position00 + ivec2(1, 1); 18 | 19 | float color00 = texelFetch( src, texel_position00, 0 ).r; 20 | float color01 = texelFetch( src, texel_position01, 0 ).r; 21 | float color10 = texelFetch( src, texel_position10, 0 ).r; 22 | float color11 = texelFetch( src, texel_position11, 0 ).r; 23 | 24 | float result = max( max( max( color00, color01 ), color10 ), color11 ); 25 | 26 | imageStore( dst, ivec2( gl_GlobalInvocationID.xy ), vec4( result, 0, 0, 0 ) ); 27 | 28 | groupMemoryBarrier(); 29 | barrier(); 30 | } 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /source/shaders/depth_skinned.vert: -------------------------------------------------------------------------------- 1 | 2 | 3 | layout (location = 0) in vec3 position; 4 | layout (location = 3) in vec2 texCoord0; 5 | layout (location = 4) in ivec4 jointIndices; 6 | layout (location = 5) in vec4 jointWeights; 7 | 8 | layout (location = 0) out vec2 vTexcoord0; 9 | layout (location = 1) out flat uint mesh_draw_index; 10 | 11 | layout(std430, set = MATERIAL_SET, binding = 3) readonly buffer JointMatrices { 12 | mat4 joint_matrices[]; 13 | }; 14 | 15 | void main() { 16 | 17 | MeshInstanceDraw mesh_draw = mesh_instance_draws[gl_InstanceIndex]; 18 | mesh_draw_index = mesh_draw.mesh_draw_index; 19 | 20 | mat4 skinning_transform = 21 | jointWeights.x * joint_matrices[(jointIndices.x)] + 22 | jointWeights.y * joint_matrices[(jointIndices.y)] + 23 | jointWeights.z * joint_matrices[(jointIndices.z)] + 24 | jointWeights.w * joint_matrices[(jointIndices.w)]; 25 | 26 | // Better to separate multiplications to minimize precision issues, visible as Z-Fighting. 27 | vec4 worldPosition = mesh_draw.model * skinning_transform * vec4(position, 1.0); 28 | 29 | gl_Position = view_projection * worldPosition; 30 | 31 | vTexcoord0 = texCoord0; 32 | } 33 | -------------------------------------------------------------------------------- /source/shaders/dof.glsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | #if defined(VERTEX_MAIN) 4 | 5 | layout(location=0) in vec3 position; 6 | 7 | layout (location = 0) out vec2 vTexcoord0; 8 | 9 | void main() { 10 | 11 | vTexcoord0.xy = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2); 12 | gl_Position = vec4(vTexcoord0.xy * 2.0f - 1.0f, 0.0f, 1.0f); 13 | gl_Position.y = -gl_Position.y; 14 | } 15 | 16 | #endif // VERTEX 17 | 18 | #if defined (FRAGMENT_MAIN) 19 | 20 | layout ( std140, set = MATERIAL_SET, binding = 0 ) uniform CameraParameters { 21 | 22 | // x = diffuse index, y = depth index 23 | uvec4 textures; 24 | float znear; 25 | float zfar; 26 | float focal_length; 27 | float plane_in_focus; 28 | float aperture; 29 | }; 30 | 31 | layout (location = 0) in vec2 vTexcoord0; 32 | 33 | layout (location = 0) out vec4 frag_color; 34 | 35 | void main() { 36 | float z = texture(global_textures[nonuniformEXT(textures.y)], vTexcoord0).r; 37 | 38 | if (z < 1.0) 39 | { 40 | float object_distance = -zfar * znear / (z * (zfar - znear) - zfar); 41 | // float coc_scale = (aperture * focal_length * plane_in_focus * (zfar - znear)) / ((plane_in_focus - focal_length) * znear * zfar); 42 | // float coc_bias = (aperture * focal_length * (znear - plane_in_focus)) / ((plane_in_focus * focal_length) * znear); 43 | 44 | // float coc = abs(z * coc_scale + coc_bias); 45 | float coc = abs(aperture * (focal_length * (object_distance - plane_in_focus)) / (object_distance * (plane_in_focus - focal_length))); 46 | float max_coc = abs(aperture * (focal_length * (zfar - plane_in_focus)) / (object_distance * (plane_in_focus - focal_length))); 47 | coc = coc / max_coc; 48 | 49 | vec4 base_colour = textureGrad(global_textures[nonuniformEXT(textures.x)], vTexcoord0, vec2(coc, coc), vec2(coc, coc)); 50 | 51 | frag_color = vec4( base_colour.rgb, 1.0 ); 52 | } else { 53 | frag_color = texture(global_textures[nonuniformEXT(textures.x)], vTexcoord0); 54 | } 55 | } 56 | 57 | #endif // FRAGMENT 58 | -------------------------------------------------------------------------------- /source/shaders/dof.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "depth_of_field", 3 | "vertex_inputs" : [ 4 | { 5 | "name" : "dof", 6 | "vertex_attributes" : [ 7 | { 8 | "attribute_location" : 0, 9 | "attribute_binding" : 0, 10 | "attribute_offset" : 0, 11 | "attribute_format" : "Float3" 12 | } 13 | ], 14 | "vertex_streams" : [ 15 | { 16 | "stream_binding" : 0, 17 | "stream_stride" : 12, 18 | "stream_rate" : "Vertex" 19 | } 20 | ] 21 | } 22 | ], 23 | "pipelines" : [ 24 | { 25 | "name" : "main", 26 | "render_pass" : "depth_of_field_pass", 27 | "vertex_input" : "dof", 28 | "shaders" : [ 29 | { 30 | "stage" : "vertex", 31 | "shader" : "dof.glsl", 32 | "includes" : ["platform.h"] 33 | }, 34 | { 35 | "stage" : "fragment", 36 | "shader" : "dof.glsl", 37 | "includes" : ["platform.h"] 38 | } 39 | ] 40 | } 41 | ] 42 | } 43 | -------------------------------------------------------------------------------- /source/shaders/fullscreen.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "fullscreen", 3 | "pipelines" : [ 4 | { 5 | "name" : "main_triangle", 6 | "render_pass" : "swapchain", 7 | "shaders" : [ 8 | { 9 | "stage" : "vertex", 10 | "shader" : "fullscreen.glsl", 11 | "includes" : ["platform.h"] 12 | }, 13 | { 14 | "stage" : "fragment", 15 | "shader" : "fullscreen.glsl", 16 | "includes" : ["platform.h"] 17 | } 18 | ] 19 | }, 20 | { 21 | "name" : "temporal_aa", 22 | "render_pass" : "temporal_anti_aliasing_pass", 23 | "shaders" : [ 24 | { 25 | "stage" : "compute", 26 | "shader" : "fullscreen.glsl", 27 | "includes" : ["platform.h", "scene.h"] 28 | } 29 | ] 30 | }, 31 | { 32 | "name" : "composite_camera_motion", 33 | "render_pass" : "motion_vector_pass", 34 | "shaders" : [ 35 | { 36 | "stage" : "compute", 37 | "shader" : "fullscreen.glsl", 38 | "includes" : ["platform.h", "scene.h"] 39 | } 40 | ] 41 | }, 42 | { 43 | "name" : "main_post", 44 | "render_pass" : "swapchain", 45 | "shaders" : [ 46 | { 47 | "stage" : "vertex", 48 | "shader" : "fullscreen.glsl", 49 | "includes" : ["platform.h", "scene.h"] 50 | }, 51 | { 52 | "stage" : "fragment", 53 | "shader" : "fullscreen.glsl", 54 | "includes" : ["platform.h", "scene.h"] 55 | } 56 | ] 57 | }, 58 | { 59 | "name" : "bilateral_weights", 60 | "render_pass" : "depth_pyramid_pass", 61 | "shaders" : [ 62 | { 63 | "stage" : "compute", 64 | "shader" : "fullscreen.glsl", 65 | "includes" : ["platform.h", "scene.h"] 66 | } 67 | ] 68 | } 69 | ] 70 | } -------------------------------------------------------------------------------- /source/shaders/meshlet.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef RAPTOR_GLSL_MESHLET_H 3 | #define RAPTOR_GLSL_MESHLET_H 4 | 5 | #extension GL_EXT_shader_16bit_storage: require 6 | #extension GL_EXT_shader_8bit_storage: require 7 | 8 | #extension GL_KHR_shader_subgroup_basic : require 9 | #extension GL_KHR_shader_subgroup_ballot: require 10 | 11 | #if defined (TASK) || defined(MESH) 12 | 13 | // Needed extension for mesh and task shaders. 14 | #extension GL_NV_mesh_shader: require 15 | 16 | #endif // TASK || MESH 17 | 18 | #define DEBUG 0 19 | //#define PER_MESHLET_INDEX_WRITE 1 20 | 21 | // Common data 22 | struct VertexExtraData 23 | { 24 | uint8_t nx, ny, nz, nw; // normal 25 | uint8_t tx, ty, tz, tw; // tangent 26 | float16_t tu, tv; // tex coords 27 | float padding; 28 | }; 29 | 30 | struct VertexPosition 31 | { 32 | vec3 v; 33 | float padding; 34 | }; 35 | 36 | struct Meshlet 37 | { 38 | vec3 center; 39 | float radius; 40 | 41 | int8_t cone_axis[3]; 42 | int8_t cone_cutoff; 43 | 44 | uint data_offset; 45 | uint mesh_index; 46 | uint8_t vertex_count; 47 | uint8_t triangle_count; 48 | }; 49 | 50 | #endif // RAPTOR_GLSL_MESHLET_H 51 | -------------------------------------------------------------------------------- /source/shaders/pbr_lighting.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "pbr_lighting", 3 | "vertex_inputs" : [ 4 | { 5 | "name" : "tri", 6 | "vertex_attributes" : [ 7 | { 8 | "attribute_location" : 0, 9 | "attribute_binding" : 0, 10 | "attribute_offset" : 0, 11 | "attribute_format" : "Float3" 12 | } 13 | ], 14 | "vertex_streams" : [ 15 | { 16 | "stream_binding" : 0, 17 | "stream_stride" : 12, 18 | "stream_rate" : "Vertex" 19 | } 20 | ] 21 | } 22 | ], 23 | "pipelines" : [ 24 | { 25 | "name" : "deferred_lighting_pixel", 26 | "vertex_input" : "tri", 27 | "render_pass" : "lighting_pass", 28 | "flags": "shading_rate_image", 29 | "depth" : { 30 | "write" : false, 31 | "test" : "never" 32 | }, 33 | "shaders" : [ 34 | { 35 | "stage" : "vertex", 36 | "shader" : "pbr.glsl", 37 | "includes" : ["platform.h"] 38 | }, 39 | { 40 | "stage" : "fragment", 41 | "shader" : "pbr.glsl", 42 | "includes" : ["platform.h", "scene.h", "lighting.h"] 43 | } 44 | ] 45 | }, 46 | { 47 | "name" : "deferred_lighting_compute", 48 | "render_pass" : "lighting_pass", 49 | "shaders" : [ 50 | { 51 | "stage" : "compute", 52 | "shader" : "pbr.glsl", 53 | "includes" : ["platform.h", "scene.h", "lighting.h"] 54 | } 55 | ] 56 | }, 57 | { 58 | "name" : "edge_detection", 59 | "render_pass" : "lighting_pass", 60 | "shaders" : [ 61 | { 62 | "stage" : "compute", 63 | "shader" : "pbr.glsl", 64 | "includes" : ["platform.h", "scene.h"] 65 | } 66 | ] 67 | }, 68 | { 69 | "name" : "shadow_visibility_variance", 70 | "render_pass" : "shadow_visibility_pass", 71 | "shaders" : [ 72 | { 73 | "stage" : "compute", 74 | "shader" : "pbr.glsl", 75 | "includes" : ["platform.h", "scene.h", "lighting.h"] 76 | } 77 | ] 78 | }, 79 | { 80 | "name" : "shadow_visibility", 81 | "render_pass" : "shadow_visibility_pass", 82 | "shaders" : [ 83 | { 84 | "stage" : "compute", 85 | "shader" : "pbr.glsl", 86 | "includes" : ["platform.h", "scene.h", "lighting.h"] 87 | } 88 | ] 89 | }, 90 | { 91 | "name" : "shadow_visibility_filtering", 92 | "render_pass" : "shadow_visibility_pass", 93 | "shaders" : [ 94 | { 95 | "stage" : "compute", 96 | "shader" : "pbr.glsl", 97 | "includes" : ["platform.h", "scene.h", "lighting.h"] 98 | } 99 | ] 100 | } 101 | ] 102 | } -------------------------------------------------------------------------------- /source/shaders/ray_tracing.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "ray_tracing", 3 | "pipelines" : [ 4 | { 5 | "name" : "test", 6 | "render_pass": "ray_tracing_pass", 7 | "shaders" : [ 8 | { 9 | "stage" : "raygen", 10 | "shader" : "ray_tracing.glsl", 11 | "includes" : ["platform.h", "scene.h", "mesh.h"] 12 | }, 13 | { 14 | "stage" : "closest_hit", 15 | "shader" : "ray_tracing.glsl", 16 | "includes" : ["platform.h"] 17 | }, 18 | { 19 | "stage" : "miss", 20 | "shader" : "ray_tracing.glsl", 21 | "includes" : ["platform.h"] 22 | } 23 | ] 24 | } 25 | ] 26 | } 27 | -------------------------------------------------------------------------------- /source/shaders/reflections.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "reflections", 3 | "pipelines" : [ 4 | { 5 | "name" : "reflections_rt", 6 | "render_pass" : "reflections_pass", 7 | "shaders" : [ 8 | { 9 | "stage" : "raygen", 10 | "shader" : "reflections.glsl", 11 | "includes" : ["platform.h", "scene.h", "mesh.h", "lighting.h", "debug_rendering.h", "ddgi.h"] 12 | }, 13 | { 14 | "stage" : "closest_hit", 15 | "shader" : "reflections.glsl", 16 | "includes" : ["platform.h", "scene.h", "mesh.h"] 17 | }, 18 | { 19 | "stage" : "miss", 20 | "shader" : "reflections.glsl", 21 | "includes" : ["platform.h"] 22 | } 23 | ] 24 | }, 25 | { 26 | "name": "svgf_accumulation", 27 | "render_pass": "svgf_accumulation_pass", 28 | "shaders" : [ 29 | { 30 | "stage" : "compute", 31 | "shader" : "reflections.glsl", 32 | "includes" : ["platform.h", "scene.h"] 33 | } 34 | ] 35 | }, 36 | { 37 | "name": "svgf_variance", 38 | "render_pass": "svgf_variance_pass", 39 | "shaders" : [ 40 | { 41 | "stage" : "compute", 42 | "shader" : "reflections.glsl", 43 | "includes" : ["platform.h"] 44 | } 45 | ] 46 | }, 47 | { 48 | "name": "svgf_wavelet", 49 | "render_pass": "svgf_wavelet_pass", 50 | "shaders" : [ 51 | { 52 | "stage" : "compute", 53 | "shader" : "reflections.glsl", 54 | "includes" : ["platform.h", "scene.h"] 55 | } 56 | ] 57 | }, 58 | { 59 | "name": "brdf_lut_generation", 60 | "render_pass": "reflections_pass", 61 | "shaders" : [ 62 | { 63 | "stage" : "compute", 64 | "shader" : "reflections.glsl", 65 | "includes" : ["platform.h", "scene.h"] 66 | } 67 | ] 68 | }, 69 | { 70 | "name": "svgf_downsample", 71 | "render_pass": "reflections_pass", 72 | "shaders" : [ 73 | { 74 | "stage" : "compute", 75 | "shader" : "reflections.glsl", 76 | "includes" : ["platform.h", "scene.h"] 77 | } 78 | ] 79 | } 80 | ] 81 | } 82 | -------------------------------------------------------------------------------- /source/shaders/skinning.glsl: -------------------------------------------------------------------------------- 1 | 2 | #if defined(VERTEX) || defined(VERTEX_TRANSPARENT_SKINNING_NO_CULL) || defined(VERTEX_GBUFFER_SKINNING) 3 | 4 | layout(location=0) in vec3 position; 5 | layout(location=1) in vec4 tangent; 6 | layout(location=2) in vec3 normal; 7 | layout(location=3) in vec2 texCoord0; 8 | layout (location = 4) in ivec4 jointIndices; 9 | layout (location = 5) in vec4 jointWeights; 10 | 11 | layout (location = 0) out vec2 vTexcoord0; 12 | layout (location = 1) out vec3 vNormal; 13 | layout (location = 2) out vec3 vTangent; 14 | layout (location = 3) out vec3 vBiTangent; 15 | layout (location = 4) out vec3 vPosition; 16 | layout (location = 5) out flat uint mesh_draw_index; 17 | 18 | layout(std430, set = MATERIAL_SET, binding = 3) readonly buffer JointMatrices { 19 | mat4 joint_matrices[]; 20 | }; 21 | 22 | void main() { 23 | 24 | MeshInstanceDraw mesh_draw = mesh_instance_draws[gl_InstanceIndex]; 25 | mesh_draw_index = mesh_draw.mesh_draw_index; 26 | 27 | mat4 skinning_transform = 28 | jointWeights.x * joint_matrices[(jointIndices.x)] + 29 | jointWeights.y * joint_matrices[(jointIndices.y)] + 30 | jointWeights.z * joint_matrices[(jointIndices.z)] + 31 | jointWeights.w * joint_matrices[(jointIndices.w)]; 32 | 33 | // Better to separate multiplications to minimize precision issues, visible as Z-Fighting. 34 | vec4 worldPosition = mesh_draw.model * skinning_transform * vec4(position, 1.0); 35 | 36 | gl_Position = view_projection * worldPosition; 37 | 38 | vPosition = worldPosition.xyz / worldPosition.w; 39 | vTexcoord0 = texCoord0; 40 | 41 | vNormal = normalize( mat3(mesh_draw.model_inverse) * normal ); 42 | vTangent = normalize( mat3(mesh_draw.model) * tangent.xyz ); 43 | vBiTangent = cross( vNormal, vTangent ) * tangent.w; 44 | } 45 | 46 | #endif // VERTEX -------------------------------------------------------------------------------- /source/shaders/volumetric_fog.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "volumetric_fog", 3 | "pipelines" : [ 4 | { 5 | "name" : "inject_data", 6 | "render_pass" : "volumetric_fog_pass", 7 | "shaders" : [ 8 | { 9 | "stage" : "compute", 10 | "shader" : "volumetric_fog.glsl", 11 | "includes" : ["platform.h", "scene.h"] 12 | } 13 | ] 14 | }, 15 | { 16 | "name" : "light_scattering", 17 | "render_pass" : "volumetric_fog_pass", 18 | "shaders" : [ 19 | { 20 | "stage" : "compute", 21 | "shader" : "volumetric_fog.glsl", 22 | "includes" : ["platform.h", "scene.h", "lighting.h"] 23 | } 24 | ] 25 | }, 26 | { 27 | "name" : "light_integration", 28 | "render_pass" : "volumetric_fog_pass", 29 | "shaders" : [ 30 | { 31 | "stage" : "compute", 32 | "shader" : "volumetric_fog.glsl", 33 | "includes" : ["platform.h", "scene.h"] 34 | } 35 | ] 36 | }, 37 | { 38 | "name" : "spatial_filtering", 39 | "render_pass" : "volumetric_fog_pass", 40 | "shaders" : [ 41 | { 42 | "stage" : "compute", 43 | "shader" : "volumetric_fog.glsl", 44 | "includes" : ["platform.h", "scene.h"] 45 | } 46 | ] 47 | }, 48 | { 49 | "name" : "temporal_filtering", 50 | "render_pass" : "volumetric_fog_pass", 51 | "shaders" : [ 52 | { 53 | "stage" : "compute", 54 | "shader" : "volumetric_fog.glsl", 55 | "includes" : ["platform.h", "scene.h"] 56 | } 57 | ] 58 | }, 59 | { 60 | "name" : "volumetric_noise_baking", 61 | "render_pass" : "volumetric_fog_pass", 62 | "shaders" : [ 63 | { 64 | "stage" : "compute", 65 | "shader" : "volumetric_fog.glsl", 66 | "includes" : ["platform.h", "scene.h"] 67 | } 68 | ] 69 | } 70 | ] 71 | } 72 | --------------------------------------------------------------------------------