A. Masserann
09-25-2008, 04:46 PM
Hi,
I'm looking for a way to check, on the CPU, whether a fragment has met a certain condition or not.
In other words, I would like a boolean which is true if and only if one or more fragment shader executions have done a special action.
At the first glance I thought I could simply use a 1x1 texture, but I can't write to a texture which is not a RT ( can I ? )
Another idea I've had is to use the histogram functionnality : since I don't really care about the real colors ( I'm doing some weird kind of GPGPU ) I could just have the fragment color to be red if the condition is met, and blue otherwise. But how fast is that ? Aren't they faster/simpler solution(s) ?
Thanks !
I'm looking for a way to check, on the CPU, whether a fragment has met a certain condition or not.
In other words, I would like a boolean which is true if and only if one or more fragment shader executions have done a special action.
At the first glance I thought I could simply use a 1x1 texture, but I can't write to a texture which is not a RT ( can I ? )
Another idea I've had is to use the histogram functionnality : since I don't really care about the real colors ( I'm doing some weird kind of GPGPU ) I could just have the fragment color to be red if the condition is met, and blue otherwise. But how fast is that ? Aren't they faster/simpler solution(s) ?
Thanks !