- GPU에서 기록하거나 사용할 자료들
- Texture
- Buffer
- Vertex Buffer
- Index Buffer
- Constant Buffer
- Unorderd Access Buffer (for compute shader)
- 리소스 생성은 CreateCommittedResource()를 통해 설정하고 생성된다.
서술자(Descriptor)
- 하나의 리소스에 대한 정보를 포함하는 자료구조.
- GPU는 서술자를 통해서 실제 자원에 접근한다.
- 종류
- CBV(Constant Buffer View)
- Buffer를 Constant buffer로서 Shader에서 사용하기 위한 자료구조.
- SRV(Shader Resource View)
- Buffer를 Texture로서 Shader에서 사용하기 위한 자료구조.
- UAV(Unordered Access View)
- Buffer를 Compute Shader에서 read/write하기 위한 자료구조.
- 내부적으로 CPU, GPU Memory pair로 구성된다.
- D3D12_CPUDESCRIPTOR_HANDLE
- D3D12_GPUDESCRIPTOR_HANDLE
- Shader에서 값을 읽을때는 GPU 메모리.
- 서술자가 필요한 이유는, GPU 입장에서는 자원들이 단순 메모리 조각이기 때문에, 이를 어떻게 해석하고 활용할지에 대한 정의가 필요하다.
- GPU Shader쪽에서는 리소스를 직접 넘겨받지 않고 서술자를 통해서 접근하고 사용한다.
서술자 힙(Descriptor Heap)
- DirectX에서는 모든 서술자에 대해 테이블을 만드는데, 이 서술자들이 채워져 있는 배열을 서술자 힙 이라고 한다.
- 여러개의 Descriptor를 등록했다면 사용할때는 Offset 방식으로 접근해야 한다.
- 이때 얼마나 Offset을 해야하는지 크기를 알아야 하는데, GetDescriptorHandleIncrementSize() 함수를 통해서 알 수 있다.
- 하나의 렌더링 파이프라인에서 사용될 자원들을 힙에 묶어서 제공할 수 있다.
- 참조
리소스 생성
상태 전이