microsoft / hlsl-specs

HLSL Specifications
MIT License
124 stars 34 forks source link

[request] Unambiguous "uniform" and "non-uniform" terminology #80

Open jeremyong opened 1 year ago

jeremyong commented 1 year ago

Is your feature request related to a problem? Please describe. This is a followup request to this issue: https://github.com/microsoft/DirectX-Specs/issues/149. In particular, the section on "non-uniform" and "uniform" which show up in various contexts, but do not have consistent meaning.

Describe the solution you'd like I would like there to be several distinct terms in a category of terminology to describe uniformity. As far as I can tell, uniformity can be described along two axes:

Control-flow-uniformity is useful to indicate if a particular instruction or statement requires that lanes invoking the instruction must be invoking the statement simultaneously. For example, a group barrier statement. In contrast, data-uniformity may be needed to describe a needed property of various inputs to different functions (e.g. indices used to index a global descriptor heap). In some cases, a combination of the two may be needed.

In the second axis, the uniform scope indicates whether the property extends to inactive lanes or helper lanes, or both. In addition, the scope may be restricted to individual waves, thread groups, entire dispatches, or some other as-yet-to-be-determined construct. This would allow finer grained specification of the property than what can be currently communicated easily.

damyanp commented 6 months ago

Plan is to ensure that we have language in the HLSL 202x spec defining these terms so that they'll be used going forward. We are not necessarily intending to retroactively update old specs to conform to these new definitions.

devshgraphicsprogramming commented 6 months ago

this is an area where the SPIR-V & Vulkan spec is very nice with concepts of Maximal Reconvergence, and notions of Dynamically uniform, (Statically) Uniform, and Subgroup Uniform