Skip to content

Latest commit

 

History

History
115 lines (67 loc) · 2.2 KB

interlockedexchange.md

File metadata and controls

115 lines (67 loc) · 2.2 KB
title description ms.assetid keywords topic_type api_name api_type ms.topic ms.date api_location
InterlockedExchange function (HLSL reference)
Assigns value to dest and returns the original value.
1e7ce7ff-9e23-47fa-8e76-713f6bf57abf
InterlockedExchange function HLSL
apiref
InterlockedExchange
NA
reference
05/31/2018

InterlockedExchange function (HLSL reference)

Assigns value to dest and returns the original value.

Syntax

void InterlockedExchange(
  in  R dest,
  in  T value,
  out T original_value
);

Parameters

dest [in]

Type: R

The destination address.

value [in]

Type: T

The input value.

original_value [out]

Type: T

The original value.

Return value

This function does not return a value.

Remarks

This operation can only be performed on scalar-typed resources and shared memory variables. There are two possible uses for this function. The first is when R is a shared memory variable type. In this case, the function performs the operation on the shared memory register referenced by dest. The second scenario is when R is a resource variable type. In this scenario, the function performs the operation on the resource location referenced by dest. This operation is only available when R is readable and writable.

Interlocked operations do not imply any memory fence/barrier.

Minimum Shader Model

This function is supported in the following shader models.

Shader Model Supported
Shader Model 5 and higher shader models yes

 

This function is supported in the following types of shaders:

Vertex Hull Domain Geometry Pixel Compute
x x x x x x

 

See also

Intrinsic Functions

Shader Model 5