Last active
August 1, 2024 22:55
-
-
Save define-private-public/73ab82890d63671095c8d050349a2ac2 to your computer and use it in GitHub Desktop.
Revisions
-
define-private-public revised this gist
Aug 1, 2024 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #ifdef USE_NOEXCEPT #define NOEXCEPT noexcept #else #define NOEXCEPT #endif -
define-private-public revised this gist
Jul 31, 2024 . 1 changed file with 40 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,40 @@ // This is merely a snippet. Doing a `rg NOEXCEPT | wc -l` yields at least 450 results. Objects/Sphere.cpp 12:inline void sphere_get_uv(const Vec3 &p, rreal &u, rreal &v) NOEXCEPT { 21:Sphere::Sphere(const Vec3 &cen, const rreal r, const shared_ptr<IMaterial> &mat) NOEXCEPT : 27:shared_ptr<IHittable> Sphere::deep_copy() const NOEXCEPT { 40:) const NOEXCEPT { 122:) const NOEXCEPT { 128:rreal Sphere::pdf_value(RandomGenerator &rng, const Vec3 &origin, const Vec3 &v) const NOEXCEPT { 142:Vec3 Sphere::random(RandomGenerator &rng, const Vec3 &origin) const NOEXCEPT { Objects/ConstantMedium.cpp 14:) NOEXCEPT : 24:) NOEXCEPT : 30:std::shared_ptr<IHittable> ConstantMedium::deep_copy() const NOEXCEPT { 38:bool ConstantMedium::hit(RandomGenerator &rng, const Ray &r, const rreal t_min, const rreal t_max, HitRecord &rec) const NOEXCEPT { 72:bool ConstantMedium::bounding_box(const rreal t0, const rreal t1, AABB &output_box) const NOEXCEPT { Objects/Transform/FlipFace.cpp 6:shared_ptr<IHittable> FlipFace::deep_copy() const NOEXCEPT { 10:bool FlipFace::hit(RandomGenerator &rng, const Ray &r, const rreal t_min, const rreal t_max, HitRecord &rec) const NOEXCEPT { 18:bool FlipFace::bounding_box(const rreal t0, const rreal t1, AABB &output_box) const NOEXCEPT { Objects/Transform/Translate.hpp 13: explicit Translate(const std::shared_ptr<IHittable> &obj, const Vec3 &displacement) NOEXCEPT; 15: std::shared_ptr<IHittable> deep_copy() const NOEXCEPT override; 17: bool hit(RandomGenerator &rng, const Ray &r, const rreal t_min, const rreal t_max, HitRecord &rec) const NOEXCEPT override; 18: bool bounding_box(const rreal t0, const rreal t1, AABB &output_box) const NOEXCEPT override; 24: ) const NOEXCEPT override { 31: ) const NOEXCEPT override { Objects/HittableList.cpp 8:HittableList::HittableList(const shared_ptr<IHittable> &object) NOEXCEPT { 12:shared_ptr<IHittable> HittableList::deep_copy() const NOEXCEPT { 23:void HittableList::clear() NOEXCEPT { 27:void HittableList::add(const shared_ptr<IHittable> &object) NOEXCEPT { 31:bool HittableList::hit(RandomGenerator &rng, const Ray &r, const rreal t_min, const rreal t_max, HitRecord &rec) const NOEXCEPT { 53:) const NOEXCEPT { 73:rreal HittableList::pdf_value(RandomGenerator &rng, const Vec3 &origin, const Vec3 &v) const NOEXCEPT { 84:Vec3 HittableList::random(RandomGenerator &rng, const Vec3 &origin) const NOEXCEPT { -
define-private-public revised this gist
Jul 31, 2024 . No changes.There are no files selected for viewing
-
define-private-public revised this gist
Jul 31, 2024 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ #ifdef USE_FINAL #define FINAL final #else #define FINAL #endif -
define-private-public revised this gist
Jul 31, 2024 . 1 changed file with 10 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ option(WITH_NOEXCEPT "Use the `noexcept` annotation for various functions (faster?)" OFF) # ... if (WITH_NOEXCEPT) message(STATUS "Using `noexcept` annotations (faster?)") target_compile_definitions(PSRayTracing_StaticLibrary PUBLIC USE_NOEXCEPT) else() message(STATUS "Turned off use of `noexcept` (slower?)") endif() -
define-private-public revised this gist
Jul 31, 2024 . No changes.There are no files selected for viewing
-
define-private-public revised this gist
Jul 31, 2024 . 1 changed file with 24 additions and 16 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,18 +1,26 @@ int find_index_plain(const vector<int> &numbers, const int x) { for (int i = 0; i < numbers.size(); i++) { if (numbers[i] == x) { return i; } } return -1; } int find_index_noexcept(const vector<int> &numbers, const int x) noexcept { for (int i = 0; i < numbers.size(); i++) { if (numbers[i] == x) { return i; } } return -1; } -
define-private-public revised this gist
Jul 30, 2024 . 1 changed file with 18 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ // Doing this icky C preprocessor macro stuff guarentees thats that we have the same // funciton with and without the keyword on. Yes, I know there could be more of a // "C++ way" of doing this but that isn't important. #define MAKE_FIND_FUNCTION(FUNCTION_NAME, NOEXCEPT) \ int FUNCTION_NAME(const vector<int> &numbers, const int x) NOEXCEPT \ { \ for (int i = 0; i < numbers.size(); i++) \ { \ if (numbers[i] == x) \ { \ return i; \ } \ } \ return -1; \ } MAKE_FIND_FUNCTION(find_index_plain, ) MAKE_FIND_FUNCTION(find_index_noexcept, noexcept) -
define-private-public revised this gist
Jul 30, 2024 . 3 changed files with 42 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ find_index_noexcept(std::vector<int, std::allocator<int> > const&, int): mov rax, QWORD PTR [rdi+8] mov rdx, QWORD PTR [rdi] mov rcx, rax sub rcx, rdx sar rcx, 2 cmp rax, rdx je .L13 xor eax, eax jmp .L12 .L15: add rax, 1 cmp rax, rcx jnb .L13 .L12: cmp esi, DWORD PTR [rdx+rax*4] jne .L15 ret .L13: mov eax, -1 ret This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ find_index_plain(std::vector<int, std::allocator<int> > const&, int): mov rax, QWORD PTR [rdi+8] mov rdx, QWORD PTR [rdi] mov rcx, rax sub rcx, rdx sar rcx, 2 cmp rax, rdx je .L5 xor eax, eax jmp .L4 .L8: add rax, 1 cmp rax, rcx jnb .L5 .L4: cmp DWORD PTR [rdx+rax*4], esi jne .L8 ret .L5: mov eax, -1 ret -
define-private-public created this gist
Jul 26, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ asdf