Panda3D
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)
 Returns true if the shader is "valid", ie, if the compilation was successful. More...
 
- Public Member Functions inherited from ShaderContext
 ShaderContext (Shader *se)
 
virtual void bind ()
 
virtual void disable_shader_texture_bindings ()
 
virtual void disable_shader_vertex_arrays ()
 
Shaderget_shader () const
 
virtual void issue_parameters (int altered)
 
virtual void set_state_and_transform (const RenderState *, const TransformState *, const TransformState *, const TransformState *)
 
virtual void unbind ()
 
virtual void update_shader_buffer_bindings (ShaderContext *prev)
 
virtual void update_shader_texture_bindings (ShaderContext *prev)
 
virtual bool update_shader_vertex_arrays (ShaderContext *prev, bool force)
 
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 (std::ostream &out) const
 
virtual void write (std::ostream &out, int indent_level) const
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
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...
 
TypedObjectoperator= (const TypedObject &copy)=default
 

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

std::string _name
 
int _num_bound_streams
 
LPDIRECT3DVERTEXDECLARATION9 _vertex_declaration
 
class VertexElementArray_vertex_element_array
 
- Public Attributes inherited from ShaderContext
Shader_shader
 
 get_shader
 
- Public Attributes inherited from TypedObject
 get_type
 

Detailed Description

xyz

Definition at line 58 of file dxShaderContext9.h.

Constructor & Destructor Documentation

◆ DXShaderContext9()

DXShaderContext9::DXShaderContext9 ( Shader s,
GSG gsg 
)

xyz

Definition at line 37 of file dxShaderContext9.cxx.

References Shader::get_filename().

◆ ~DXShaderContext9()

DXShaderContext9::~DXShaderContext9 ( )

xyz

Definition at line 83 of file dxShaderContext9.cxx.

Member Function Documentation

◆ bind()

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 122 of file dxShaderContext9.cxx.

References issue_parameters().

◆ disable_shader_texture_bindings()

void DXShaderContext9::disable_shader_texture_bindings ( GSG gsg)

Disable all the texture bindings used by this shader.

Definition at line 634 of file dxShaderContext9.cxx.

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

◆ disable_shader_vertex_arrays()

void DXShaderContext9::disable_shader_vertex_arrays ( GSG gsg)

Disable all the vertex arrays used by this shader.

Definition at line 342 of file dxShaderContext9.cxx.

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

◆ issue_parameters()

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 192 of file dxShaderContext9.cxx.

Referenced by bind(), and DXGraphicsStateGuardian9::set_state_and_transform().

◆ unbind()

void DXShaderContext9::unbind ( GSG gsg)

This function disables a currently-bound shader.

Definition at line 160 of file dxShaderContext9.cxx.

Referenced by DXGraphicsStateGuardian9::end_scene().

◆ update_shader_texture_bindings()

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 665 of file dxShaderContext9.cxx.

References disable_shader_texture_bindings().

◆ update_shader_vertex_arrays()

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 359 of file dxShaderContext9.cxx.

References disable_shader_vertex_arrays(), InternalName::get_basename, GeomVertexArrayFormat::get_stride, TextureStage::get_texcoord_name, and DXGraphicsStateGuardian9::setup_array_data().

◆ valid()

bool DXShaderContext9::valid ( GSG gsg)
inline

Returns true if the shader is "valid", ie, if the compilation was successful.

The compilation could fail if there is a syntax error in the shader, or if the current video card isn't shader-capable, or if no shader languages are compiled into panda.

Definition at line 21 of file dxShaderContext9.I.


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