Reputation:
I declare a metal texture in Swift with format .bgra8Unorm
. Now in the metal compute kernel
I access it using the half
data type (I believe an Apple example did it this way).
texture2d<half, access::sample> inTexture [[ texture(0) ]]
Will accessing a bgra8Unorm
texture this way (via a sampler) and/or writing it back automatically pack and unpack half
values to and from 8 bit integers? What happens when I write a negative half
value to the texture?
Upvotes: 2
Views: 631