Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions

# GraphicsThreadingModel Class Reference

This represents the user's specification of how a particular frame is handled by the various threads. More...

List of all members.

## Public Member Functions
| GraphicsThreadingModel (GraphicsThreadingModel const copy)
| GraphicsThreadingModel (string model)
| The threading model accepts a string representing the names of the two threads that will process cull and draw for the given window, separated by a slash.
| GraphicsThreadingModel ()
| The threading model accepts a string representing the names of the two threads that will process cull and draw for the given window, separated by a slash.
string | getCullName ()
| Returns the name of the thread that will handle culling in this model.
bool | getCullSorting ()
| Returns true if the model involves a separate cull pass, or false if culling happens implicitly, at the same time as draw.
int | getCullStage ()
| Returns the pipeline stage from which the cull thread should access data.
string | getDrawName ()
| Returns the name of the thread that will handle sending the actual graphics primitives to the graphics API in this model.
int | getDrawStage ()
| Returns the pipeline stage from which the draw thread should access data.
string | getModel ()
| Returns the string that describes the threading model.
bool | isDefault ()
| Returns true if the threading model is the default, cull-then-draw single-threaded model, or false otherwise.
bool | isSingleThreaded ()
| Returns true if the threading model is a single-threaded model, or false if it involves threads.
GraphicsThreadingModel | operator= (GraphicsThreadingModel const copy)
| output (ostream out)
| setCullName (string cull_name)
| Changes the name of the thread that will handle culling in this model.
| setCullSorting (bool cull_sorting)
| Changes the flag that indicates whether the threading model involves a separate cull pass.
| setDrawName (string cull_name)
| Changes the name of the thread that will handle drawing in this model.

## Detailed Description

This represents the user's specification of how a particular frame is handled by the various threads.

## Constructor & Destructor Documentation

GraphicsThreadingModel | ( | GraphicsThreadingModel const | copy | ) |

GraphicsThreadingModel | ( | string | model | ) |

The threading model accepts a string representing the names of the two threads that will process cull and draw for the given window, separated by a slash.

The names are completely arbitrary and are used only to differentiate threads. The two names may be the same, meaning the same thread, or each may be the empty string, which represents the previous thread.

Thus, for example, "cull/draw" indicates that the window will be culled in a thread called "cull", and drawn in a separate thread called "draw". "draw/draw" or simply "draw" indicates the window will be culled and drawn in the same thread, "draw". On the other hand, "/draw" indicates the thread will be culled in the main, or app thread, and drawn in a separate thread named "draw". The empty string, "" or "/", indicates the thread will be culled and drawn in the main thread; that is to say, a single-process model.

Finally, if the threading model begins with a "-" character, then cull and draw are run simultaneously, in the same thread, with no binning or state sorting. It simplifies the cull process but it forces the scene to render in scene graph order; state sorting and alpha sorting is lost.

GraphicsThreadingModel | ( |  | ) |

The threading model accepts a string representing the names of the two threads that will process cull and draw for the given window, separated by a slash.

The names are completely arbitrary and are used only to differentiate threads. The two names may be the same, meaning the same thread, or each may be the empty string, which represents the previous thread.

Thus, for example, "cull/draw" indicates that the window will be culled in a thread called "cull", and drawn in a separate thread called "draw". "draw/draw" or simply "draw" indicates the window will be culled and drawn in the same thread, "draw". On the other hand, "/draw" indicates the thread will be culled in the main, or app thread, and drawn in a separate thread named "draw". The empty string, "" or "/", indicates the thread will be culled and drawn in the main thread; that is to say, a single-process model.

Finally, if the threading model begins with a "-" character, then cull and draw are run simultaneously, in the same thread, with no binning or state sorting. It simplifies the cull process but it forces the scene to render in scene graph order; state sorting and alpha sorting is lost.

## Member Function Documentation

string getCullName | ( |  | ) |

Returns the name of the thread that will handle culling in this model.

bool getCullSorting | ( |  | ) |

Returns true if the model involves a separate cull pass, or false if culling happens implicitly, at the same time as draw.

int getCullStage | ( |  | ) |

Returns the pipeline stage from which the cull thread should access data.

This will be 0 if the cull is run in the same thread as app, or 1 if it is its own thread.

string getDrawName | ( |  | ) |

Returns the name of the thread that will handle sending the actual graphics primitives to the graphics API in this model.

int getDrawStage | ( |  | ) |

Returns the pipeline stage from which the draw thread should access data.

This will be the same value as get_cull_stage() if cull and draw are run in the same thread, or one more than that value if draw should be in its own thread.

string getModel | ( |  | ) |

Returns the string that describes the threading model.

See the constructor.

bool isDefault | ( |  | ) |

Returns true if the threading model is the default, cull-then-draw single-threaded model, or false otherwise.

bool isSingleThreaded | ( |  | ) |

Returns true if the threading model is a single-threaded model, or false if it involves threads.

GraphicsThreadingModel operator= | ( | GraphicsThreadingModel const | copy | ) |

output | ( | ostream | out | ) |

setCullName | ( | string | cull_name | ) |

Changes the name of the thread that will handle culling in this model.

This won't change any windows that were already created with this model; this only has an effect on newly-opened windows.

setCullSorting | ( | bool | cull_sorting | ) |

Changes the flag that indicates whether the threading model involves a separate cull pass.

This won't change any windows that were already created with this model; this only has an effect on newly-opened windows.

setDrawName | ( | string | cull_name | ) |

Changes the name of the thread that will handle drawing in this model.

This won't change any windows that were already created with this model; this only has an effect on newly-opened windows.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties