【发布时间】:2016-09-23 16:48:19
【问题描述】:
我正在将计算着色器从 GLSL 转换为 Metal 着色语言。我正在使用函数uintBitsToFloat 和floatBitsToUint 来存储原子变量。他们在金属中的等价物是什么? GLSL 中的示例用法:
shared uint ldsZMin;
...
float depth = -imageLoad( depthTexture, ivec2( globalThreadIdx.x, globalThreadIdx.y ) ).x;
uint z = floatBitsToUint( depth );
atomicMin( ldsZMin, z );
【问题讨论】: