<p>You have to use the appropriate register type for the resource: <code>b</code> registers for constant buffers, <code>t</code> for textures, and <code>u</code> for UAVs. AFAIK, it is not possible to bind a UAV to a texture slot, or otherwise mismatch registers and resources.</p>

<p>However, a resource can have multiple views, so it is possible to have a resource bound as a UAV in one shader and as a regular texture (SRV) in another, which enables all the usual GPU texture sampling features to be used in the latter case.</p>

<p>The details of how the DirectX API concepts of slots, registers, and resources map to the actual hardware are vendor-specific. On one GPU they may literally represent registers of some kind, while on another they may represent a small chunk of metadata in memory somewhere, which describes the resource to the hardware.</p>

CC BY-SA 3.0
2016-06-01T18:01:26.300Z
2016-06-01T18:01:26.300Z
Nathan Reed
<p>Is there any difference between registers types in hlsl?</p>

<p>For example when using register <code>t0</code> for <code>UAV</code> will it be somehow precache like textures?</p>

<p>According to microsoft's presentation about resource in DX12 and hlsl 5.1 this registers mean nothing, but maybe they only mean that there isn't any real registers like on CPU?</p>

CC BY-SA 3.0
2016-05-31T23:04:07.060Z
No. Constant buffers are just a chunk of memory. The DX spec and hlsl spec define the different types.
RichieSams
<gpu><hlsl><directx12>
Hlsl - registers type
Derag
# Hlsl - registers type

(Asked by: username_0 on 2016-05-31)

Is there any difference between registers types in hlsl?

For example when using register `t0` for `UAV` will it be somehow precache like textures?

According to microsoft's presentation about resource in DX12 and hlsl 5.1 this registers mean nothing, but maybe they only mean that there isn't any real registers like on CPU?

**Tags:** gpu, hlsl, directx12

> **Comments:**
> **username_1**: No. Constant buffers are just a chunk of memory. The DX spec and hlsl spec define the different types.  

---

## 1 answers

### Answer by username_2 on 2016-06-01. Score: 3 | Accepted answer

You have to use the appropriate register type for the resource: `b` registers for constant buffers, `t` for textures, and `u` for UAVs. AFAIK, it is not possible to bind a UAV to a texture slot, or otherwise mismatch registers and resources.

However, a resource can have multiple views, so it is possible to have a resource bound as a UAV in one shader and as a regular texture (SRV) in another, which enables all the usual GPU texture sampling features to be used in the latter case.

The details of how the DirectX API concepts of slots, registers, and resources map to the actual hardware are vendor-specific. On one GPU they may literally represent registers of some kind, while on another they may represent a small chunk of metadata in memory somewhere, which describes the resource to the hardware.


---

