Panda3D
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, int priority=0)
 
 ShaderInput (CPT_InternalName name, Texture *tex, 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, const PTA_float &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase4f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase3f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase2f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix4f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix3f &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase4f &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase3f &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase2f &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix4f &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix3f &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_double &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase4d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase3d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase2d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix4d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LMatrix3d &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase4d &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase3d &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase2d &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix4d &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LMatrix3d &mat, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_int &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase4i &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase3i &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const PTA_LVecBase2i &ptr, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase4i &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase3i &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const LVecBase2i &vec, int priority=0)
 
 ShaderInput (CPT_InternalName name, const NodePath &np, 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)
 
size_t add_hash (size_t hash) const
 
const InternalNameget_name () const
 
const NodePathget_nodepath () const
 Warning: no error checking is done. More...
 
ParamValueBaseget_param () const
 
int get_priority () const
 
const Shader::ShaderPtrDataget_ptr () const
 
const SamplerStateget_sampler () const
 Warning: no error checking is done. More...
 
Textureget_texture () const
 
TypedWritableReferenceCountget_value () const
 
int get_value_type () const
 
const LVecBase4 & get_vector () const
 
bool operator != (const ShaderInput &other) const
 
 operator bool () 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. More...
 
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 Function Documentation

◆ 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 23 of file shaderInput.cxx.

◆ 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 93 of file shaderInput.cxx.

◆ get_sampler()

const SamplerState & ShaderInput::get_sampler ( ) const

Warning: no error checking is done.

Definition at line 121 of file shaderInput.cxx.


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