SDL 3.0
SDL_GPUColorTargetInfo Struct Reference

#include <SDL_gpu.h>

+ Collaboration diagram for SDL_GPUColorTargetInfo:

Data Fields

SDL_GPUTexturetexture
 
Uint32 mip_level
 
Uint32 layer_or_depth_plane
 
SDL_FColor clear_color
 
SDL_GPULoadOp load_op
 
SDL_GPUStoreOp store_op
 
SDL_GPUTextureresolve_texture
 
Uint32 resolve_mip_level
 
Uint32 resolve_layer
 
bool cycle
 
bool cycle_resolve_texture
 
Uint8 padding1
 
Uint8 padding2
 

Detailed Description

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.0.0
See also
SDL_BeginGPURenderPass

Definition at line 1684 of file SDL_gpu.h.

Field Documentation

◆ clear_color

SDL_FColor SDL_GPUColorTargetInfo::clear_color

The color to clear the color target to at the start of the render pass. Ignored if SDL_GPU_LOADOP_CLEAR is not used.

Definition at line 1689 of file SDL_gpu.h.

◆ cycle

bool SDL_GPUColorTargetInfo::cycle

true cycles the texture if the texture is bound and load_op is not LOAD

Definition at line 1695 of file SDL_gpu.h.

◆ cycle_resolve_texture

bool SDL_GPUColorTargetInfo::cycle_resolve_texture

true cycles the resolve texture if the resolve texture is bound. Ignored if a RESOLVE* store_op is not used.

Definition at line 1696 of file SDL_gpu.h.

◆ layer_or_depth_plane

Uint32 SDL_GPUColorTargetInfo::layer_or_depth_plane

The layer index or depth plane to use as a color target. This value is treated as a layer index on 2D array and cube textures, and as a depth plane on 3D textures.

Definition at line 1688 of file SDL_gpu.h.

◆ load_op

SDL_GPULoadOp SDL_GPUColorTargetInfo::load_op

What is done with the contents of the color target at the beginning of the render pass.

Definition at line 1690 of file SDL_gpu.h.

◆ mip_level

Uint32 SDL_GPUColorTargetInfo::mip_level

The mip level to use as a color target.

Definition at line 1687 of file SDL_gpu.h.

◆ padding1

Uint8 SDL_GPUColorTargetInfo::padding1

Definition at line 1697 of file SDL_gpu.h.

◆ padding2

Uint8 SDL_GPUColorTargetInfo::padding2

Definition at line 1698 of file SDL_gpu.h.

◆ resolve_layer

Uint32 SDL_GPUColorTargetInfo::resolve_layer

The layer index of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used.

Definition at line 1694 of file SDL_gpu.h.

◆ resolve_mip_level

Uint32 SDL_GPUColorTargetInfo::resolve_mip_level

The mip level of the resolve texture to use for the resolve operation. Ignored if a RESOLVE* store_op is not used.

Definition at line 1693 of file SDL_gpu.h.

◆ resolve_texture

SDL_GPUTexture* SDL_GPUColorTargetInfo::resolve_texture

The texture that will receive the results of a multisample resolve operation. Ignored if a RESOLVE* store_op is not used.

Definition at line 1692 of file SDL_gpu.h.

◆ store_op

SDL_GPUStoreOp SDL_GPUColorTargetInfo::store_op

What is done with the results of the render pass.

Definition at line 1691 of file SDL_gpu.h.

◆ texture

SDL_GPUTexture* SDL_GPUColorTargetInfo::texture

The texture that will be used as a color target by a render pass.

Definition at line 1686 of file SDL_gpu.h.


The documentation for this struct was generated from the following file: