2
我將一個計算着色器從GLSL轉換爲金屬着色語言。我正在使用函數uintBitsToFloat
和floatBitsToUint
來存儲原子變量。他們在金屬中的等同物是什麼? GLSL中的示例用法:在金屬着色語言中,GLSL的uintBitsToFloat和floatBitsToUint等價於什麼?
shared uint ldsZMin;
...
float depth = -imageLoad(depthTexture, ivec2(globalThreadIdx.x, globalThreadIdx.y)).x;
uint z = floatBitsToUint(depth);
atomicMin(ldsZMin, z);