Thanks for the information Claude! I guess I'll wait.
(I probably shouldn't be shocked that in $CURRENT_YEAR those parallel release methods aren't in sync. Perhaps by $CURRENT_YEAR * 2.)
Post
Replies
Boosts
Views
Activity
It's been 8 years but I still can't find a definitive answer to the OP :(
so... does Metal allow using the same color texture both as the render target and an input to the frag shader?
Thank you both for your answers, however, I'm afraid they're assuming knowledge I'm lacking. This is my first foray into graphics programming so I suffer from the not knowing what I don't know syndrome. Let me make it clear what I'm trying to do:
The setup: I'm working on a 2D graphics app targeting only iOS devices, using the latest Metal. Probably should have mentioned that earlier!
What I'm trying to do (simplifying a bit) is blend multiple color layers using my own blending functions into a "master" texture. The implementation is a bunch of single-quad render passes, one per layer, where I use a fragment shader to blend the master texture (initially cleared) with the current layer. I output the result to the same master texture. Think reduce(blend, layers).
So what we have is a fragment shader taking in a bunch of inputs, among them the master texture for reading, and outputting to that same master texture as an output color attachment. It only ever reads and writes to the same pixel location (so definitely same tile, IIUC).
I realize I could avoid this by ping-ponging between 2 master textures, but that's exactly my question: am I supposed to? Why? Would it be more efficient for some reason? I'm trying to learn here :)
Thanks ahead!
Thank you @endecotp! That is great to know, and seems to work on my iPad, though it fails on the iOS simulator (crashes when creating the pipeline with "reading from a rendertarget is not supported").
I will definitely be using this technique :)
Still curious about my original question though, just for learning purposes, and if perhaps I'd like to read adjacent pixels...
Oops, double post, ignore this reply which I can't delete...