How to sample MTLPixelFormatR32Float in Metal buffers and/or textures?
How to sample MTLPixelFormatR32Float in Metal buffers and/or textures?
- Subject: How to sample MTLPixelFormatR32Float in Metal buffers and/or textures?
- From: Demitri Muna via Cocoa-dev <email@hidden>
- Date: Wed, 10 Jun 2020 14:57:32 -0400
Hi,
I have float array data that I want to use to create images in Metal. My plan
is to apply one or more shaders to the data, then render it into a new RGB
texture and continue from there. I’m using MTLPixelFormatR32Float as the source
pixel format with success.
In all the kernel examples I see the sampler returns a float4, which is
appropriate for an RGBA format. But my source data/format has no color. What is
the equivalent for sampling single float values?
I’m currently putting the source data into a 2D texture. Given the use case
above, does it make sense to use a MTLBuffer instead and then render that into
a new 2D MTLTexture?
Thanks!
Demitri
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden