diff --git a/Resources/MetalShaders/shaders.metal b/Resources/MetalShaders/shaders.metal index 0e8e440d2..5f334992f 100644 --- a/Resources/MetalShaders/shaders.metal +++ b/Resources/MetalShaders/shaders.metal @@ -56,10 +56,10 @@ kernel void kernelIdentity(texture2d inTexture [[ texture(0 texture2d outTexture [[ texture(1) ]], uint2 gid [[ thread_position_in_grid ]]) { - uint inWidth = inTexture.get_width(); - uint outWidth = outTexture.get_width(); + int inWidth = inTexture.get_width(); + int outWidth = outTexture.get_width(); - uint offset = (inWidth - outWidth) > 0 ? (inWidth - outWidth) / 2 : 0; + int offset = (inWidth - outWidth) > 0 ? (inWidth - outWidth) / 2 : 0; uint2 adjusted = uint2(gid.x + offset, gid.y); float4 outColor = inTexture.read(adjusted); outTexture.write(outColor, gid);