|
2 | 2 | description: "Learn more about: Graphics (C++ AMP)" |
3 | 3 | title: "Graphics (C++ AMP)" |
4 | 4 | ms.date: "11/04/2016" |
5 | | -ms.assetid: 190a98a4-5f7d-442e-866b-b374ca74c16f |
6 | 5 | --- |
7 | 6 | # Graphics (C++ AMP) |
8 | 7 |
|
9 | | -C++ AMP contains several APIs in the [Concurrency::graphics](../../parallel/amp/reference/concurrency-graphics-namespace.md) namespace that you can use to access the texture support on GPUs. Some common scenarios are: |
| 8 | +C++ AMP contains several APIs in the [`Concurrency::graphics`](../../parallel/amp/reference/concurrency-graphics-namespace.md) namespace that you can use to access the texture support on GPUs. Some common scenarios are: |
10 | 9 |
|
11 | | -- You can use the [texture](../../parallel/amp/reference/texture-class.md) class as a data container for computation and exploit the *spatial locality* of the texture cache and layouts of GPU hardware. Spatial locality is the property of data elements being physically close to each other. |
| 10 | +- You can use the [`texture`](../../parallel/amp/reference/texture-class.md) class as a data container for computation and exploit the *spatial locality* of the texture cache and layouts of GPU hardware. Spatial locality is the property of data elements being physically close to each other. |
12 | 11 |
|
13 | 12 | - The runtime provides efficient interoperability with non-compute shaders. Pixel, vertex, tessellation, and hull shaders frequently consume or produce textures that you can use in your C++ AMP computations. |
14 | 13 |
|
15 | 14 | - The graphics APIs in C++ AMP provide alternative ways to access sub-word packed buffers. Textures that have formats that represent *texels* (texture elements) that are composed of 8-bit or 16-bit scalars allow access to such packed data storage. |
16 | 15 |
|
| 16 | +> [!NOTE] |
| 17 | +> C++ AMP headers are deprecated starting with Visual Studio 2022 version 17.0. |
| 18 | +> Including any AMP headers will generate build errors. Define `_SILENCE_AMP_DEPRECATION_WARNINGS` before including any AMP headers to silence the warnings. |
| 19 | +
|
17 | 20 | ## The norm and unorm Types |
18 | 21 |
|
19 | 22 | The `norm` and `unorm` types are scalar types that limit the range of **`float`** values; this is known as *clamping*. These types can be explicitly constructed from other scalar types. In casting, the value is first cast to **`float`** and then clamped to the respective region that's allowed by `norm [-1.0, 1.0]` or `unorm [0.0, 1.0]`. Casting from +/- infinity returns +/-1. Casting from NaN is undefined. A `norm` can be implicitly constructed from a `unorm` and there is no loss of data. The implicit conversion operator to **`float`** is defined on these types. Binary operators are defined between these types and other built-in scalar types such as **`float`** and **`int`**: `+`, `-`, `*`, `/`, `==`, `!=`, `>`, `<`, `>=`, `<=`. The compound assignment operators are also supported: `+=`, `-=`, `*=`, `/=`. The unary negation operator (`-`) is defined for `norm` types. |
@@ -56,7 +59,7 @@ The Short Vector Library supports the `vector_type.identifier` accessor construc |
56 | 59 |
|
57 | 60 | ## Texture Classes |
58 | 61 |
|
59 | | -Many GPUs have hardware and caches that are optimized to fetch pixels and texels and to render images and textures. The [texture\<T,N>](../../parallel/amp/reference/texture-class.md) class, which is a container class for texel objects, exposes the texture functionality of these GPUs. A texel can be: |
| 62 | +Many GPUs have hardware and caches that are optimized to fetch pixels and texels and to render images and textures. The [`texture<T,N>`](../../parallel/amp/reference/texture-class.md) class, which is a container class for texel objects, exposes the texture functionality of these GPUs. A texel can be: |
60 | 63 |
|
61 | 64 | - An **`int`**, `uint`, **`float`**, **`double`**, `norm`, or `unorm` scalar. |
62 | 65 |
|
|
0 commit comments