# panda3d._rplight.GPUCommand¶

class GPUCommand

This class can be seen like a packet, to be transferred to the GPU. It has a command type, which tells the GPU what to do once it recieved this “packet”. It stores a limited amount of floating point components.

Inheritance diagram

enum CommandType

The different types of GPUCommands. Each type has a special case in the command queue processor. When adding new types, those need to be handled in the command target, too.

enumerator CMD_invalid = 0
enumerator CMD_store_light = 1
enumerator CMD_remove_light = 2
enumerator CMD_store_source = 3
enumerator CMD_remove_sources = 4
__init__(param0: GPUCommand) → None
__init__(command_type: CommandType) → None

This will construct a new GPUCommand of the given command type. The command type should be of GPUCommandCommandType, and determines what data the GPUCommand contains, and how it will be handled.

static getUsesIntegerPacking() → bool

This returns how integer are packed into the data stream. If the returned value is true, then integers are packed using their binary representation converted to floating point format. If the returned value is false, then integers are packed by simply casting them to float, e.g. val = (float)i;

pushFloat(v: float) → None

This adds an integer to the back of the GPUCommand. Its used by all other push_xxx methods, and simply stores the value, then increments the write pointer. When the amount of floats exceeds the capacity of the GPUCommand, an error will be printed, and the method returns without doing anything else.

pushInt(v: int) → None

This adds an integer to the back of the GPUCommand. Depending on the setting in convert_int_to_float, this will either just convert the int to a float by casting it, or just do a bitwise copy.

pushMat3(v: LMatrix3) → None

This appends a floating point 3x3 matrix to the GPUCommand, by pushing all components in row-order to the command. This occupies a space of 9 floats.

pushMat4(v: LMatrix4) → None

This appends a floating point 4x4 matrix to the GPUCommand, by pushing all components in row-order to the command. This occupies a space of 16 floats.

pushVec3(v: LVecBase3) → None

This appends a 3-component floating point vector to the command. It basically just calls pushFloat() for every component, in the order x, y, z, which causes the vector to occupy the space of 3 floats.

pushVec3(v: LVecBase3i) → None

This appends a 3-component integer vector to the command. It basically just calls pushInt() for every component, in the order x, y, z, which causes the vector to occupy the space of 3 floats.

pushVec4(v: LVecBase4) → None

This appends a 4-component floating point vector to the command. It basically just calls pushFloat() for every component, in the order x, y, z, which causes the vector to occupy the space of 3 floats.

pushVec4(v: LVecBase4i) → None

This appends a 4-component integer vector to the command. It basically just calls pushInt() for every component, in the order x, y, z, w, which causes the vector to occupy the space of 4 floats.

write(out: ostream) → None

This method prints the type, size, and data of the GPUCommand to the console. This helps for debugging the contents of the GPUCommand. Keep in mind that integers might be shown in their binary float representation, depending on the setting in the GPUCommand::convert_int_to_float method.

writeTo(dest: PTA_uchar, command_index: size_t) → None

This method writes all the data of the GPU command to a given target. The target should be a pointer to memory being big enough to hold the data. Presumably #dest will be a handle to texture memory. The command_index controls the offset where the data will be written to.

its data to command_index * GPU_COMMAND_ENTRIES. When writing the GPUCommand in a GPUCommandList, the command_index will most likely be the index of the command in the list.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2966783940792084, "perplexity": 2884.5418393753885}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655897844.44/warc/CC-MAIN-20200709002952-20200709032952-00399.warc.gz"}