Skip to main content
Describes a shader-resource view (SRV).

Syntax

Members

Format
Type: DXGI_FORMAT
A DXGI_FORMAT-typed value that specifies the viewing format. See remarks. ViewDimension
Type: D3D12_SRV_DIMENSION
A D3D12_SRV_DIMENSION-typed value that specifies the resource type of the view. This type is the same as the resource type of the underlying resource. This member also determines which _SRV to use in the union below. Shader4ComponentMapping
Type: UINT
A value, constructed using the D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING macro. The D3D12_SHADER_COMPONENT_MAPPING enumeration specifies what values from memory should be returned when the texture is accessed in a shader via this shader resource view (SRV). For example, it can route component 1 (green) from memory, or the constant 0, into component 2 (.b) of the value given to the shader. Buffer
Type: D3D12_BUFFER_SRV
A D3D12_BUFFER_SRV structure that views the resource as a buffer. Texture1D
Type: D3D12_TEX1D_SRV
A D3D12_TEX1D_SRV structure that views the resource as a 1D texture. Texture1DArray
Type: D3D12_TEX1D_ARRAY_SRV
A D3D12_TEX1D_ARRAY_SRV structure that views the resource as a 1D-texture array. Texture2D
Type: D3D12_TEX2D_SRV
A D3D12_TEX2D_SRV structure that views the resource as a 2D-texture. Texture2DArray
Type: D3D12_TEX2D_ARRAY_SRV
A D3D12_TEX2D_ARRAY_SRV structure that views the resource as a 2D-texture array. Texture2DMS
Type: D3D12_TEX2DMS_SRV
A D3D12_TEX2DMS_SRV structure that views the resource as a 2D-multisampled texture. Texture2DMSArray
Type: D3D12_TEX2DMS_ARRAY_SRV
A D3D12_TEX2DMS_ARRAY_SRV structure that views the resource as a 2D-multisampled-texture array. Texture3D
Type: D3D12_TEX3D_SRV
A D3D12_TEX3D_SRV structure that views the resource as a 3D texture. TextureCube
Type: D3D12_TEXCUBE_SRV
A D3D12_TEXCUBE_SRV structure that views the resource as a 3D-cube texture. TextureCubeArray
Type: D3D12_TEXCUBE_ARRAY_SRV
A D3D12_TEXCUBE_ARRAY_SRV structure that views the resource as a 3D-cube-texture array. RaytracingAccelerationStructure
A D3D12_RAYTRACING_ACCELERATION_STRUCTURE_SRV structure that views the resource as a raytracing acceleration structure.

Remarks

A view is a format-specific way to look at the data in a resource. The view determines what data to look at, and how it is cast when read. When viewing a resource, the resource-view description must specify a typed format, that is compatible with the resource format. So that means that you can’t create a resource-view description using any format with _TYPELESS in the name. You can however view a typeless resource by specifying a typed format for the view. For example, a DXGI_FORMAT_R32G32B32_TYPELESS resource can be viewed with one of these typed formats: DXGI_FORMAT_R32G32B32_FLOAT, DXGI_FORMAT_R32G32B32_UINT, and DXGI_FORMAT_R32G32B32_SINT, since these typed formats are compatible with the typeless resource. Create a shader-resource-view description by calling ID3D12Device::CreateShaderResourceView.

Requirements

Header: d3d12_xs.h or d3d12_x.h
Library: d3d12_xs.lib or d3d12_x.lib
Supported Platforms: XBOX Series consoles and XBOX One family

See Also

Core structures
Last modified on August 20, 2026