NVIDIA IndeX API nvidia_logo_transpbg.gif Up
nv::index::IParticle_volume_subset_device Class Referenceabstract

Distributed data storage class for particle volume subsets hosted on a GPU device. More...

#include <iparticle_volume_subset.h>

Inherits mi::base::Interface_declare< 0x7259b57b, ... >.

Classes

struct  Geometry_parameters
 Parameters of particle geometry. More...
 
struct  Particle_size_parameters
 Parameters of particle size. More...
 

Public Types

enum  Particle_radii_format {
  PVOL_radii_none ,
  PVOL_radii_f32
}
 Data format of particle radii. More...
 
enum  Particle_normals_format {
  PVOL_normals_none ,
  PVOL_normals_f32_3 ,
  PVOL_normals_compressed_1_32
}
 Data format of particle normals. More...
 
enum  Particle_storage_format {
  PVOL_geometry_storage_separate ,
  PVOL_geometry_storage_combined ,
  PVOL_geometry_storage_interleaved
}
 Organization of particle geometry buffers for positions, radii and normals. More...
 
enum  Particle_geometry_buffer {
  PVOL_buffer_base ,
  PVOL_buffer_positions ,
  PVOL_buffer_radii ,
  PVOL_buffer_normals
}
 

Public Member Functions

virtual Geometry_parameters get_geometry_parameters () const =0
 Get parameters of particle geometry. More...
 
virtual Particle_size_parameters get_particle_size_parameters () const =0
 Get parameters of particle size. More...
 
virtual bool set_particle_size_parameters (const Particle_size_parameters &params)=0
 Change parameters of particle size. More...
 
virtual void * get_geometry_storage (Particle_geometry_buffer buffer_selector)=0
 Get current geometry device buffer. More...
 
virtual bool resize_storage (const Geometry_parameters &params)=0
 Resize internal geometry/attribute storage using Geometry_parameters. More...
 
virtual bool adopt_geometry_storage (const Geometry_parameters &params, void *const geometry_device_buffers[], mi::Size const byte_sizes_of_buffers[], mi::Uint32 nb_buffers)=0
 Adopt external geometry storage using Geometry_parameters. More...
 
virtual bool get_attribute_formats (mi::Uint32 *formats, mi::Uint32 nb_formats) const =0
 Get particle attribute formats. More...
 
virtual bool set_attribute_formats (const mi::Uint32 *formats, mi::Uint32 nb_formats)=0
 Set particle attribute formats. More...
 
virtual void * get_attribute_storage (mi::Uint32 attrib_index)=0
 Get current attribute device buffer for given attribute index. More...
 
virtual bool adopt_attribute_storage (mi::Uint32 attrib_index, void *attribute_storage, mi::Size byte_size_of_storage)=0
 Adopt external attribute device buffer for given attribute index. More...
 
virtual bool is_internal_geometry_storage () const =0
 Get location of geometry storage. More...
 
virtual bool is_internal_attribute_storage () const =0
 Get location of attribute storage. More...
 
virtual void get_geometry_storage_byte_size (mi::Size storage_sizes[], mi::Uint32 nb_storage_sizes) const =0
 Get size in bytes of geometry storage. More...
 
virtual mi::Size get_attribute_storage_byte_size (mi::Uint32 attrib_index) const =0
 Get size in bytes of attribute storage. More...
 

Detailed Description

Distributed data storage class for particle volume subsets hosted on a GPU device.

Data access for device particle data associated with IParticle_volume_scene_element instances is performed through implementations of this interface.

Member Enumeration Documentation

 Particle_geometry_buffer

Enumerator
PVOL_buffer_base 

base buffer, used for combined or interleaved storage formats

PVOL_buffer_positions 

buffer for particle positions

PVOL_buffer_radii 

buffer for particle radii

PVOL_buffer_normals 

buffer for particle normals

 Particle_normals_format

Data format of particle normals.

Enumerator
PVOL_normals_none 

no particle normals present

PVOL_normals_f32_3 

particle normals in float3 format (mi::math::Vector_struct< mi::Float32, 3 >)

PVOL_normals_compressed_1_32 

particle normals in compressed format 1 (sizeof(uint32), 'compress_normal_uint_sphere')

 Particle_radii_format

Data format of particle radii.

Enumerator
PVOL_radii_none 

no particle radii present

PVOL_radii_f32 

particle radii in float format (mi::Float32)

 Particle_storage_format

Organization of particle geometry buffers for positions, radii and normals.

Enumerator
PVOL_geometry_storage_separate 

geometry buffers are separate

PVOL_geometry_storage_combined 

geometry buffers are consecutive arrays in order: positions, radii, normals

PVOL_geometry_storage_interleaved 

geometry buffers are interleaved, element components in order: position, radius, normal

Member Function Documentation

 adopt_attribute_storage()

virtual bool nv::index::IParticle_volume_subset_device::adopt_attribute_storage ( mi::Uint32  attrib_index,
void *  attribute_storage,
mi::Size  byte_size_of_storage 
)
pure virtual

Adopt external attribute device buffer for given attribute index.

If internal attribute storage exists, it will be released. The attribute set is fixed at creation time. It is defined in IParticle_volume_attribute_set_descriptor (

See also
IParticle_volume_subset::get_attribute_set_descriptor() ).
Parameters
attrib_indexThe storage index of the attribute set.
attribute_storagePointer to device buffer of attribute set.
byte_size_of_storageByte size of device buffer, allowed to be larger than required size.
Returns
Returns false if attribute index or given pointer is invalid.

 adopt_geometry_storage()

virtual bool nv::index::IParticle_volume_subset_device::adopt_geometry_storage ( const Geometry_parameters params,
void *const  geometry_device_buffers[],
mi::Size const  byte_sizes_of_buffers[],
mi::Uint32  nb_buffers 
)
pure virtual

Adopt external geometry storage using Geometry_parameters.

If internal geometry storage exists, it will be released. If parameters specify zero particles, then storage references will be reset.

Parameters
paramsParameters of geometry storage, including number of particles.
geometry_device_buffersPointer to array of device pointers for geometry data, in order If storage is interleaved or combined, then one pointer is expected (PVOL_buffer_base). if storage is separate, then the array of device pointers should have three elements [positions, radii, normals].
byte_sizes_of_buffersPointer to array of buffer sizes in bytes (
See also
geometry_device_buffers). The real buffer size is allowed to be larger than the required size.
Parameters
nb_buffersNumber of buffers.
Returns
Returns false if buffer addresses are incomplete or parameters are invalid.

 get_attribute_formats()

virtual bool nv::index::IParticle_volume_subset_device::get_attribute_formats ( mi::Uint32 *  formats,
mi::Uint32  nb_formats 
) const
pure virtual

Get particle attribute formats.

Parameters
formatsBuffer to receive format codes (
See also
Distributed_data_attribute_format)
Parameters
nb_formatsSize of buffer formats.
Returns
Returns false if buffer is invalid.

 get_attribute_storage()

virtual void * nv::index::IParticle_volume_subset_device::get_attribute_storage ( mi::Uint32  attrib_index)
pure virtual

Get current attribute device buffer for given attribute index.

The attribute set is fixed at creation time. It is defined in IParticle_volume_attribute_set_descriptor (

See also
IParticle_volume_subset::get_attribute_set_descriptor() ).
Parameters
attrib_indexThe storage index of the attribute set.
Returns
Returns nullptr if attribute index is invalid.

 get_attribute_storage_byte_size()

virtual mi::Size nv::index::IParticle_volume_subset_device::get_attribute_storage_byte_size ( mi::Uint32  attrib_index) const
pure virtual

Get size in bytes of attribute storage.

Parameters
attrib_indexThe storage index of the attribute set.

 get_geometry_parameters()

virtual Geometry_parameters nv::index::IParticle_volume_subset_device::get_geometry_parameters ( ) const
pure virtual

Get parameters of particle geometry.

 get_geometry_storage()

virtual void * nv::index::IParticle_volume_subset_device::get_geometry_storage ( Particle_geometry_buffer  buffer_selector)
pure virtual

Get current geometry device buffer.

Elements of selected buffer are consecutive for format PVOL_geometry_storage_separate and PVOL_geometry_storage_combined. Elements have a stride in format PVOL_geometry_storage_interleaved (

See also
Geometry_parameters).
Parameters
buffer_selectorBuffer selector. Use PVOL_buffer_base for interleaved or combined storage format.
Returns
Pointer to geometry device storage (internal or adopted) or NULL, if no storage.

 get_geometry_storage_byte_size()

virtual void nv::index::IParticle_volume_subset_device::get_geometry_storage_byte_size ( mi::Size  storage_sizes[],
mi::Uint32  nb_storage_sizes 
) const
pure virtual

Get size in bytes of geometry storage.

Parameters
[out]storage_sizesPointer to array of sizes. If separate geometry buffers, one element for positions, radii, normals.
nb_storage_sizesNumber of sizes to write to storage_sizes.

 get_particle_size_parameters()

virtual Particle_size_parameters nv::index::IParticle_volume_subset_device::get_particle_size_parameters ( ) const
pure virtual

Get parameters of particle size.

 is_internal_attribute_storage()

virtual bool nv::index::IParticle_volume_subset_device::is_internal_attribute_storage ( ) const
pure virtual

Get location of attribute storage.

Returns
true if internal attribute storage, false if external storage or no storage

 is_internal_geometry_storage()

virtual bool nv::index::IParticle_volume_subset_device::is_internal_geometry_storage ( ) const
pure virtual

Get location of geometry storage.

Returns
true if internal geometry storage, false if external storage or no storage

 resize_storage()

virtual bool nv::index::IParticle_volume_subset_device::resize_storage ( const Geometry_parameters params)
pure virtual

Resize internal geometry/attribute storage using Geometry_parameters.

If parameters specify zero particles, then free all internal device storage. If external storage is referenced, then storage references will be reset. All particle geometry data will be reset and needs to be updated.

It might fail to change the storage format, an implementation might not support all formats. It might fail to change the data format for components (position, radii, normals).

Parameters
paramsParameters of geometry storage, including number of particles.
Returns
Returns false if allocation failed or parameters are invalid.

 set_attribute_formats()

virtual bool nv::index::IParticle_volume_subset_device::set_attribute_formats ( const mi::Uint32 *  formats,
mi::Uint32  nb_formats 
)
pure virtual

Set particle attribute formats.

Changing the format of an attribute invalidates attribute storage. Using nb_formats == 0 will clear all attributes.

Parameters
formatsBuffer of format codes (
See also
Distributed_data_attribute_format)
Parameters
nb_formatsSize of buffer formats.
Returns
Returns false if format data is invalid.

 set_particle_size_parameters()

virtual bool nv::index::IParticle_volume_subset_device::set_particle_size_parameters ( const Particle_size_parameters params)
pure virtual

Change parameters of particle size.

Parameters
paramsNew parameters of particle geometry.
Returns
Returns false if change was invalid.

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