標籤:

推薦閱讀Vulkan Spec

對GPU有興趣的人,我推薦你們閱讀 Vulkan Specification。整個文檔的素質比OpenGL Specification更好,更有條理性。雖然讀起來很繁瑣,但是會對理解GPU的內部行為有很大的幫助。

話說Vulkan寫起來簡直就是在寫User Mode Driver + Runtime啊,想來做UMD的同學應該感到無比親切吧。

Vulkan在一些細節上和D3D不太一樣,比如Fill-Mode Primitive Rasterization中,D3D明確要求了使用Top-Left規則,但是Vulkan上是這麼說的:

The rule for determining which fragments are produced by polygon rasterization is called point sampling. The two-dimensional projection obtained by taking the x and y framebuffer coordinates of the polygon』s vertices is formed. Fragments are produced for any pixels for which any sample points lie inside of this polygon. Coverage bits that correspond to sample points that satisfy the point sampling criteria are 1, other coverage bits are 0. Special treatment is given to a sample whose sample location lies on a polygon edge. In such a case, if two polygons lie on either side of a common edge (with identical endpoints) on which a sample point lies, then exactly one of the polygons must result in a covered sample for that fragment during rasterization.

簡單來說就是如果多個三角形共享一個邊,那麼邊界上的每個像素必須處理、且只能處理一次。估計是因為一些Mobile GPU沒有按照D3D來擼 —— 當然也沒有按照D3D來做的必要。


推薦閱讀:

超級瑪麗現已加入 Vulkan 豪華午餐
vulkan中的sparse resource支持
Dota 2 現已支持 Vulkan API,使用起來究竟怎麼樣?

TAG:Vulkan | GPU |