记一次GPU架构设计学习入门之一_Gemotry处理过程

目录

人总是会变得,

厉害了我的哥,GPU设计走起

GPU Geometry 过程实战

参考:


人总是会变得,

以前的我会认为:

一,

读书时,其实是软硬件不分家,工作后,软件要学的东西很多啊,精力不够啊,放弃硬件吧

二,

芯片设计,关键是光刻机,光是懂设计有什么用

扫描二维码关注公众号,回复: 14294730 查看本文章

三,

没有实物,光学习,真的很难掌握

现在的我会认为:

????

???

我不听,我不听,我就是不听

厉害了我的哥,GPU设计走起

所以今天想稍微学习一下GPU的设计(哈哈,我自己都吹的有点脸红)

也只是学习一下,arm 的 mobile 结构

只是学习一下,设计中的其中一个环节,Geometry Process

还只是学习一下,Geometry Cull 剔除的几个分类

(最终只是会设计一个蓝牙或无线的 xx Unit,而不是真正设计Graphic Process Unit )

GPU Geometry 过程实战

1.一个多个怪物的 ARPG,明显没优化前,

2.利用 arm studio 测试

(其实,不用测试也能肯定GPU消耗,肯定不在Geometry部分(试问哪家的GPU那么蠢没有镜头剔除的),这个文章只是分析,学习和记录 GPU执行的其中一环的Geometry的过程,所以还是稍微记录一下分析过程,如果 ARPG 怪很多这个消耗问题,有最终定位结果,会在文末补上)

这里有2个测试项

Mali Geometry Usage 图,显示了Geometry剔除的比例;Input Primitives(橙色)明显输入很多,Culled primitives(红色)剔除也不少,这也很合理,最终显示的 Primitives(绿色),几乎看不到(可是这个ARPG fps还是很低)

Mali Geometry Culling Rate 图,分类了剔除的原因,分别是Facing culled, Z plane culled,和Sample culled,如上图,明显一开始,Sample culled(紫色)明显,Facing culled(橙色)一般,Z plane culled(红色)几乎没有,而Visiable rate(绿色)一直高级不下且直线向上

3.个人理解

Facing

一个怪物的正面绘制,背面(不管是否遮挡,背部的三角面和正面的三角面朝向是不同的)的部分不绘制,这就是因为朝向的不同所做的剔除,Facing Culled

一个三角面一般,3个顶点,一般按顺时针为正面绘制,(左手??右手法则?)垂直于该三角面的指向即是朝向,所以同样的3个顶点组成的三角面,在空间上看存在的,但实际绘制过程中还是有正反朝向的差异

ZPlane

 用过Unity Camera的我们都知道,摄像机有near clip plane 和 far clip plane 所以,在锥视体的近端和超出远处的 Primitives 都肯定会被剔除掉

(这也很好解释了,上面的红色rates,为什么是一般(一半一半))​​​​​​​

Sample test

In the streamline counters, what does the "Sample test cull rate" mean in Mali Geometry Culling Rate?

"The percentage of primitives entering the sample coverage test that are killed by it." -- This is tips for this counter. But i can not get the exact meaning of it. 

Hi Shawn, 

Recent Mali GPUs have a culling stage for killing triangles at the culling stage which are so small that they hit no rasterizer sample points, which avoids them getting written back to the intermediate tile lists.

Small triangles are expensive in terms of processing cost and memory bandwidth, so it's important content tries to minimize the number sample culled triangles. 

I'll raise a ticket to improve the description for this counter for the next tool release.

Kind regards, 
Pete

developer.arm.com/.../mali-performance-counters

按官方回复:本身的提示让人搞不懂,实际上,一些没法被栅格化的很小的三角面会被剔除,这个过程就是Sample test culled

(由于某乎的原因,我早知道arm gpu的架构是 arm64,在手机上明显打败了intel后来的架构,现在arm64主流架构,arm64在传统 fragment pass 前有一个 tile blinning pass;例如一个图片的渲染前期剔除有一个 tile 分块进行处理,所以Sample test culled的作用,应该是避免小的triangles,没法栅格化却又被当成 privimitive反复写入tile 分块

参考:

What does "Sample test cull rate" mean? - Graphics, Gaming, and VR forum - Support forums - Arm Community

what the difference between "Sample test cull rate" and "partical coverage rate"? - Graphics, Gaming, and VR forum - Support forums - Arm Community

Documentation – Arm Developer

猜你喜欢

转载自blog.csdn.net/avi9111/article/details/125360569