GPUCommand

from panda3d._rplight import GPUCommand
class GPUCommand

Bases: DTOOL_SUPER_BASE

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

Inheritance diagram of GPUCommand

CMDInvalid = 0
CMDRemoveLight = 2
CMDRemoveSources = 4
CMDStoreLight = 1
CMDStoreSource = 3
CMD_invalid = 0
CMD_remove_light = 2
CMD_remove_sources = 4
CMD_store_light = 1
CMD_store_source = 3
__init__(*args, **kwargs)
getUsesIntegerPacking()

C++ Interface: get_uses_integer_packing()

/**
  • @brief Returns whether integers are packed as floats.

  • @details 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;

  • @return The integer representation flag

*/

get_uses_integer_packing()

C++ Interface: get_uses_integer_packing()

/**
  • @brief Returns whether integers are packed as floats.

  • @details 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;

  • @return The integer representation flag

*/

pushFloat()

C++ Interface: push_float(const GPUCommand self, float v)

/**
  • @brief Appends a float to the GPUCommand.

  • @details 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.

  • @param v The float to append.

*/

pushInt()

C++ Interface: push_int(const GPUCommand self, int v)

/**
  • @brief Appends an integer to the GPUCommand.

  • @details 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.

  • @param v The integer to append.

*/

pushMat3()

C++ Interface: push_mat3(const GPUCommand self, const LMatrix3f v)

/**
  • @brief Appends a floating point 3x3 matrix to the GPUCommand.

  • @details 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.

  • @param v Matrix to append

*/

pushMat4()

C++ Interface: push_mat4(const GPUCommand self, const LMatrix4f v)

/**
  • @brief Appends a floating point 4x4 matrix to the GPUCommand.

  • @details 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.

  • @param v Matrix to append

*/

pushVec3()

C++ Interface: push_vec3(const GPUCommand self, const LVecBase3f v) push_vec3(const GPUCommand self, const LVecBase3i v)

/**
  • @brief Appends a 3-component floating point vector to the GPUCommand.

  • @details This appends a 3-component floating point vector to the command.

  • It basically just calls push_float() for every component, in the order

  • x, y, z, which causes the vector to occupy the space of 3 floats.

  • @param v Int-Vector to append.

*/

/**
  • @brief Appends a 3-component integer vector to the GPUCommand.

  • @details This appends a 3-component integer vector to the command.

  • It basically just calls push_int() for every component, in the order

  • x, y, z, which causes the vector to occupy the space of 3 floats.

  • @param v Int-Vector to append.

*/

pushVec4()

C++ Interface: push_vec4(const GPUCommand self, const LVecBase4f v) push_vec4(const GPUCommand self, const LVecBase4i v)

/**
  • @brief Appends a 4-component floating point vector to the GPUCommand.

  • @details This appends a 4-component floating point vector to the command.

  • It basically just calls push_float() for every component, in the order

  • x, y, z, which causes the vector to occupy the space of 3 floats.

  • @param v Int-Vector to append.

*/

/**
  • @brief Appends a 4-component integer vector to the GPUCommand.

  • @details This appends a 4-component integer vector to the command.

  • It basically just calls push_int() for every component, in the order

  • x, y, z, w, which causes the vector to occupy the space of 4 floats.

  • @param v Int-Vector to append.

*/

push_float()

C++ Interface: push_float(const GPUCommand self, float v)

/**
  • @brief Appends a float to the GPUCommand.

  • @details 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.

  • @param v The float to append.

*/

push_int()

C++ Interface: push_int(const GPUCommand self, int v)

/**
  • @brief Appends an integer to the GPUCommand.

  • @details 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.

  • @param v The integer to append.

*/

push_mat3()

C++ Interface: push_mat3(const GPUCommand self, const LMatrix3f v)

/**
  • @brief Appends a floating point 3x3 matrix to the GPUCommand.

  • @details 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.

  • @param v Matrix to append

*/

push_mat4()

C++ Interface: push_mat4(const GPUCommand self, const LMatrix4f v)

/**
  • @brief Appends a floating point 4x4 matrix to the GPUCommand.

  • @details 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.

  • @param v Matrix to append

*/

push_vec3()

C++ Interface: push_vec3(const GPUCommand self, const LVecBase3f v) push_vec3(const GPUCommand self, const LVecBase3i v)

/**
  • @brief Appends a 3-component floating point vector to the GPUCommand.

  • @details This appends a 3-component floating point vector to the command.

  • It basically just calls push_float() for every component, in the order

  • x, y, z, which causes the vector to occupy the space of 3 floats.

  • @param v Int-Vector to append.

*/

/**
  • @brief Appends a 3-component integer vector to the GPUCommand.

  • @details This appends a 3-component integer vector to the command.

  • It basically just calls push_int() for every component, in the order

  • x, y, z, which causes the vector to occupy the space of 3 floats.

  • @param v Int-Vector to append.

*/

push_vec4()

C++ Interface: push_vec4(const GPUCommand self, const LVecBase4f v) push_vec4(const GPUCommand self, const LVecBase4i v)

/**
  • @brief Appends a 4-component floating point vector to the GPUCommand.

  • @details This appends a 4-component floating point vector to the command.

  • It basically just calls push_float() for every component, in the order

  • x, y, z, which causes the vector to occupy the space of 3 floats.

  • @param v Int-Vector to append.

*/

/**
  • @brief Appends a 4-component integer vector to the GPUCommand.

  • @details This appends a 4-component integer vector to the command.

  • It basically just calls push_int() for every component, in the order

  • x, y, z, w, which causes the vector to occupy the space of 4 floats.

  • @param v Int-Vector to append.

*/

write()

C++ Interface: write(GPUCommand self, ostream out)

/**
  • @brief Prints out the GPUCommand to the console

  • @details 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()

C++ Interface: write_to(const GPUCommand self, const PointerToArray dest, int command_index)

/**
  • @brief Writes the GPU command to a given target.

  • @details 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.

  • @param dest Handle to the memory to write the command to

  • @param command_index Offset to write the command to. The command will write

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

*/

write_to()

C++ Interface: write_to(const GPUCommand self, const PointerToArray dest, int command_index)

/**
  • @brief Writes the GPU command to a given target.

  • @details 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.

  • @param dest Handle to the memory to write the command to

  • @param command_index Offset to write the command to. The command will write

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

*/