Share via


WaveActiveSum 函式

加總目前波中所有作用中通道的運算式值,並將它複寫至目前波浪中的所有通道。

語法

<type> WaveActiveSum(
   <type> expr
);

參數

expr

要評估的運算式。

傳回值

總和值。

備註

作業的順序未定義。

所有著色器階段的著色器模型 6.0 都支援此函式。

 

範例

float3 total = WaveActiveSum( position ); // sum positions in wave
float3 center = total/count;           // compute average of these positions

另請參閱

著色器模型 6 的概觀

著色器模型 6