Results 1 to 7 of 7

Thread: Cleanup user data

  1. #1

    Default Cleanup user data

    Hi,

    I created some data in my geometry shader which is used by my surface shader later. Now I'd like to remove the additional data after the frame is done. An cleanup in the geometry shader exit() procedure will obviously not work. And I cannot delete the contents in the surface shader exit() procedure because I don't know it the data will be used by other surface shaders.

    My usual way was to create an output shader, append it to the camera and remove all data there. But this seems to be quite complex. So the question is: Is this really the correct way to ceanup data after a frame rendering?

  2. #2
    Join Date
    Aug 2005
    Posts
    169

    Default

    I'm trying a similar thing and I'm finding that my output shaders exit function never seems to be called.

  3. #3

    Default

    Haggi, there is a cleanup possible, however only for integrators. mental ray can render in a mode
    where all geometry created by geometry shaders is deleted after a frame. This mode can only be set
    in library versions of mental ray.
    Talked to Juri, he also said that your method with the output shader is the best solution at the moment.

    Gunter

  4. #4

    Default

    Thanks for the info.

  5. #5
    Join Date
    Aug 2005
    Posts
    169

    Default

    haggi are you doing this in the exit of an output shader? Or in the body. We have a single output shader right now and can't free this data in the body because there might be multiple instances of the output shader. Easy enough to write a separate one that we try to ensure is the last one called (is that just a matter of it being the last one in the camera's output shader list?), but preferably we could just do this in the exit of the output shader. Doesn't seem the exit is ever called though.

  6. #6

    Default

    I've done it in the body. Output shaders are called one after the other, not in parallel, so if I free the data in one output shader, in fact cleaning an std::vector array, the next one will skip this part because the array is empty now.

  7. #7
    Join Date
    Aug 2005
    Posts
    169

    Default

    If you free the data in one instance of the shader then it's not available for another instance of the shader. Correct? Sounds like the only recourse I have is to have a different output shader (not instance of the same shader, a different dll entirely) that I ensure is called last and responsible for freeing all my user data allocations. Am I missing something obvious about output shaders and their exits?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •