Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ID3D10Device::CreateShaderResourceView method

Create a shader-resource view for accessing data in a resource.

Syntax


HRESULT CreateShaderResourceView(
  [in]        ID3D10Resource                  *pResource,
  [in]  const D3D10_SHADER_RESOURCE_VIEW_DESC *pDesc,
  [out]       ID3D10ShaderResourceView        **ppSRView
);

Parameters

pResource [in]

Type: ID3D10Resource*

Pointer to the resource that will serve as input to a shader. This resource must have been created with the D3D10_BIND_SHADER_RESOURCE flag.

pDesc [in]

Type: const D3D10_SHADER_RESOURCE_VIEW_DESC*

Pointer to a shader-resource-view description (see D3D10_SHADER_RESOURCE_VIEW_DESC). Set this parameter to NULL to create a view that accesses the entire resource (using the format the resource was created with).

ppSRView [out]

Type: ID3D10ShaderResourceView**

Address of a pointer to an ID3D10ShaderResourceView. Set this parameter to NULL to validate the other input parameters (the method will return S_FALSE if the other input parameters pass validation).

Return value

Type: HRESULT

This method returns one of the following Direct3D 10 Return Codes.

Remarks

A resource is made up of one or more subresources, a view identifies which subresources to allow the pipeline to access. In addition, each resource is bound to the pipeline using a view. A shader-resource view is designed to bind any buffer or texture resource to the shader stages using the following API methods: VSSetShaderResources, GSSetShaderResources and PSSetShaderResources.

Since a view is fully typed, this means that typeless resources become fully typed when bound to the pipeline.

Requirements

Header

D3D10.h

Library

D3D10.lib

See also

ID3D10Device Interface

 

 

Show:
© 2017 Microsoft