> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# ReadFromSubresource

> CPU를 사용하여 하위 리소스에서 데이터를 복사하여, CPU가 정의되지 않은 레이아웃을 가진 대부분의 텍스처의 콘텐츠를 읽을 수 있도록 합니다.

CPU를 사용하여 하위 리소스에서 데이터를 복사하여, CPU가 정의되지 않은 레이아웃을 가진 대부분의 텍스처의 콘텐츠를 읽을 수 있도록 합니다.

## 구문

```cpp theme={null}
HRESULT ReadFromSubresource(
    void  pDstData,
    UINT DstRowPitch,
    UINT DstDepthPitch,
    UINT SrcSubresource,
    const D3D12_BOX  pSrcBox
)
```

### 매개 변수

*pDstData \[out]*\
형식: void \*

메모리의 대상 데이터에 대한 포인터입니다.

*DstRowPitch*\
형식: UINT

대상 데이터의 한 행에서 다음 행까지의 거리입니다.

*DstDepthPitch*\
형식: UINT

대상 데이터의 한 깊이 슬라이스에서 다음 슬라이스까지의 거리입니다.

*SrcSubresource*\
형식: UINT

읽을 하위 리소스의 인덱스를 지정합니다.

*pSrcBox \[in, optional]*\
형식: const D3D12\_BOX \*

리소스 데이터를 복사할 대상 하위 리소스의 부분을 정의하는 상자에 대한 포인터입니다.
NULL이면 오프셋 없이 대상 하위 리소스에서 데이터를 읽습니다.
대상의 크기는 대상에 맞아야 합니다([D3D12\_BOX](/reference/graphics/d3d12/structs/d3d12_box_public) 참조).

빈 상자는 no-op을 초래합니다.
top 값이 bottom 값보다 크거나 같거나, left 값이 right 값보다 크거나 같거나, front 값이 back 값보다 크거나 같으면 상자는 비어 있습니다.
상자가 비어 있으면 이 메서드는 아무 작업도 수행하지 않습니다.

### 반환 값

형식: HRESULT

이 메서드는 [Direct3D 12 반환 코드](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/d3d12-graphics-reference-returnvalues) 중 하나를 반환합니다.

## 설명

[WriteToSubresource](/reference/graphics/d3d12/interfaces/id3d12resource/methods/id3d12resource_writetosubresource_public)의 설명 섹션을 참조하세요.

## 요구 사항

**헤더:** d3d12\_xs.h 또는 d3d12\_x.h\
**라이브러리:** d3d12\_xs.lib 또는 d3d12\_x.lib\
**지원 플랫폼**: XBOX Series 콘솔 및 XBOX One 제품군

## 함께 보기

[ID3D12Resource](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)

[하위 리소스](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/subresources)


## Related topics

- [D3D12_BOX](/ko/reference/graphics/d3d12/structs/d3d12_box_public.md)
- [ResolveSubresourceRegion](/ko/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist1/methods/id3d12graphicscommandlist1_resolvesubresourceregion_public.md)
- [D3D12_SUBRESOURCE_DATA](/ko/reference/graphics/d3d12/structs/d3d12_subresource_data_public.md)
- [D3D12_SUBRESOURCE_INFO](/ko/reference/graphics/d3d12/structs/d3d12_subresource_info_public.md)
- [D3D12_SUBRESOURCE_TILING](/ko/reference/graphics/d3d12/structs/d3d12_subresource_tiling_public.md)
