Panda3D

Loading...
Searching...
No Matches
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:

## Public Types
typedef DXGraphicsStateGuardian9 | GSG

## Public Member Functions
| DXShaderContext9 (Shader *s, GSG *gsg)
| xyz
| ~DXShaderContext9 ()
| xyz
bool | bind (GSG *gsg)
| This function is to be called to enable a new shader.
void | disable_shader_texture_bindings (GSG *gsg)
| Disable all the texture bindings used by this shader.
void | disable_shader_vertex_arrays (GSG *gsg)
| Disable all the vertex arrays used by this shader.
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.
void | issue_transform (GSG *gsg)
void | unbind (GSG *gsg)
| This function disables a currently-bound shader.
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.
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.
bool | valid (GSG *gsg)
| Returns true if the shader is "valid", ie, if the compilation was successful.
Public Member Functions inherited from ShaderContext
| ShaderContext (Shader *se)
virtual void | bind ()
virtual void | disable_shader_texture_bindings ()
virtual void | disable_shader_vertex_arrays ()
Shader * | get_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
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
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.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)

## 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.

## 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.

## Member Typedef Documentation

## ◆ GSG

typedef DXGraphicsStateGuardian9 DXShaderContext9::GSG

Definition at line 60 of file dxShaderContext9.h.

## Constructor & Destructor Documentation

## ◆ DXShaderContext9()

DXShaderContext9::DXShaderContext9 | ( | Shader * | s,
|  | GSG * | gsg )

xyz

Definition at line 36 of file dxShaderContext9.cxx.

References Shader::get_filename(), and Shader::get_language().

Referenced by update_shader_texture_bindings(), and update_shader_vertex_arrays().

## ◆ ~DXShaderContext9()

DXShaderContext9::~DXShaderContext9 | ( |  | ) |

xyz

Definition at line 82 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 121 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 661 of file dxShaderContext9.cxx.

Referenced by 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 369 of file dxShaderContext9.cxx.

Referenced by update_shader_vertex_arrays().

## ◆ force_init_type()

virtual TypeHandle DXShaderContext9::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from ShaderContext.

Definition at line 105 of file dxShaderContext9.h.

## ◆ get_class_type()

static TypeHandle DXShaderContext9::get_class_type | ( |  | ) |
| inline static

Definition at line 94 of file dxShaderContext9.h.

## ◆ get_type()

virtual TypeHandle DXShaderContext9::get_type | ( |  | ) | const
| inline virtual

Reimplemented from ShaderContext.

Definition at line 102 of file dxShaderContext9.h.

## ◆ init_type()

static void DXShaderContext9::init_type | ( |  | ) |
| inline static

Definition at line 97 of file dxShaderContext9.h.

## ◆ 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 191 of file dxShaderContext9.cxx.

References GraphicsStateGuardian::fetch_ptr_parameter(), and GraphicsStateGuardian::fetch_specified_value().

Referenced by bind().

## ◆ unbind()

void DXShaderContext9::unbind | ( | GSG * | gsg | ) |

This function disables a currently-bound shader.

Definition at line 159 of file dxShaderContext9.cxx.

## ◆ 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 692 of file dxShaderContext9.cxx.

References DXShaderContext9(), DXGraphicsStateGuardian9::apply_texture(), disable_shader_texture_bindings(), and GraphicsStateGuardian::fetch_specified_texture().

## ◆ 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 386 of file dxShaderContext9.cxx.

References DXShaderContext9(), disable_shader_vertex_arrays(), InternalName::get_basename, GeomVertexArrayFormat::get_stride, TextureStage::get_texcoord_name, DXGraphicsStateGuardian9::get_white_vbuffer(), 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 20 of file dxShaderContext9.I.

## Member Data Documentation

## ◆ _name

std::string DXShaderContext9::_name

Definition at line 82 of file dxShaderContext9.h.

## ◆ _num_bound_streams

int DXShaderContext9::_num_bound_streams

Definition at line 79 of file dxShaderContext9.h.

## ◆ _vertex_declaration

LPDIRECT3DVERTEXDECLARATION9 DXShaderContext9::_vertex_declaration

Definition at line 77 of file dxShaderContext9.h.

## ◆ _vertex_element_array

class VertexElementArray* DXShaderContext9::_vertex_element_array

Definition at line 76 of file dxShaderContext9.h.

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

- panda/src/dxgsg9/dxShaderContext9.h
- panda/src/dxgsg9/dxShaderContext9.cxx
- panda/src/dxgsg9/dxShaderContext9.I