Skip to main content

Software Design Specification (SDS)

1. Overview

본 문서는 grender 모듈의 소프트웨어 설계를 정의한다.

grender는 Grap 시스템의 렌더링 API 계층을 구성하는 라이브러리이다.
이 모듈은 렌더링 기능의 실제 구현을 포함하지 않으며, 렌더링 장치와 상위 애플리케이션 사이의 인터페이스 및 데이터 구조를 정의한다.

본 문서는 다음 요소의 설계를 기술한다.

  • 렌더링 장치 인터페이스
  • 렌더링 명령 구조
  • 렌더링 리소스 핸들
  • 열거형 타입
  • 공통 유틸리티

2. Design Goals

grender 모듈의 설계 목표는 다음과 같다.

GoalDescription
API Layer렌더링 장치 인터페이스 제공
Backend Agnostic특정 렌더링 구현에 의존하지 않음
Type Safety리소스 식별을 위한 타입 기반 핸들 제공
Modular Design모듈 기반 구조 유지
Lightweight최소 의존성 유지

3. Architectural Role

grender는 Grap 시스템에서 렌더링 API 계층을 담당한다.

해당 모듈은 다음 계층 사이에 위치한다.

Application Layer


grender
(Render API Layer)


Rendering Backend

상위 계층은 grender API를 통해 렌더링 명령을 전달하며,
실제 렌더링 처리는 렌더링 장치 구현에서 수행된다.


4. Module Structure

현재 코드 기준 grender 모듈의 구조는 다음과 같다.

grender/
├─ common/
│ ├─ config.hpp
│ ├─ result.hpp
│ └─ assert.hpp

├─ id/
│ ├─ ids.hpp
│ └─ handle.hpp

├─ enums/
│ ├─ primitive.hpp
│ ├─ format.hpp
│ └─ flags.hpp

├─ types/
│ ├─ frame_desc.hpp
│ ├─ draw_cmd.hpp
│ ├─ vertex_format.hpp
│ └─ resource_desc.hpp

├─ device/
│ └─ render_device.hpp

├─ grender.hpp
└─ tests/
└─ smoke.cpp

각 디렉토리는 특정 설계 영역을 담당한다.

ModuleResponsibility
common공통 유틸리티 및 결과 타입
id리소스 식별 핸들 타입
enums렌더링 관련 열거형
types렌더링 데이터 구조
device렌더링 장치 인터페이스
tests기본 API 검증 테스트

5. Public API Entry Point

grender 라이브러리의 공개 API는 다음 헤더를 통해 접근된다.

#include "grender/grender.hpp"

해당 헤더는 다음 모듈을 포함한다.

common
id
enums
types
device

이 헤더는 grender 라이브러리의 단일 진입점(umbrella header) 역할을 수행한다.


6. Core Design Components

grender 모듈은 다음 주요 설계 요소로 구성된다.

ComponentDescription
Result함수 결과 상태 표현
Handle Types렌더링 리소스 식별
Enumerations렌더링 관련 상수
FrameDesc프레임 설정 데이터
DrawCmd렌더 명령
IRenderDevice렌더링 장치 인터페이스

이 구성 요소들은 렌더링 API의 기본 구조를 형성한다.


7. Rendering Command Model

grender는 **명령 기반 렌더링 모델(command-based rendering model)**을 사용한다.

렌더링 흐름은 다음 단계로 구성된다.

begin_frame()

draw()

end_frame()

present()

렌더 명령은 DrawCmd 구조체를 통해 전달된다.


8. Rendering Device Abstraction

렌더링 장치는 IRenderDevice 인터페이스를 통해 추상화된다.

렌더링 구현은 해당 인터페이스를 구현해야 한다.

struct IRenderDevice

이 인터페이스는 렌더링 장치의 기본 동작을 정의한다.

  • init
  • shutdown
  • resize
  • begin_frame
  • draw
  • end_frame
  • present

9. Data Model

grender는 렌더링 데이터를 표현하기 위해 다음 구조체를 사용한다.

TypeDescription
FrameDesc프레임 설정
DrawCmd렌더 명령
VertexFormat정점 데이터 형식
ResourceDesc리소스 설명

이 구조체들은 렌더링 API 호출 시 사용된다.


10. Handle System

렌더링 리소스는 핸들 기반 식별 시스템을 사용한다.

핸들은 다음 리소스를 식별한다.

HandleResource
VertexBufferHandleVertex Buffer
IndexBufferHandleIndex Buffer
TextureHandleTexture
PipelineHandlePipeline

핸들은 리소스 메모리를 직접 관리하지 않으며 식별자 역할만 수행한다.


11. Validation

기본 API 검증은 다음 테스트에서 수행된다.

tests/smoke.cpp

테스트는 다음 항목을 확인한다.

  • API version 접근
  • FrameDesc 기본 값
  • DrawCmd validation
  • Handle validation
  • PrimitiveType enum
  • Result helper functions

12. Design Constraints

grender 모듈은 다음 설계 제약을 가진다.

ConstraintDescription
No rendering implementation렌더링 구현을 포함하지 않음
API only인터페이스 및 타입만 정의
Header based공개 API는 헤더 기반
Backend independent특정 렌더링 구현에 의존하지 않음

13. Dependencies

현재 코드 기준 grender 모듈은 다음 타입에 의존한다.

DependencyUsage
ghost::Window렌더링 장치 초기화
FrameDesc프레임 정보
DrawCmd렌더 명령

14. Verification Strategy

기본 API 검증은 smoke test를 통해 수행된다.

테스트 파일

tests/smoke.cpp

테스트 목적

  • API 접근 가능 여부 확인
  • 기본 타입 동작 확인
  • 기본 헬퍼 함수 검증