帳號:guest(18.224.70.204)          離開系統
字體大小: 字級放大   字級縮小   預設字形  

詳目顯示

以作者查詢圖書館館藏以作者查詢臺灣博碩士論文系統以作者查詢全國書目
作者(中文):郭力維
論文名稱(中文):案例研究: LLVM圖形著色語言編譯器設計
論文名稱(外文):Case Study: LLVM-based Shader Compiler Design
指導教授(中文):李政崑
口試委員(中文):黃冠寰
曾紹崟
學位類別:碩士
校院名稱:國立清華大學
系所名稱:資訊工程學系
學號:101062536
出版年(民國):103
畢業學年度:102
語文別:英文中文
論文頁數:32
中文關鍵詞:行動裝置 GPU著色編譯器
外文關鍵詞:LLVMOpenGL-ES
相關次數:
  • 推薦推薦:0
  • 點閱點閱:470
  • 評分評分:*****
  • 下載下載:0
  • 收藏收藏:0
隨著手持裝置逐漸普及化,使得應用程式被廣泛的使用。為了維持應用程式的
效能,近年來大多數手持裝置開發人員開始使用圖形處理器(GPU)作為硬體加
速器。因此,圖形處理器開始成為智慧型手持裝置的基本配備要求。隨著圖形處理
器開發技術的提高,透過使用 DirectX、OpenGL 提出的著色語言,渲染管線已成
為可程式化的硬體元件。為了將著色語言編譯成圖形處理器組合語言以運行渲染管
線,著色語言編譯器是不可或缺的。然而渲染管線的技術提升提供了一個挑戰與機
會,來證明是否著色語言編譯器可以有效的實作在一般編譯器的基礎架構上,像是
LLVM - 一個提供任意程式語言不同編譯階段優化的開放源碼編譯器基礎架構。
在這篇論文中,我們的案例研究過程描述如何為工業技術研究院團隊設計的全
新圖形處理器實作 OpenGL-ES 2.0 著色語言編譯器。使用的編譯器是基於 LLVM
和 OpenGL framework Mesa。我們使用 Mesa 作為編譯器前端將 OpenGL-ES 2.0
著色語言轉換成 TGSI 格式的中介碼,而 Mesa 的 Gallium3D 驅動元件 framework
會將 TGSI 轉為 LLVM bitcode 中介碼。最後,我們使用 LLVM 作為編譯器後端將
LLVM bitcode 編譯成 NV_gpu_program4 的組合語言。在我們初步的實驗結果,
我們使用工業技術研究院提供的圖形處理器模擬器與 GLES 測試程式作為測試環
境,並顯示我們基於 LLVM 著色語言編譯器能夠可靠的編譯 OpenGL-ES 2.0 程式
碼。
Contents
Abstract i
Contents iii
List of Figures v
List of Tables vi
1 Introduction 1
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Overview of the Thesis . . . . . . . . . . . . . . . . . . . . . . 3
2 Background 5
2.1 3D Graphics Pipeline . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 Shader Program . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3 Gallium3D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
2.4 Low Level Virtual Machine (LLVM) . . . . . . . . . . . . . . . 11
3 GPU Design 14
3.1 Tile Based Deferred Rendering (TBDR) . . . . . . . . . . . . 15
3.2 Unified Shader . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4 GLSL ES Support In LLVM 18
4.1 Front-End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.1.1 Shader Variable Parsing . . . . . . . . . . . . . . . . . 19
4.1.2 Built-In Language Variables . . . . . . . . . . . . . . . 20
4.2 Back-End . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
4.2.1 Explicit Program Parameters . . . . . . . . . . . . . . 20
4.2.2 Vector and Swizzling Function . . . . . . . . . . . . . . 22
4.2.3 LLVM Transform Passes . . . . . . . . . . . . . . . . . 22
4.2.4 Register Allocation . . . . . . . . . . . . . . . . . . . . 23
5 Experiment Results 25
5.1 Experiment Environment . . . . . . . . . . . . . . . . . . . . . 25
5.2 Experiment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
6 Conclusion 28
6.1 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
6.2 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
[1] AMD Corporation. A Detailed Look at the R600 Backend - LLVM,
Nov 2013. Website. Online available at http://llvm.org/devmtg/2013-11/slides/Stellard-R600.pdf.
[2] Everitt, C. Opengl arb vertex program. NVIDIA Corporation (2003).
[3] Gray, K. Microsoft DirectX 9 programmable graphics pipeline. Microsoft Pr, 2003.
[4] Kessenich, J., Baldwin, D., and Rost, R. The opengl shading
language. Language version 1 (2004).
[5] Lattner, C., and Adve, V. The llvm instruction set and compilation
strategy. CS Dept., Univ. of Illinois at Urbana-Champaign, Tech. Report
UIUCDCS (2002).
[6] Lattner, C., and Adve, V. Llvm: A compilation framework for
lifelong program analysis & transformation. In Code Generation and
Optimization, 2004. CGO 2004. International Symposium on (2004),
IEEE, pp. 75–86.
[7] Lattner, C. A. LLVM: An infrastructure for multi-stage optimization.
PhD thesis, University of Illinois, 2002.
[8] Luebke, D., and Humphreys, G. How gpus work. IEEE Computer
40, 2 (2007), 96–100.
[9] LunarGLASS. An open modular shader compiler architecture. Website. Online available at http://www.lunarglass.org/.
[10] Mark, W. R., Glanville, R. S., Akeley, K., and Kilgard,
M. J. Cg: a system for programming graphics hardware in a c-like
language. In ACM Transactions on Graphics (TOG) (2003), vol. 22,
ACM, pp. 896–907.
[11] Mesa3D, M. 3d graphics library, release 7.0. 3 notes, 2008.
[12] Munshi, A. Opengl es common profile specification 2.0. Khronos group September (2007).
[13] Nvidia, C. Cg toolkit user’s manual: A developer’s guide to programmable graphics. Nvidia Corporation (2003).
[14] NVIDIA Corporation. OpenGL fragment profile for the
OpenGL Shading Language, GLSL. Website. Online available at
http://http.developer.nvidia.com/Cg/glslf.html.
[15] NVIDIA Corporation. OpenGL vertex profile for the
OpenGL Shading Language, GLSL. Website. Online available at
http://http.developer.nvidia.com/Cg/glslv.html.
[16] NVIDIA Corporation. NVIDIA NV fragment program4 OpenGL
Extension Specifications, Nov 2006. Website. Online available at
http://www.opengl.org/registry/specs/NV/fragment program4.txt.
[17] NVIDIA Corporation. NVIDIA NV gpu program4 OpenGL Extension Specifications, Nov 2006. Website. Online available at
https://www.opengl.org/registry/specs/NV/gpu program4.txt.
[18] NVIDIA Corporation. NVIDIA NV vertex program4 OpenGL
Extension Specifications, Nov 2006. Website. Online available at
http://www.opengl.org/registry/specs/NV/vertex program4.txt.
[19] Simpson, R. J. The opengl es shading language. Khronos Group (2006).
[20] Woo, M., Neider, J., Davis, T., and Shreiner, D. OpenGL
programming guide: the official guide to learning OpenGL, version 1.2.
Addison-Wesley Longman Publishing Co., Inc., 1999.
(此全文未開放授權)
電子全文
摘要檔
 
 
 
 
第一頁 上一頁 下一頁 最後一頁 top
* *