SPIR-V 研究:编译器基本原理(一)

前面转过两篇关于SPIR-V 中间语言的介绍;接下来笔者准备深入学习一下SPIR-V的标准。根据标准,SPIR-V是以一种二进制格式存在的,并且函数还是以控制流图CFG的形式存在;数据结构也保留了高级语言里的层级关系。(https://en.wikipedia.org/wiki/Standard_Portable_Intermediate_Representation

这样做的目的是为了更好的在目标平台上进行优化;同时Khronos也放出了官方标准的开源编译器Glslang。 所以,为了更好的了解SPIR-V,我们有必要先温习一下编译器的基本原理,特别是前端的词法分析、语法分析、语义分析和中间语言生成。

查看全文

第三篇,介绍Shader Core。

1. 英文原文

In the first two blogs of this series I introduced the frame-level pipelining [The
Mali GPU: An Abstract Machine, Part 1 - Frame Pipelining
] and tile based rendering architecture [The
Mali GPU: An Abstract Machine, Part 2 - Tile-based Rendering
] used by the Mali GPUs, aiming to develop a mental model which developers can use to explain the behavior of the graphics stack when optimizing the performance of their applications.

 

In this blog I will finish the construction of this abstract machine, forming the final component: the Mali GPU itself.  This blog assumes you have read the first two parts in the series, so I would recommend starting with those if you have not read them already.

 

查看全文

第二篇,介绍了Tile-based rendering。一样有中英文对照。

1. 英文原文

In my previous
blog
 I started defining an abstract machine which can be used to describe the application-visible behaviors of the Mali GPU and driver software. The purpose of this machine is to give developers a mental model of the interesting behaviors beneath the OpenGL
ES API, which can in turn be used to explain issues which impact their application’s performance. I will use this model in the future blogs of this series to explore some common performance pot-holes which developers encounter when developing graphics applications.

 

This blog continues the development of this abstract machine, looking at the tile-based rendering model of the Mali GPU family. I’ll assume you’ve read the first blog on pipelining; if you haven’t I would suggest reading that first.

 

查看全文

转三篇ARM一个牛人写的怎样优化OpenGL ES应用程序的文章。该系列三篇文章,深入浅出介绍了OpenGL ES API的背后实现和

ARM GPU硬件架构。其中第一篇是所有图形API都通用的概念;后面介绍了Tile-based rendering和ARM自己Shader Core。

这是第一篇,有中英文对照的。微笑

查看全文

转另一篇SPIR-V的文章。

8 reasons why SPIR-V makes a big difference

From all the news that came out of GDC, I’m most eager to talk about SPIR-V. This intermediate languagespir-vwill
make a big difference for the compute-industry. In this article I’d like to explain why. If you need a technical explanation of what SPIR-V is, I suggest you first read gtruc’s
article on SPIR-V
 and then return here to get an overview of the advantages.

查看全文

SPIR-V,全称Standard Portable Intermediate Representation (SPIR) 是一种用在GPU通用计算和图形学上的中间语言(intermediate
language
,类似汇编);由Khronos开发,
最初是为
OpenCL准备的。 目前的版本是
SPIR-V,和下一代图形标准Vulkan差不多同时提出。前面版本的SPIR其实基于LLVM IR;而最新的SPIR-V则是重新定义了一套;当然还是和LLVM IR有些类似。

查看全文

最近一段时间准备学习新的下一代graphics API,DX12和Vulkan。发现目前公开的资料不多,特别是Vulkan,kronos的速度也真慢,正式的Spec还没有出来。倒是LunarG出了个SDK和其在intel平台上实现的Vulkan driver,只是笔者一直没找到公开的代码。

其实,无论DX12还是Vulkan都是来自AMD的Mantle,而AMD也已经放出了公开的Mantle API Refernce Doc. 这份文档写的很不错,条理清晰很有价值;笔者建议有兴趣的朋友一定要拜读一下。于是笔者决定先从新标准的鼻祖mantle入手学习,结合笔者多年图形学工作的经验,希望能对下一代API能有个叫深刻的认识。在此也把自己学习体会和大家分享一下,当做读书笔记吧:)

查看全文

返回顶部