Record Class SDL_GPUIndirectDrawCommand

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_GPUIndirectDrawCommand
All Implemented Interfaces:
IPointer, ISDL_GPUIndirectDrawCommand

@ValueBasedCandidate @UnsafeConstructor public record SDL_GPUIndirectDrawCommand(@NotNull MemorySegment segment) extends Record implements ISDL_GPUIndirectDrawCommand

A structure specifying the parameters of an indirect draw command.

Note that the first_vertex and first_instance parameters are NOT compatible with built-in vertex/instance ID variables in shaders (for example, SV_VertexID); GPU APIs and shader languages do not define these built-in variables consistently, so if your shader depends on them, the only way to keep behavior consistent and portable is to always pass 0 for the correlating parameter in the draw calls.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_DrawGPUPrimitivesIndirect

Structure

typedef struct SDL_GPUIndirectDrawCommand {
    Uint32 num_vertices;
    Uint32 num_instances;
    Uint32 first_vertex;
    Uint32 first_instance;
} SDL_GPUIndirectDrawCommand;

Contracts

The property segment() should always be not-null (segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java null instead. See the documentation of IPointer.segment() for more details.

The constructor of this class is marked as UnsafeConstructor, because it does not perform any runtime check. The constructor can be useful for automatic code generators.

  • Field Details

    • LAYOUT

      public static final StructLayout LAYOUT
    • BYTES

      public static final long BYTES
    • PATH$num_vertices

      public static final MemoryLayout.PathElement PATH$num_vertices
    • PATH$num_instances

      public static final MemoryLayout.PathElement PATH$num_instances
    • PATH$first_vertex

      public static final MemoryLayout.PathElement PATH$first_vertex
    • PATH$first_instance

      public static final MemoryLayout.PathElement PATH$first_instance
    • LAYOUT$num_vertices

      public static final ValueLayout.OfInt LAYOUT$num_vertices
    • LAYOUT$num_instances

      public static final ValueLayout.OfInt LAYOUT$num_instances
    • LAYOUT$first_vertex

      public static final ValueLayout.OfInt LAYOUT$first_vertex
    • LAYOUT$first_instance

      public static final ValueLayout.OfInt LAYOUT$first_instance
    • SIZE$num_vertices

      public static final long SIZE$num_vertices
    • SIZE$num_instances

      public static final long SIZE$num_instances
    • SIZE$first_vertex

      public static final long SIZE$first_vertex
    • SIZE$first_instance

      public static final long SIZE$first_instance
    • OFFSET$num_vertices

      public static final long OFFSET$num_vertices
    • OFFSET$num_instances

      public static final long OFFSET$num_instances
    • OFFSET$first_vertex

      public static final long OFFSET$first_vertex
    • OFFSET$first_instance

      public static final long OFFSET$first_instance
  • Constructor Details

    • SDL_GPUIndirectDrawCommand

      public SDL_GPUIndirectDrawCommand(@NotNull @NotNull MemorySegment segment)
      Creates an instance of a SDL_GPUIndirectDrawCommand record class.
      Parameters:
      segment - the value for the segment record component
  • Method Details