GLDISPATCHCOMPUTEIND(3G)

✨ NAME ✨

hey bestie, welcome to GLDISPATCHCOMPUTEIND(3G) β€” yes, that's the 3G manual, and the header's manual field is literally [FIXME: manual]. okay so glDispatchComputeIndirect β€” launch one or more compute work groups using parameters stored in a buffer. periodt.

πŸ“œ C SPECIFICATION πŸ“œ

void glDispatchComputeIndirect(GLintptr indirect);

πŸŽ€ PARAMETERS πŸŽ€

  • indirect β€” the offset into the buffer object currently bound to the GL_DISPATCH_INDIRECT_BUFFER buffer target at which the dispatch parameters are stored.

πŸ’– DESCRIPTION πŸ’–

glDispatchComputeIndirect launches one or more compute work groups using parameters stored in the buffer object currently bound to the GL_DISPATCH_INDIRECT_BUFFER target. Each work group is processed by the active program object for the compute shader stage. The individual shader invocations inside a work group are executed as a unit, but the work groups themselves are executed completely independently and in unspecified order β€” chaotic but valid, iykyk.

indirect contains the offset into the data store of the buffer object bound to the GL_DISPATCH_INDIRECT_BUFFER target at which those parameters are stored.

The parameters addressed by indirect are packed as a structure that takes this form in C:

typedef  struct {
    uint  num_groups_x;
    uint  num_groups_y;
    uint  num_groups_z;
} DispatchIndirectCommand;

A call to glDispatchComputeIndirect is equivalent, assuming no errors are generated, to:

cmd = (const DispatchIndirectCommand  *)indirect;
glDispatchComputeIndirect(cmd->num_groups_x, cmd->num_groups_y, cmd->num_groups_z);
🚨 Unlike glDispatchCompute(), no error is generated if any of the num_groups_x, num_groups_y or num_groups_z members of the DispatchIndirectCommand is larger than the value of GL_MAX_COMPUTE_WORK_GROUP_COUNT for the corresponding dimension. In such circumstances, behavior is undefined and may lead to application termination. not a drill, bestie.

πŸ’€ ERRORS πŸ’€

  • GL_INVALID_OPERATION is generated if there is no active program for the compute shader stage.
  • GL_INVALID_VALUE is generated if indirect is less than zero or not a multiple of four.
  • GL_INVALID_OPERATION is generated if no buffer is bound to the GL_DISPATCH_INDIRECT_BUFFER target or if the command would source data beyond the end of the buffer object's data store.

πŸ” ASSOCIATED GETS πŸ”

glGet() with argument GL_MAX_COMPUTE_WORK_GROUP_COUNT.

🌈 VERSION SUPPORT 🌈

the table's Function / Feature Name row is glDispatchComputeIndirect, and the OpenGL Version columns line up like this:

  • 2.0 β€” -
  • 2.1 β€” -
  • 3.0 β€” -
  • 3.1 β€” -
  • 3.2 β€” -
  • 3.3 β€” -
  • 4.0 β€” -
  • 4.1 β€” -
  • 4.2 β€” -
  • 4.3 β€” βœ”
  • 4.4 β€” βœ”
  • 4.5 β€” βœ”

πŸ‘€ SEE ALSO πŸ‘€

glDispatchCompute().

Copyright Β© 2013-2014 Khronos Group. This material may be distributed subject to the terms and conditions set forth in the Open Publication License, v 1.0, 8 June 1999. http://opencontent.org/openpub/.

Copyright Β© 2013-2014 Khronos Group


okay bye bestie 🫢 β€” source/version field: [FIXME: source] Β· date: 08/09/2021 Β· footer title: GLDISPATCHCOMPUTEIND(3G). slay.

πŸ“¦ where this page comes from