Panda3D
 All Classes Functions Variables Enumerations
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
DXShaderContext9 Class Reference

xyz More...

#include "dxShaderContext9.h"

Inheritance diagram for DXShaderContext9:
ShaderContext SavedContext TypedObject MemoryBase

Public Types

typedef DXGraphicsStateGuardian9 GSG
 

Public Member Functions

 DXShaderContext9 (Shader *s, GSG *gsg)
 xyz More...
 
 ~DXShaderContext9 ()
 xyz More...
 
bool bind (GSG *gsg)
 This function is to be called to enable a new shader. More...
 
void disable_shader_texture_bindings (GSG *gsg)
 Disable all the texture bindings used by this shader. More...
 
void disable_shader_vertex_arrays (GSG *gsg)
 Disable all the vertex arrays used by this shader. More...
 
virtual TypeHandle force_init_type ()
 
virtual TypeHandle get_type () const
 
void issue_parameters (GSG *gsg, int altered)
 This function gets called whenever the RenderState or TransformState has changed, but the Shader itself has not changed. More...
 
void issue_transform (GSG *gsg)
 
void unbind (GSG *gsg)
 This function disables a currently-bound shader. More...
 
void update_shader_texture_bindings (DXShaderContext9 *prev, GSG *gsg)
 Disables all texture bindings used by the previous shader, then enables all the texture bindings needed by this shader. More...
 
bool update_shader_vertex_arrays (DXShaderContext9 *prev, GSG *gsg, bool force)
 Disables all vertex arrays used by the previous shader, then enables all the vertex arrays needed by this shader. More...
 
bool valid (GSG *gsg)
 
- Public Member Functions inherited from ShaderContext
 ShaderContext (Shader *se)
 
virtual void bind (bool reissue_parameters=true)
 
virtual void disable_shader_texture_bindings ()
 
virtual void disable_shader_vertex_arrays ()
 
Shaderget_shader () const
 
virtual void issue_parameters (int altered)
 
virtual void unbind ()
 
virtual void update_shader_texture_bindings (ShaderContext *prev)
 
virtual bool update_shader_vertex_arrays (ShaderContext *prev, bool force)
 
virtual bool uses_custom_texture_bindings (void)
 
virtual bool uses_custom_vertex_arrays (void)
 
virtual bool uses_standard_vertex_arrays (void)
 
virtual bool valid ()
 
- Public Member Functions inherited from SavedContext
virtual void output (ostream &out) const
 
virtual void write (ostream &out, int indent_level) const
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
void operator= (const TypedObject &copy)
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from ShaderContext
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from SavedContext
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96. More...
 

Public Attributes

string _name
 
int _num_bound_streams
 
LPDIRECT3DVERTEXDECLARATION9 _vertex_declaration
 
class VertexElementArray_vertex_element_array
 
- Public Attributes inherited from ShaderContext
Shader_shader
 

Detailed Description

xyz

Definition at line 63 of file dxShaderContext9.h.

Constructor & Destructor Documentation

DXShaderContext9::DXShaderContext9 ( Shader s,
GSG gsg 
)

xyz

Definition at line 40 of file dxShaderContext9.cxx.

DXShaderContext9::~DXShaderContext9 ( )

xyz

Definition at line 89 of file dxShaderContext9.cxx.

Member Function Documentation

bool DXShaderContext9::bind ( GSG gsg)

This function is to be called to enable a new shader.

It also initializes all of the shader's input parameters.

Definition at line 180 of file dxShaderContext9.cxx.

void DXShaderContext9::disable_shader_texture_bindings ( GSG gsg)

Disable all the texture bindings used by this shader.

Definition at line 678 of file dxShaderContext9.cxx.

Referenced by DXGraphicsStateGuardian9::end_scene().

void DXShaderContext9::disable_shader_vertex_arrays ( GSG gsg)

Disable all the vertex arrays used by this shader.

Definition at line 403 of file dxShaderContext9.cxx.

Referenced by DXGraphicsStateGuardian9::begin_draw_primitives(), and DXGraphicsStateGuardian9::end_scene().

void DXShaderContext9::issue_parameters ( GSG gsg,
int  altered 
)

This function gets called whenever the RenderState or TransformState has changed, but the Shader itself has not changed.

It loads new values into the shader's parameters.

If "altered" is false, that means you promise that the parameters for this shader context have already been issued once, and that since the last time the parameters were issued, no part of the render state has changed except the external and internal transforms.

Definition at line 258 of file dxShaderContext9.cxx.

References LMatrix4f::get_data().

Referenced by DXGraphicsStateGuardian9::set_state_and_transform().

void DXShaderContext9::unbind ( GSG gsg)

This function disables a currently-bound shader.

Definition at line 220 of file dxShaderContext9.cxx.

Referenced by DXGraphicsStateGuardian9::end_scene().

void DXShaderContext9::update_shader_texture_bindings ( DXShaderContext9 prev,
GSG gsg 
)

Disables all texture bindings used by the previous shader, then enables all the texture bindings needed by this shader.

Extracts the relevant vertex array data from the gsg. The current implementation is inefficient, because it may unnecessarily disable textures then immediately reenable them. We may optimize this someday.

Definition at line 716 of file dxShaderContext9.cxx.

References TextureAttrib::get_num_on_stages(), TextureAttrib::get_on_sampler(), TextureAttrib::get_on_stage(), TextureAttrib::get_on_texture(), TextureStage::get_tex_view_offset(), Texture::get_texture_type(), Texture::load_related(), and Texture::prepare_now().

bool DXShaderContext9::update_shader_vertex_arrays ( DXShaderContext9 prev,
GSG gsg,
bool  force 
)

Disables all vertex arrays used by the previous shader, then enables all the vertex arrays needed by this shader.

Extracts the relevant vertex array data from the gsg. The current implementation is inefficient, because it may unnecessarily disable arrays then immediately reenable them. We may optimize this someday.

Definition at line 425 of file dxShaderContext9.cxx.

References TextureStage::get_texcoord_name().

Referenced by DXGraphicsStateGuardian9::begin_draw_primitives().


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