> ## 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.

# GetCopyableFootprints

> 복사할 수 있는 리소스 레이아웃을 가져옵니다. 공간을 하위 할당할 때 앱이 D3D12_PLACED_SUBRESOURCE_FOOTPRINT 및 D3D12_SUBRESOURCE_FOOTPRINT를 채우는 데 도움이 됩니다.

복사할 수 있는 리소스 레이아웃을 가져옵니다.
업로드 힙에서 공간을 하위 할당할 때 앱이
[D3D12\_PLACED\_SUBRESOURCE\_FOOTPRINT](/reference/graphics/d3d12/structs/d3d12_placed_subresource_footprint_public) 및
[D3D12\_SUBRESOURCE\_FOOTPRINT](/reference/graphics/d3d12/structs/d3d12_subresource_footprint_public)를 채우는 데 도움이 됩니다.

## 구문

```cpp theme={null}
void GetCopyableFootprints(
    const D3D12_RESOURCE_DESC  pResourceDesc,
    UINT FirstSubresource,
    UINT NumSubresources,
    UINT64 BaseOffset,
    D3D12_PLACED_SUBRESOURCE_FOOTPRINT  pLayouts,
    UINT  pNumRows,
    UINT64  pRowSizeInBytes,
    UINT64  pTotalBytes
)
```

### 매개 변수

*pResourceDesc \[in]*\
형식: const D3D12\_RESOURCE\_DESC \*

리소스에 대한 설명으로, [D3D12\_RESOURCE\_DESC](/reference/graphics/d3d12/structs/d3d12_resource_desc_public) 구조체에 대한 포인터입니다.

*FirstSubresource \[in]*\
형식: UINT

리소스에서 첫 번째 하위 리소스의 인덱스입니다.
유효한 값의 범위는 0에서 D3D12\_REQ\_SUBRESOURCES까지입니다.

*NumSubresources \[in]*\
형식: UINT

리소스의 하위 리소스 수입니다. 유효한 값의 범위는 0에서 (D3D12\_REQ\_SUBRESOURCES - <i>FirstSubresource</i>)까지입니다.

*BaseOffset*\
형식: UINT64

리소스에 대한 오프셋(바이트 단위)입니다.

*pLayouts \[out, optional]*\
형식: D3D12\_PLACED\_SUBRESOURCE\_FOOTPRINT \*

각 하위 리소스의 설명과 배치로 채워질 <i>NumSubresources</i> 길이의
[D3D12\_PLACED\_SUBRESOURCE\_FOOTPRINT](/reference/graphics/d3d12/structs/d3d12_placed_subresource_footprint_public) 구조체 배열에 대한 포인터입니다.

*pNumRows \[out, optional]*\
형식: UINT \*

각 하위 리소스의 행 수로 채워질 <i>NumSubresources</i> 길이의 정수 변수 배열에 대한 포인터입니다.

*pRowSizeInBytes \[out, optional]*\
형식: UINT64 \*

각 항목이 각 하위 리소스의 행에 대한 패딩되지 않은 바이트 크기로 채워질 <i>NumSubresources</i> 길이의 정수 변수 배열에 대한 포인터입니다.

예를 들어 Texture2D 리소스의 너비가 32이고 픽셀당 바이트가 4인 경우,

<i>pRowSizeInBytes</i>는 128을 반환합니다.

<i>pRowSizeInBytes</i>는 \*\*행 피치(row pitch)\*\*와 혼동해서는 안 됩니다. <i>pLayouts</i>를 검사하고 여기서 행 피치를 얻으면 256을 얻게 되는데, 이는 D3D12\_TEXTURE\_DATA\_PITCH\_ALIGNMENT에 맞춰 정렬되기 때문입니다.

*pTotalBytes \[out, optional]*\
형식: UINT64 \*

총 크기(바이트 단위)로 채워질 정수 변수에 대한 포인터입니다.

### 반환 값

형식: void

없음.

## 설명

이 루틴은 업로드 힙에서 공간을 하위 할당할 때 애플리케이션이
[D3D12\_PLACED\_SUBRESOURCE\_FOOTPRINT](/reference/graphics/d3d12/structs/d3d12_placed_subresource_footprint_public) 및
[D3D12\_SUBRESOURCE\_FOOTPRINT](/reference/graphics/d3d12/structs/d3d12_subresource_footprint_public) 구조체를 채우는 것을 지원합니다.
결과 구조체는 GPU 어댑터와 무관하므로, 한 GPU 어댑터에서 다음 어댑터로 값이 변경되지 않습니다.
**GetCopyableFootprints**는 리소스 형식, 텍스처 레이아웃 및 정렬 요구 사항(즉, [D3D12\_RESOURCE\_DESC](/reference/graphics/d3d12/structs/d3d12_resource_desc_public) 구조체의 정보)에 대한 지정된 세부 정보를 사용하여 하위 리소스 구조체를 채웁니다.
애플리케이션은 이러한 모든 세부 정보에 액세스할 수 있으므로, 이 메서드 또는 그 변형은 앱의 일부로 작성할 수 있습니다.

#### 예제

[D3D12Multithreading](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/working-samples) 샘플은 다음과 같이 **ID3D12Device::GetCopyableFootprints**를 사용합니다:

```cpp theme={null}
// Returns required size of a buffer to be used for data upload
inline UINT64 GetRequiredIntermediateSize(
_In_ ID3D12Resource* pDestinationResource,
_In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
_In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources)
{
D3D12_RESOURCE_DESC Desc = pDestinationResource->GetDesc();
UINT64 RequiredSize = 0;

ID3D12Device* pDevice;
pDestinationResource->GetDevice(__uuidof(*pDevice), reinterpret_cast<void**>(&pDevice));
pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize);
pDevice->Release();

return RequiredSize;
}

```

[D3D12 참조의 예제 코드](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/notes-on-example-code)를 참조하세요.

<div class="code" />

## 요구 사항

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

## 함께 보기

[CD3DX12\_RESOURCE\_DESC](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/cd3dx12-resource-desc)

[CD3DX12\_SUBRESOURCE\_FOOTPRINT](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/cd3dx12-subresource-footprint)

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)


## Related topics

- [D3D12_PLACED_SUBRESOURCE_FOOTPRINT](/ko/reference/graphics/d3d12/structs/d3d12_placed_subresource_footprint_public.md)
- [D3D12_SUBRESOURCE_FOOTPRINT](/ko/reference/graphics/d3d12/structs/d3d12_subresource_footprint_public.md)
- [D3D12_TEXTURE_COPY_TYPE](/ko/reference/graphics/d3d12/enums/d3d12_texture_copy_type_public.md)
- [D3D12_TEXTURE_COPY_LOCATION](/ko/reference/graphics/d3d12/structs/d3d12_texture_copy_location_public.md)
- [GetPMCValue](/ko/reference/tools/pix3/functions/getpmcvalue.md)
