Panda3D
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Friends | List of all members
ShaderInput Class Reference

This is a small container class that can hold any one of the value types that can be passed as input to a shader. More...

#include "shaderInput.h"

Public Types

enum  AccessFlags { A_read = 0x01 , A_write = 0x02 , A_layered = 0x04 }
 
enum  ShaderInputType {
  M_invalid = 0 , M_texture , M_nodepath , M_vector ,
  M_numeric , M_texture_sampler , M_param , M_texture_image ,
  M_buffer
}
 

Public Member Functions

 ShaderInput (CPT_InternalName name, const LMatrix3d &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix3f &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix4d &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix4f &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase2d &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase2f &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase2i &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase3d &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase3f &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase3i &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase4d &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase4f &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase4i &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const NodePath &np, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_double &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_float &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_int &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix3d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix3f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix4d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix4f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase2d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase2f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase2i &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase3d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase3f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase3i &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase4d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase4f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase4i &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, int priority=0)
 
 ShaderInput (CPT_InternalName name, ParamValueBase *param, int priority=0)
 
 ShaderInput (CPT_InternalName name, ShaderBuffer *buf, int priority=0)
 
 ShaderInput (CPT_InternalName name, Texture *tex, bool read, bool write, int z=-1, int n=0, int priority=0)
 
 ShaderInput (CPT_InternalName name, Texture *tex, const SamplerState &sampler, int priority=0)
 
 ShaderInput (CPT_InternalName name, Texture *tex, int priority=0)
 
size_t add_hash (size_t hash) const
 
const InternalNameget_name () const
 
const NodePathget_nodepath () const
 Warning: no error checking is done.
 
ParamValueBaseget_param () const
 
int get_priority () const
 
const Shader::ShaderPtrDataget_ptr () const
 
const SamplerStateget_sampler () const
 Warning: no error checking is done.
 
Textureget_texture () const
 
TypedWritableReferenceCountget_value () const
 
int get_value_type () const
 
const LVecBase4 & get_vector () const
 
 operator bool () const
 
bool operator!= (const ShaderInput &other) const
 
bool operator< (const ShaderInput &other) const
 
bool operator== (const ShaderInput &other) const
 

Static Public Member Functions

static const ShaderInputget_blank ()
 Returns a static ShaderInput object with name NULL, priority zero, type INVALID, and all value-fields cleared.
 
static void register_with_read_factory ()
 

Friends

class Extension< ShaderInput >
 
class ShaderAttrib
 

Detailed Description

This is a small container class that can hold any one of the value types that can be passed as input to a shader.

Definition at line 40 of file shaderInput.h.

Member Enumeration Documentation

◆ AccessFlags

enum ShaderInput::AccessFlags

Definition at line 43 of file shaderInput.h.

◆ ShaderInputType

enum ShaderInput::ShaderInputType

Definition at line 96 of file shaderInput.h.

Constructor & Destructor Documentation

◆ ShaderInput() [1/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
int priority = 0 )
inlineexplicit

Definition at line 19 of file shaderInput.I.

◆ ShaderInput() [2/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
Texture * tex,
int priority = 0 )
inline

Definition at line 30 of file shaderInput.I.

◆ ShaderInput() [3/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
ParamValueBase * param,
int priority = 0 )
inline

Definition at line 42 of file shaderInput.I.

◆ ShaderInput() [4/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
ShaderBuffer * buf,
int priority = 0 )
inline

Definition at line 54 of file shaderInput.I.

◆ ShaderInput() [5/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_float & ptr,
int priority = 0 )
inline

Definition at line 66 of file shaderInput.I.

◆ ShaderInput() [6/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase4f & ptr,
int priority = 0 )
inline

Definition at line 78 of file shaderInput.I.

◆ ShaderInput() [7/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase3f & ptr,
int priority = 0 )
inline

Definition at line 90 of file shaderInput.I.

◆ ShaderInput() [8/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase2f & ptr,
int priority = 0 )
inline

Definition at line 102 of file shaderInput.I.

◆ ShaderInput() [9/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LMatrix4f & ptr,
int priority = 0 )
inline

Definition at line 153 of file shaderInput.I.

◆ ShaderInput() [10/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LMatrix3f & ptr,
int priority = 0 )
inline

Definition at line 165 of file shaderInput.I.

◆ ShaderInput() [11/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase4f & vec,
int priority = 0 )
inline

Definition at line 114 of file shaderInput.I.

◆ ShaderInput() [12/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase3f & vec,
int priority = 0 )
inline

Definition at line 127 of file shaderInput.I.

◆ ShaderInput() [13/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase2f & vec,
int priority = 0 )
inline

Definition at line 140 of file shaderInput.I.

◆ ShaderInput() [14/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LMatrix4f & mat,
int priority = 0 )
inline

Definition at line 177 of file shaderInput.I.

◆ ShaderInput() [15/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LMatrix3f & mat,
int priority = 0 )
inline

Definition at line 189 of file shaderInput.I.

◆ ShaderInput() [16/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_double & ptr,
int priority = 0 )
inline

Definition at line 201 of file shaderInput.I.

◆ ShaderInput() [17/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase4d & ptr,
int priority = 0 )
inline

Definition at line 213 of file shaderInput.I.

◆ ShaderInput() [18/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase3d & ptr,
int priority = 0 )
inline

Definition at line 225 of file shaderInput.I.

◆ ShaderInput() [19/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase2d & ptr,
int priority = 0 )
inline

Definition at line 237 of file shaderInput.I.

◆ ShaderInput() [20/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LMatrix4d & ptr,
int priority = 0 )
inline

Definition at line 288 of file shaderInput.I.

◆ ShaderInput() [21/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LMatrix3d & ptr,
int priority = 0 )
inline

Definition at line 300 of file shaderInput.I.

◆ ShaderInput() [22/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase4d & vec,
int priority = 0 )
inline

Definition at line 249 of file shaderInput.I.

◆ ShaderInput() [23/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase3d & vec,
int priority = 0 )
inline

Definition at line 262 of file shaderInput.I.

◆ ShaderInput() [24/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase2d & vec,
int priority = 0 )
inline

Definition at line 275 of file shaderInput.I.

◆ ShaderInput() [25/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LMatrix4d & mat,
int priority = 0 )
inline

Definition at line 312 of file shaderInput.I.

◆ ShaderInput() [26/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LMatrix3d & mat,
int priority = 0 )
inline

Definition at line 324 of file shaderInput.I.

◆ ShaderInput() [27/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_int & ptr,
int priority = 0 )
inline

Definition at line 336 of file shaderInput.I.

◆ ShaderInput() [28/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase4i & ptr,
int priority = 0 )
inline

Definition at line 348 of file shaderInput.I.

◆ ShaderInput() [29/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase3i & ptr,
int priority = 0 )
inline

Definition at line 360 of file shaderInput.I.

◆ ShaderInput() [30/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const PTA_LVecBase2i & ptr,
int priority = 0 )
inline

Definition at line 372 of file shaderInput.I.

◆ ShaderInput() [31/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase4i & vec,
int priority = 0 )
inline

Definition at line 384 of file shaderInput.I.

◆ ShaderInput() [32/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase3i & vec,
int priority = 0 )
inline

Definition at line 397 of file shaderInput.I.

◆ ShaderInput() [33/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const LVecBase2i & vec,
int priority = 0 )
inline

Definition at line 410 of file shaderInput.I.

◆ ShaderInput() [34/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
const NodePath & np,
int priority = 0 )

Definition at line 31 of file shaderInput.cxx.

◆ ShaderInput() [35/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
Texture * tex,
bool read,
bool write,
int z = -1,
int n = 0,
int priority = 0 )
explicit

Definition at line 43 of file shaderInput.cxx.

◆ ShaderInput() [36/36]

ShaderInput::ShaderInput ( CPT_InternalName name,
Texture * tex,
const SamplerState & sampler,
int priority = 0 )
explicit

Definition at line 55 of file shaderInput.cxx.

Member Function Documentation

◆ add_hash()

size_t ShaderInput::add_hash ( size_t hash) const

Definition at line 67 of file shaderInput.cxx.

◆ get_blank()

const ShaderInput & ShaderInput::get_blank ( )
static

Returns a static ShaderInput object with name NULL, priority zero, type INVALID, and all value-fields cleared.

Definition at line 22 of file shaderInput.cxx.

◆ get_name()

const InternalName * ShaderInput::get_name ( ) const
inline

Definition at line 518 of file shaderInput.I.

◆ get_nodepath()

const NodePath & ShaderInput::get_nodepath ( ) const

Warning: no error checking is done.

This *will* crash if get_value_type() is not M_nodepath.

Definition at line 92 of file shaderInput.cxx.

◆ get_param()

ParamValueBase * ShaderInput::get_param ( ) const
inline

Definition at line 558 of file shaderInput.I.

◆ get_priority()

int ShaderInput::get_priority ( ) const
inline

Definition at line 534 of file shaderInput.I.

◆ get_ptr()

const Shader::ShaderPtrData & ShaderInput::get_ptr ( ) const
inline

Definition at line 550 of file shaderInput.I.

◆ get_sampler()

const SamplerState & ShaderInput::get_sampler ( ) const

Warning: no error checking is done.

Definition at line 120 of file shaderInput.cxx.

References SamplerState::get_default(), and Texture::get_default_sampler.

◆ get_texture()

Texture * ShaderInput::get_texture ( ) const

Definition at line 100 of file shaderInput.cxx.

◆ get_value()

TypedWritableReferenceCount * ShaderInput::get_value ( ) const
inline

Definition at line 566 of file shaderInput.I.

◆ get_value_type()

int ShaderInput::get_value_type ( ) const
inline

Definition at line 526 of file shaderInput.I.

◆ get_vector()

const LVecBase4 & ShaderInput::get_vector ( ) const
inline

Definition at line 542 of file shaderInput.I.

◆ operator bool()

ShaderInput::operator bool ( ) const
inline

Definition at line 423 of file shaderInput.I.

◆ operator!=()

bool ShaderInput::operator!= ( const ShaderInput & other) const
inline

Definition at line 454 of file shaderInput.I.

◆ operator<()

bool ShaderInput::operator< ( const ShaderInput & other) const
inline

Definition at line 477 of file shaderInput.I.

◆ operator==()

bool ShaderInput::operator== ( const ShaderInput & other) const
inline

Definition at line 431 of file shaderInput.I.

◆ register_with_read_factory()

void ShaderInput::register_with_read_factory ( )
static

Definition at line 136 of file shaderInput.cxx.

Friends And Related Symbol Documentation

◆ Extension< ShaderInput >

friend class Extension< ShaderInput >
friend

Definition at line 142 of file shaderInput.h.

◆ ShaderAttrib

friend class ShaderAttrib
friend

Definition at line 142 of file shaderInput.h.


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