SDL_GPUColorTargetInfo

Struct SDL_GPUColorTargetInfo 

Source
#[repr(C)]
pub struct SDL_GPUColorTargetInfo {
Show 13 fields pub texture: *mut SDL_GPUTexture, pub mip_level: Uint32, pub layer_or_depth_plane: Uint32, pub clear_color: SDL_FColor, pub load_op: SDL_GPULoadOp, pub store_op: SDL_GPUStoreOp, pub resolve_texture: *mut SDL_GPUTexture, pub resolve_mip_level: Uint32, pub resolve_layer: Uint32, pub cycle: bool, pub cycle_resolve_texture: bool, pub padding1: Uint8, pub padding2: Uint8,
}
Expand 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.

§Availability

This struct is available since SDL 3.2.0.

§See also

§Notes for sdl3-sys

This struct has padding fields which shouldn’t be accessed directly; use struct update syntax with e.g. ..Default::default() for manual construction.

Fields§

§texture: *mut SDL_GPUTexture

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

§mip_level: Uint32

The mip level to use as a color target.

§layer_or_depth_plane: Uint32

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.

§clear_color: SDL_FColor

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

§load_op: SDL_GPULoadOp

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

§store_op: SDL_GPUStoreOp

What is done with the results of the render pass.

§resolve_texture: *mut SDL_GPUTexture

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

§resolve_mip_level: Uint32

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

§resolve_layer: Uint32

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

§cycle: bool

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

§cycle_resolve_texture: bool

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

§padding1: Uint8
👎Deprecated: padding fields are exempt from semver; init with ..Default::default()
§padding2: Uint8
👎Deprecated: padding fields are exempt from semver; init with ..Default::default()

Trait Implementations§

Source§

impl Clone for SDL_GPUColorTargetInfo

Source§

fn clone(&self) -> SDL_GPUColorTargetInfo

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SDL_GPUColorTargetInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SDL_GPUColorTargetInfo

Source§

fn default() -> Self

Initialize all fields to zero

Source§

impl Copy for SDL_GPUColorTargetInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.