3 Replies Latest reply on Jul 8, 2009 8:54 AM by lipi

    Occlusion querries

    lpw

      Hi all,

      Is there currently any way to issue occlusion queries that will work with CAL? The idea is to count the number of pixels that actually make it to the "framebuffer," i.e. are not discarded by the pixel shader (a CAL program). This technique is very common in the GPGPU world.

      I can do occlusion queries with OpenGL or DirectX alone, as long as I don't use double precision. Unfortunately, the project I'm working on requires double precision, so the graphics APIs are of no use (the very reason I switched to CAL in the first place).

      I see three possible ways in which occlusion query support could be achieved:

      1) Use the CAL <--> D3D interoperability extension. Associate a CAL device with a D3D device. Do everything using CAL, but inject some query markers using the D3D device interface. Unfortunately, the interoperability extension does not appear to work at all at this point (a topic for another thread).

      2) Do everything in D3D (or OpenGL), but compile a kernel using an AMD compiler. I'm not sure how to go about this or if it's even possible.

      3) Doing occlusion querries via an interface similar to the current counter extensions would be nice to have in the future. Is there any hope?

      Could someone from AMD comment on this or suggest a solution? (Of course, comments and suggestions are welcome from fellow users as well!)

      Thanks!

       

        • Occlusion querries
          lpw

          I guess option 3 would be the most viable in the long run.  The options based on D3D interoperability would also require that both D3D and CAL share the same rendering context, which does not seem possible at this time.

          Or am I missing something?

          • Occlusion querries
            MicahVillmow
            lpw, we are working on a graphics interoperability sample to showcase how to use it in CAL. This will be part of one of our future releases.

            As for occlusion queries. There really is no support for it at the CAL level because CAL is following the compute model and not the graphics model. Only things that are directly related to compute are exposed. CAL also does not directly access the framebuffer, but always writes out results to a memory locaiton, similiar to render to texture in the graphics world. There is a valid discard instruction in CAL, but there is no way to count the number of threads that are killed. You may write your own algorithm to do this, but is not exposed via the CAL interface.
              • Occlusion querries
                lipi

                 

                Originally posted by: MicahVillmow lpw, we are working on a graphics interoperability sample to showcase how to use it in CAL. This will be part of one of our future releases.


                Is there such sample available yet? If not in the SDK, but somewhere on the net?