
The AMD GPU Services (AGS) library provides software developers with the ability to query AMD GPU software and hardware state information that is not normally available through standard operating systems or graphics APIs.
The Barycentrics11/12 samples show how to enable new intrinsic instructions in your DirectX® 11/12 HLSL code. In particular, it shows how to read the barycentric coordinates from the hardware rasterizer.
View Barycentrics11 sample on GitHubView Barycentrics12 sample on GitHubThe barycentric coordinates are used to interpolate vertex attributes in your triangles. The interpolation type can be linear or perspective corrected. The barycentric coordinates can be computed for the pixel’s center, the sample position, or the centroid.
As suggested by Michal Drobot in his Low Level Optimizations for GCN presentation, this opens the door to new interpolation and attribute packing methods.
Many algorithms that were only possible in the geometry shader can now be implemented in the pixel shader. For example:
The intrinsic instructions are enabled through the AMD GPU Services (AGS) library: