Record Class SDL_GPUColorTargetInfo

java.lang.Object
java.lang.Record
club.doki7.sdl3.datatype.SDL_GPUColorTargetInfo
All Implemented Interfaces:
IPointer, ISDL_GPUColorTargetInfo

@ValueBasedCandidate @UnsafeConstructor public record SDL_GPUColorTargetInfo(@NotNull MemorySegment segment) extends Record implements ISDL_GPUColorTargetInfo

A structure specifying the parameters of a color target used by a render pass.

The load_op field determines what is done with the texture at the beginning of the render pass.

  • LOAD: Loads the data currently in the texture. Not recommended for multisample textures as it requires significant memory bandwidth.
  • CLEAR: Clears the texture to a single color.
  • DONT_CARE: The driver will do whatever it wants with the texture memory. This is a good option if you know that every single pixel will be touched in the render pass.

The store_op field determines what is done with the color results of the render pass.

  • STORE: Stores the results of the render pass in the texture. Not recommended for multisample textures as it requires significant memory bandwidth.
  • DONT_CARE: The driver will do whatever it wants with the texture memory. This is often a good option for depth/stencil textures.
  • RESOLVE: Resolves a multisample texture into resolve_texture, which must have a sample count of 1. Then the driver may discard the multisample texture memory. This is the most performant method of resolving a multisample target.
  • RESOLVE_AND_STORE: Resolves a multisample texture into the resolve_texture, which must have a sample count of 1. Then the driver stores the multisample texture's contents. Not recommended as it requires significant memory bandwidth.

Since: This struct is available since SDL 3.2.0.

See also:

  • SDL_BeginGPURenderPass

Structure

typedef struct SDL_GPUColorTargetInfo {
    SDL_GPUTexture* texture;
    Uint32 mip_level;
    Uint32 layer_or_depth_plane;
    SDL_FColor clear_color;
    SDL_GPULoadOp load_op;
    SDL_GPUStoreOp store_op;
    SDL_GPUTexture* resolve_texture;
    Uint32 resolve_mip_level;
    Uint32 resolve_layer;
    bool cycle;
    bool cycle_resolve_texture;
    Uint8 padding1;
    Uint8 padding2;
} SDL_GPUColorTargetInfo;

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$texture

      public static final MemoryLayout.PathElement PATH$texture
    • PATH$mip_level

      public static final MemoryLayout.PathElement PATH$mip_level
    • PATH$layer_or_depth_plane

      public static final MemoryLayout.PathElement PATH$layer_or_depth_plane
    • PATH$clear_color

      public static final MemoryLayout.PathElement PATH$clear_color
    • PATH$load_op

      public static final MemoryLayout.PathElement PATH$load_op
    • PATH$store_op

      public static final MemoryLayout.PathElement PATH$store_op
    • PATH$resolve_texture

      public static final MemoryLayout.PathElement PATH$resolve_texture
    • PATH$resolve_mip_level

      public static final MemoryLayout.PathElement PATH$resolve_mip_level
    • PATH$resolve_layer

      public static final MemoryLayout.PathElement PATH$resolve_layer
    • PATH$cycle

      public static final MemoryLayout.PathElement PATH$cycle
    • PATH$cycle_resolve_texture

      public static final MemoryLayout.PathElement PATH$cycle_resolve_texture
    • PATH$padding1

      public static final MemoryLayout.PathElement PATH$padding1
    • PATH$padding2

      public static final MemoryLayout.PathElement PATH$padding2
    • LAYOUT$texture

      public static final AddressLayout LAYOUT$texture
    • LAYOUT$mip_level

      public static final ValueLayout.OfInt LAYOUT$mip_level
    • LAYOUT$layer_or_depth_plane

      public static final ValueLayout.OfInt LAYOUT$layer_or_depth_plane
    • LAYOUT$clear_color

      public static final StructLayout LAYOUT$clear_color
    • LAYOUT$load_op

      public static final ValueLayout.OfInt LAYOUT$load_op
    • LAYOUT$store_op

      public static final ValueLayout.OfInt LAYOUT$store_op
    • LAYOUT$resolve_texture

      public static final AddressLayout LAYOUT$resolve_texture
    • LAYOUT$resolve_mip_level

      public static final ValueLayout.OfInt LAYOUT$resolve_mip_level
    • LAYOUT$resolve_layer

      public static final ValueLayout.OfInt LAYOUT$resolve_layer
    • LAYOUT$cycle

      public static final ValueLayout.OfBoolean LAYOUT$cycle
    • LAYOUT$cycle_resolve_texture

      public static final ValueLayout.OfBoolean LAYOUT$cycle_resolve_texture
    • LAYOUT$padding1

      public static final ValueLayout.OfByte LAYOUT$padding1
    • LAYOUT$padding2

      public static final ValueLayout.OfByte LAYOUT$padding2
    • SIZE$texture

      public static final long SIZE$texture
    • SIZE$mip_level

      public static final long SIZE$mip_level
    • SIZE$layer_or_depth_plane

      public static final long SIZE$layer_or_depth_plane
    • SIZE$clear_color

      public static final long SIZE$clear_color
    • SIZE$load_op

      public static final long SIZE$load_op
    • SIZE$store_op

      public static final long SIZE$store_op
    • SIZE$resolve_texture

      public static final long SIZE$resolve_texture
    • SIZE$resolve_mip_level

      public static final long SIZE$resolve_mip_level
    • SIZE$resolve_layer

      public static final long SIZE$resolve_layer
    • SIZE$cycle

      public static final long SIZE$cycle
    • SIZE$cycle_resolve_texture

      public static final long SIZE$cycle_resolve_texture
    • SIZE$padding1

      public static final long SIZE$padding1
    • SIZE$padding2

      public static final long SIZE$padding2
    • OFFSET$texture

      public static final long OFFSET$texture
    • OFFSET$mip_level

      public static final long OFFSET$mip_level
    • OFFSET$layer_or_depth_plane

      public static final long OFFSET$layer_or_depth_plane
    • OFFSET$clear_color

      public static final long OFFSET$clear_color
    • OFFSET$load_op

      public static final long OFFSET$load_op
    • OFFSET$store_op

      public static final long OFFSET$store_op
    • OFFSET$resolve_texture

      public static final long OFFSET$resolve_texture
    • OFFSET$resolve_mip_level

      public static final long OFFSET$resolve_mip_level
    • OFFSET$resolve_layer

      public static final long OFFSET$resolve_layer
    • OFFSET$cycle

      public static final long OFFSET$cycle
    • OFFSET$cycle_resolve_texture

      public static final long OFFSET$cycle_resolve_texture
    • OFFSET$padding1

      public static final long OFFSET$padding1
    • OFFSET$padding2

      public static final long OFFSET$padding2
  • Constructor Details

    • SDL_GPUColorTargetInfo

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