nngn
Loading...
Searching...
No Matches
anonymous_namespace{compute.cpp}::ComputeBackend Class Referencefinal
Inheritance diagram for anonymous_namespace{compute.cpp}::ComputeBackend:
Collaboration diagram for anonymous_namespace{compute.cpp}::ComputeBackend:

Public Member Functions

 ComputeBackend (nngn::Compute *c)
 
 ~ComputeBackend (void) override
 
 ComputeBackend (nngn::Compute *c)
 
 ~ComputeBackend (void) override
 
virtual bool init (void)
 
virtual bool set_max_colliders (std::size_t)
 
virtual bool set_max_collisions (std::size_t)
 
virtual bool check (const Timing &, Input *, Output *)
 
virtual bool init (void)
 
virtual bool set_max_colliders (std::size_t)
 
virtual bool set_max_collisions (std::size_t)
 
virtual bool check (const Timing &, Input *, Output *)
 

Private Member Functions

bool init () final
 
bool read_prog (const std::filesystem::path &path)
 
bool destroy ()
 
bool set_max_colliders (std::size_t n) final
 
bool set_max_collisions (std::size_t n) final
 
bool check (const nngn::Timing &t, Input *input, Output *output) final
 
template<std::size_t to_off, typename To , typename From , typename F >
bool copy_member (nngn::Compute::Buffer b, std::span< const From > s, const F *f, nngn::Compute::Event *const *e)
 
bool copy_aabb (Events *events, std::span< const nngn::AABBCollider > s)
 
bool copy_bb (Events *events, std::span< const nngn::BBCollider > s)
 
bool copy_sphere (Events *events, std::span< const nngn::SphereCollider > s)
 
bool copy_plane (Events *events, std::span< const nngn::PlaneCollider > s)
 
bool copy_gravity (Events *events, std::span< const nngn::GravityCollider > s)
 
bool check_aabb (Events *events, std::span< const nngn::AABBCollider > s)
 
bool check_bb (Events *events, std::span< const nngn::BBCollider > s)
 
bool check_sphere (const nngn::Timing &t, Events *events, std::span< const nngn::SphereCollider > s)
 
bool check_aabb_bb (Events *events, std::span< const nngn::AABBCollider > aabb, std::span< const nngn::BBCollider > bb)
 
bool check_aabb_sphere (Events *events, std::span< const nngn::AABBCollider > aabb, std::span< const nngn::SphereCollider > sphere)
 
bool check_bb_sphere (Events *events, std::span< const nngn::BBCollider > aabb, std::span< const nngn::SphereCollider > sphere)
 
bool check_sphere_plane (Events *events, std::span< const nngn::SphereCollider > sphere, std::span< const nngn::PlaneCollider > plane)
 
bool check_sphere_gravity (Events *events, std::span< const nngn::SphereCollider > sphere, std::span< const nngn::GravityCollider > gravity)
 
std::array< size_t, 2 > work_size_for_n (std::size_t n) const
 
std::tuple< Collision *, u32 > map_collision_buffer (nngn::Compute::Buffer b, std::size_t i, const nngn::Compute::Event *wait, u32 max) const
 
template<typename T , typename U >
bool read_collision_buffer (nngn::Compute::Buffer b, std::size_t counter_idx, std::span< T > s0, std::span< U > s1, const nngn::Compute::Event *wait, std::vector< nngn::Collision > *out)
 
bool write_stats (const Events &events)
 
bool init () final
 
bool read_prog (const std::filesystem::path &path)
 
bool destroy ()
 
bool set_max_colliders (std::size_t n) final
 
bool set_max_collisions (std::size_t n) final
 
bool check (const nngn::Timing &t, Input *input, Output *output) final
 
template<std::size_t to_off, typename To , typename From , typename F >
bool copy_member (nngn::Compute::Buffer b, std::span< const From > s, const F *f, nngn::Compute::Event *const *e)
 
bool copy_aabb (Events *events, std::span< const nngn::AABBCollider > s)
 
bool copy_bb (Events *events, std::span< const nngn::BBCollider > s)
 
bool copy_sphere (Events *events, std::span< const nngn::SphereCollider > s)
 
bool copy_plane (Events *events, std::span< const nngn::PlaneCollider > s)
 
bool copy_gravity (Events *events, std::span< const nngn::GravityCollider > s)
 
bool check_aabb (Events *events, std::span< const nngn::AABBCollider > s)
 
bool check_bb (Events *events, std::span< const nngn::BBCollider > s)
 
bool check_sphere (const nngn::Timing &t, Events *events, std::span< const nngn::SphereCollider > s)
 
bool check_aabb_bb (Events *events, std::span< const nngn::AABBCollider > aabb, std::span< const nngn::BBCollider > bb)
 
bool check_aabb_sphere (Events *events, std::span< const nngn::AABBCollider > aabb, std::span< const nngn::SphereCollider > sphere)
 
bool check_bb_sphere (Events *events, std::span< const nngn::BBCollider > aabb, std::span< const nngn::SphereCollider > sphere)
 
bool check_sphere_plane (Events *events, std::span< const nngn::SphereCollider > sphere, std::span< const nngn::PlaneCollider > plane)
 
bool check_sphere_gravity (Events *events, std::span< const nngn::SphereCollider > sphere, std::span< const nngn::GravityCollider > gravity)
 
std::array< size_t, 2 > work_size_for_n (std::size_t n) const
 
std::tuple< Collision *, u32 > map_collision_buffer (nngn::Compute::Buffer b, std::size_t i, const nngn::Compute::Event *wait, u32 max) const
 
template<typename T , typename U >
bool read_collision_buffer (nngn::Compute::Buffer b, std::size_t counter_idx, std::span< T > s0, std::span< U > s1, const nngn::Compute::Event *wait, std::vector< nngn::Collision > *out)
 
bool write_stats (const Events &events)
 

Private Attributes

std::size_t max_colliders = {}
 
std::size_t max_collisions = {}
 
std::size_t collision_bytes = {}
 
u64 max_wg_size = {}
 
nngn::Compute::Program prog = {}
 
nngn::Compute::Buffer aabb_buffer = {}
 
nngn::Compute::Buffer bb_buffer = {}
 
nngn::Compute::Buffer sphere_buffer = {}
 
nngn::Compute::Buffer plane_buffer = {}
 
nngn::Compute::Buffer gravity_buffer = {}
 
nngn::Compute::Buffer counters_buffer = {}
 
nngn::Compute::Buffer aabb_coll_buffer = {}
 
nngn::Compute::Buffer bb_coll_buffer = {}
 
nngn::Compute::Buffer sphere_coll_buffer = {}
 
nngn::Compute::Buffer gravity_coll_buffer = {}
 
nngn::Compute::Buffer aabb_bb_coll_buffer = {}
 
nngn::Compute::Buffer aabb_sphere_coll_buffer = {}
 
nngn::Compute::Buffer bb_sphere_coll_buffer = {}
 
nngn::Compute::Buffer sphere_plane_coll_buffer = {}
 
nngn::Compute::Buffer sphere_gravity_coll_buffer = {}
 
nngn::Computecompute = {}
 

Constructor & Destructor Documentation

◆ ComputeBackend() [1/2]

anonymous_namespace{compute.cpp}::ComputeBackend::ComputeBackend ( nngn::Compute c)
inline

◆ ~ComputeBackend() [1/2]

anonymous_namespace{compute.cpp}::ComputeBackend::~ComputeBackend ( void  )
override
Here is the call graph for this function:

◆ ComputeBackend() [2/2]

anonymous_namespace{compute.cpp}::ComputeBackend::ComputeBackend ( nngn::Compute c)
inline

◆ ~ComputeBackend() [2/2]

anonymous_namespace{compute.cpp}::ComputeBackend::~ComputeBackend ( void  )
override

Member Function Documentation

◆ check() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check ( const nngn::Timing t,
Input input,
Output output 
)
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

Here is the call graph for this function:

◆ check() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check ( const nngn::Timing t,
Input input,
Output output 
)
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

◆ check_aabb() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_aabb ( Events events,
std::span< const nngn::AABBCollider s 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_aabb() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_aabb ( Events events,
std::span< const nngn::AABBCollider s 
)
private

◆ check_aabb_bb() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_aabb_bb ( Events events,
std::span< const nngn::AABBCollider aabb,
std::span< const nngn::BBCollider bb 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_aabb_bb() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_aabb_bb ( Events events,
std::span< const nngn::AABBCollider aabb,
std::span< const nngn::BBCollider bb 
)
private

◆ check_aabb_sphere() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_aabb_sphere ( Events events,
std::span< const nngn::AABBCollider aabb,
std::span< const nngn::SphereCollider sphere 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_aabb_sphere() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_aabb_sphere ( Events events,
std::span< const nngn::AABBCollider aabb,
std::span< const nngn::SphereCollider sphere 
)
private

◆ check_bb() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_bb ( Events events,
std::span< const nngn::BBCollider s 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_bb() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_bb ( Events events,
std::span< const nngn::BBCollider s 
)
private

◆ check_bb_sphere() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_bb_sphere ( Events events,
std::span< const nngn::BBCollider aabb,
std::span< const nngn::SphereCollider sphere 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_bb_sphere() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_bb_sphere ( Events events,
std::span< const nngn::BBCollider aabb,
std::span< const nngn::SphereCollider sphere 
)
private

◆ check_sphere() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_sphere ( const nngn::Timing t,
Events events,
std::span< const nngn::SphereCollider s 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_sphere() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_sphere ( const nngn::Timing t,
Events events,
std::span< const nngn::SphereCollider s 
)
private

◆ check_sphere_gravity() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_sphere_gravity ( Events events,
std::span< const nngn::SphereCollider sphere,
std::span< const nngn::GravityCollider gravity 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_sphere_gravity() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_sphere_gravity ( Events events,
std::span< const nngn::SphereCollider sphere,
std::span< const nngn::GravityCollider gravity 
)
private

◆ check_sphere_plane() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_sphere_plane ( Events events,
std::span< const nngn::SphereCollider sphere,
std::span< const nngn::PlaneCollider plane 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_sphere_plane() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::check_sphere_plane ( Events events,
std::span< const nngn::SphereCollider sphere,
std::span< const nngn::PlaneCollider plane 
)
private

◆ copy_aabb() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_aabb ( Events events,
std::span< const nngn::AABBCollider s 
)
private
Here is the caller graph for this function:

◆ copy_aabb() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_aabb ( Events events,
std::span< const nngn::AABBCollider s 
)
private

◆ copy_bb() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_bb ( Events events,
std::span< const nngn::BBCollider s 
)
private
Here is the caller graph for this function:

◆ copy_bb() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_bb ( Events events,
std::span< const nngn::BBCollider s 
)
private

◆ copy_gravity() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_gravity ( Events events,
std::span< const nngn::GravityCollider s 
)
private
Here is the caller graph for this function:

◆ copy_gravity() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_gravity ( Events events,
std::span< const nngn::GravityCollider s 
)
private

◆ copy_member() [1/2]

template<std::size_t to_off, typename To , typename From , typename F >
bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_member ( nngn::Compute::Buffer  b,
std::span< const From >  s,
const F f,
nngn::Compute::Event *const *  e 
)
private
Here is the call graph for this function:

◆ copy_member() [2/2]

template<std::size_t to_off, typename To , typename From , typename F >
bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_member ( nngn::Compute::Buffer  b,
std::span< const From >  s,
const F f,
nngn::Compute::Event *const *  e 
)
private

◆ copy_plane() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_plane ( Events events,
std::span< const nngn::PlaneCollider s 
)
private
Here is the caller graph for this function:

◆ copy_plane() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_plane ( Events events,
std::span< const nngn::PlaneCollider s 
)
private

◆ copy_sphere() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_sphere ( Events events,
std::span< const nngn::SphereCollider s 
)
private
Here is the caller graph for this function:

◆ copy_sphere() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::copy_sphere ( Events events,
std::span< const nngn::SphereCollider s 
)
private

◆ destroy() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::destroy ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::destroy ( )
private

◆ init() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::init ( void  )
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

Here is the call graph for this function:

◆ init() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::init ( )
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

◆ map_collision_buffer() [1/2]

std::tuple< Collision *, u32 > anonymous_namespace{compute.cpp}::ComputeBackend::map_collision_buffer ( nngn::Compute::Buffer  b,
std::size_t  i,
const nngn::Compute::Event *  wait,
u32  max 
) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ map_collision_buffer() [2/2]

std::tuple< Collision *, u32 > anonymous_namespace{compute.cpp}::ComputeBackend::map_collision_buffer ( nngn::Compute::Buffer  b,
std::size_t  i,
const nngn::Compute::Event *  wait,
u32  max 
) const
private

◆ read_collision_buffer() [1/2]

template<typename T , typename U >
bool anonymous_namespace{compute.cpp}::ComputeBackend::read_collision_buffer ( nngn::Compute::Buffer  b,
std::size_t  counter_idx,
std::span< T s0,
std::span< U >  s1,
const nngn::Compute::Event *  wait,
std::vector< nngn::Collision > *  out 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_collision_buffer() [2/2]

template<typename T , typename U >
bool anonymous_namespace{compute.cpp}::ComputeBackend::read_collision_buffer ( nngn::Compute::Buffer  b,
std::size_t  counter_idx,
std::span< T s0,
std::span< U >  s1,
const nngn::Compute::Event *  wait,
std::vector< nngn::Collision > *  out 
)
private

◆ read_prog() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::read_prog ( const std::filesystem::path &  path)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_prog() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::read_prog ( const std::filesystem::path &  path)
private

◆ set_max_colliders() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::set_max_colliders ( std::size_t  n)
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

Here is the call graph for this function:

◆ set_max_colliders() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::set_max_colliders ( std::size_t  n)
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

◆ set_max_collisions() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::set_max_collisions ( std::size_t  n)
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

Here is the call graph for this function:

◆ set_max_collisions() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::set_max_collisions ( std::size_t  n)
finalprivatevirtual

Reimplemented from nngn::Colliders::Backend.

◆ work_size_for_n() [1/2]

std::array< std::size_t, 2 > anonymous_namespace{compute.cpp}::ComputeBackend::work_size_for_n ( std::size_t  n) const
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ work_size_for_n() [2/2]

std::array< size_t, 2 > anonymous_namespace{compute.cpp}::ComputeBackend::work_size_for_n ( std::size_t  n) const
private

◆ write_stats() [1/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::write_stats ( const Events events)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ write_stats() [2/2]

bool anonymous_namespace{compute.cpp}::ComputeBackend::write_stats ( const Events events)
private

Member Data Documentation

◆ aabb_bb_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::aabb_bb_coll_buffer = {}
private

◆ aabb_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::aabb_buffer = {}
private

◆ aabb_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::aabb_coll_buffer = {}
private

◆ aabb_sphere_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::aabb_sphere_coll_buffer = {}
private

◆ bb_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::bb_buffer = {}
private

◆ bb_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::bb_coll_buffer = {}
private

◆ bb_sphere_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::bb_sphere_coll_buffer = {}
private

◆ collision_bytes

std::size_t anonymous_namespace{compute.cpp}::ComputeBackend::collision_bytes = {}
private

◆ compute

nngn::Compute * anonymous_namespace{compute.cpp}::ComputeBackend::compute = {}
private

◆ counters_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::counters_buffer = {}
private

◆ gravity_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::gravity_buffer = {}
private

◆ gravity_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::gravity_coll_buffer = {}
private

◆ max_colliders

std::size_t anonymous_namespace{compute.cpp}::ComputeBackend::max_colliders = {}
private

◆ max_collisions

std::size_t anonymous_namespace{compute.cpp}::ComputeBackend::max_collisions = {}
private

◆ max_wg_size

u64 anonymous_namespace{compute.cpp}::ComputeBackend::max_wg_size = {}
private

◆ plane_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::plane_buffer = {}
private

◆ prog

nngn::Compute::Program anonymous_namespace{compute.cpp}::ComputeBackend::prog = {}
private

◆ sphere_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::sphere_buffer = {}
private

◆ sphere_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::sphere_coll_buffer = {}
private

◆ sphere_gravity_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::sphere_gravity_coll_buffer = {}
private

◆ sphere_plane_coll_buffer

nngn::Compute::Buffer anonymous_namespace{compute.cpp}::ComputeBackend::sphere_plane_coll_buffer = {}
private

The documentation for this class was generated from the following files: