• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation
 

[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation

on

  • 1,405 views

 

Statistics

Views

Total Views
1,405
Views on SlideShare
1,405
Embed Views
0

Actions

Likes
0
Downloads
15
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    [shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation	[shaderx7] 8.1 Cross-Platform Rendering Thread : Design and Implementation Presentation Transcript

    • ShaderX7 8.1 Cross-Platform Rendering Thread : Design and Implementation shader study http://cafe.naver.com/shader ohyecloudy http://ohyecloudy.com
    • • Motivation • Overview • Implementation • Going Further • Conclusion
    • • 프로세서 코어 퍼포먼스는 향상 – 하지만 CPU bottleneck 해결은 여전히 문제 • GPU 퍼포먼스는 향상 – 플랫폼 그래픽스 API 호출에 여전히 CPU 파워가 필요.
    • • 렌더링 작업을 decoupling. – CPU bottleneck 최소화 – GPU 퍼포먼스 낭비를 최소화
    • • Motivation • Overview • Implementation • Going Further • Conclusion
    • Threading Design Game Thread Game Client DRIVER Command Buffer Server Server API (OpenGL, DirectX, ...) Thread Server-Client Model
    • Abstraction Design • platform-specific 구현을 숨김 • rendering pipeline stage 전체를 커버
    • Command Objects • client side – 실제 동작은 없음. request 역할. • server side 1. server-API 를 사용하는 오브젝트로 빌드. 2. command가 예약된 만큼 실행 • 재생성 필요 없음
    • Command Buffer • client와 server를 연결 – client, server는 각 쓰레드가 돌고 있음. • multi-threading issue가 발생하는 곳
    • State Machine • state cache – rendering pipeline 추상화 • binding – render target state – camera state – light state – material state – transform state – ...
    • Macro State Objects • one-to-many 관계 – client state와 server state • client state – RenderTarget • server state – clear information and operation (color, flags, ...) – render buffer characteristics (size, ...) – post-effects parameters and execution (blur,...)
    • Driver Execution Process Game Client State Command Server Platform Engine Cache Buffer Graphics API DirectX Bind Queue State OpenGL Swap PS3 Build & XDK Dispatch Queue ... Command Queue
    • • Motivation • Overview • Implementation • Going Further • Conclusion
    • Driver Objects Pattern <<interface>> <<interface>> Client Command Server Command <<interface>> Command +Queue() +Build = 0() +Dispatch = 0() +Queue() +Build = 0() +Dispatch = 0() Client Draw Command Server Draw Command <<interface>> Client Draw Command +SetColor() <<interface>> Command Data Server Draw Command +Build() +Dispatch() Draw Command Data +SetColor() A B
    • Driver Objects Pattern • one-to-one X <<interface>> <<interface>> • client code Client Command Server Command +Queue() +Build = 0() +Dispatch = 0() • server code Client Draw Command Server Draw Command • lifetime이 client, server <<interface>> Command Data 분리 Draw Command Data +SetColor()
    • Three Command Objects • client command – queuing – lifetime management • command data – server code 실행에 인자로 사용 • server command – platform graphics API-specific code
    • synchronization : command buffer • double buffering – client가 하나를 채우는 동안 – server는 하나를 실행하고 비움 • synchronization points – client frame end – server frame end
    • Thread Safety : Command Data Sharing Policy • command data에 접근 – client, server 둘 다 – 퍼포먼스가 중요 – thread safe를 보장하지 않음 • 수정이 필요하면 재생성 • refcount > 0 – 수정하려면 재생성.
    • Thread Safety : Command Locking Strategy // RAII Object sxCScopeLocker oLock(rCommand); sxCCommandData& rCommandData = oLock.GetData(); if (TestSomething()) { return; }
    • • Motivation • Overview • Implementation • Going Further • Conclusion
    • Optimization : Triple Buffering Client Buffer 2 Buffer 1 Buffer 3 Buffer 1 Server Buffer 3 Buffer 2 Buffer 3
    • Command Buffer Serialization-Based • 전체 rendering command sequence 저장 • debugging에 유용하게 사용할 수 있다.
    • • Motivation • Overview • Implementation • Going Further • Conclusion
    • • wait-free rendering thread 구현 • one-to-many 관계 – client, server state • client-server 접근으로 decoupling – platform 종속적인 코드는 server에만