#[repr(C)]
pub enum TargetEnv {
Show 24 variants Universal_1_0, Vulkan_1_0, Universal_1_1, OpenCL_2_1, OpenCL_2_2, OpenGL_4_0, OpenGL_4_1, OpenGL_4_2, OpenGL_4_3, OpenGL_4_5, Universal_1_2, OpenCL_1_2, OpenCLEmbedded_1_2, OpenCL_2_0, OpenCLEmbedded_2_0, OpenCLEmbedded_2_1, OpenCLEmbedded_2_2, Universal_1_3, Vulkan_1_1, WebGPU_0, Universal_1_4, Vulkan_1_1_Spirv_1_4, Universal_1_5, Vulkan_1_2,
}
Expand description

Certain target environments impose additional restrictions on SPIR-V, so it’s often necessary to specify which one applies. Universal_* implies an environment-agnostic SPIR-V.

When an API method needs to derive a SPIR-V version from a target environment the method will choose the highest version of SPIR-V supported by the target environment. Examples:

   SPV_ENV_VULKAN_1_0           ->  SPIR-V 1.0
   SPV_ENV_VULKAN_1_1           ->  SPIR-V 1.3
   SPV_ENV_VULKAN_1_1_SPIRV_1_4 ->  SPIR-V 1.4
   SPV_ENV_VULKAN_1_2           ->  SPIR-V 1.5

Consult the description of API entry points for specific rules.

Variants§

§

Universal_1_0

SPIR-V 1.0 latest revision, no other restrictions.

§

Vulkan_1_0

Vulkan 1.0 latest revision.

§

Universal_1_1

SPIR-V 1.1 latest revision, no other restrictions.

§

OpenCL_2_1

OpenCL Full Profile 2.1 latest revision.

§

OpenCL_2_2

OpenCL Full Profile 2.2 latest revision.

§

OpenGL_4_0

OpenGL 4.0 plus GL_ARB_gl_spirv, latest revisions.

§

OpenGL_4_1

OpenGL 4.1 plus GL_ARB_gl_spirv, latest revisions.

§

OpenGL_4_2

OpenGL 4.2 plus GL_ARB_gl_spirv, latest revisions.

§

OpenGL_4_3

OpenGL 4.3 plus GL_ARB_gl_spirv, latest revisions.

§

OpenGL_4_5

OpenGL 4.5 plus GL_ARB_gl_spirv, latest revisions.

§

Universal_1_2

SPIR-V 1.2, latest revision, no other restrictions.

§

OpenCL_1_2

OpenCL Full Profile 1.2 plus cl_khr_il_program, latest revision.

§

OpenCLEmbedded_1_2

OpenCL Embedded Profile 1.2 plus cl_khr_il_program, latest revision.

§

OpenCL_2_0

OpenCL Full Profile 2.0 plus cl_khr_il_program, latest revision.

§

OpenCLEmbedded_2_0

OpenCL Embedded Profile 2.0 plus cl_khr_il_program, latest revision.

§

OpenCLEmbedded_2_1

OpenCL Embedded Profile 2.1 latest revision.

§

OpenCLEmbedded_2_2

OpenCL Embedded Profile 2.2 latest revision.

§

Universal_1_3

SPIR-V 1.3 latest revision, no other restrictions.

§

Vulkan_1_1

Vulkan 1.1 latest revision.

§

WebGPU_0

Work in progress WebGPU 1.0.

§

Universal_1_4

SPIR-V 1.4 latest revision, no other restrictions.

§

Vulkan_1_1_Spirv_1_4

Vulkan 1.1 with VK_KHR_spirv_1_4, i.e. SPIR-V 1.4 binary.

§

Universal_1_5

SPIR-V 1.5 latest revision, no other restrictions.

§

Vulkan_1_2

Vulkan 1.2 latest revision.

Trait Implementations§

source§

impl Clone for TargetEnv

source§

fn clone(&self) -> TargetEnv

Returns a copy 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 TargetEnv

source§

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

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

impl Default for TargetEnv

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Display for TargetEnv

source§

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

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

impl FromStr for TargetEnv

§

type Err = SpirvResult

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl PartialEq<TargetEnv> for TargetEnv

source§

fn eq(&self, other: &TargetEnv) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for TargetEnv

source§

impl StructuralPartialEq for TargetEnv

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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 Twhere T: Clone,

§

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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.