• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Flow handler for AEGP_ComputeIfNeededAndCheckout in the compute cache api

New Here ,
Mar 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

My issue is that we need to make sure frame n-1 is finished rendering before we can render frame n because there are cases where frame n will need the data of frame n-1.
Is it true that when rendering at frame n - 1, we will save the opaque_optionsP of frame n-1 and call AEGP_ComputeIfNeededAndCheckout after rendering to cache. Counting frame n will call AEGP_ComputeIfNeededAndCheckout with opaque_optionsP of frame 1 to check if rendering has finished. Am I understanding that right?

Below is my code in PF_Cmd_SMART_RENDER:

A_long* preFrame = nullptr; // This variable will be saved globally
AEFX_SuiteScoper<AEGP_ComputeCacheSuite1> computeCacheSuite1{ in_data, kAEGPComputeCacheSuite, kAEGPComputeCacheSuiteVersion1 };
AEGP_CCCheckoutReceiptP receiptForPreviousFrame = nullptr;
in_dataP = in_data;
if (in_data->current_time > 0)
{
    if (secondpreFrame == nullptr)
    {
        secondpreFrame = preFrame;
    }
    ERR(computeCacheSuite1->AEGP_ComputeIfNeededAndCheckout(computeClassIdP, preFrame, false, &receiptForPreviousFrame));
    if(err == A_Err_NOT_IN_CACHE_OR_COMPUTE_PENDING) {
        ERR(computeCacheSuite1->AEGP_ComputeIfNeededAndCheckout(computeClassIdP, preFrame, true, &receiptForPreviousFrame));
        spdlog::info("A_Err_NOT_IN_CACHE_OR_COMPUTE_PENDING 1");
    }
    computeCacheSuite1->AEGP_CheckinComputeReceipt(receiptForPreviousFrame);
}
...
  //render frame
...
    AEGP_CCCheckoutReceiptP receiptForCurrentFrame = nullptr;
    ERR(computeCacheSuite1->AEGP_ComputeIfNeededAndCheckout(computeClassIdP, &in_data->current_time, false, &receiptForCurrentFrame));
    if (err != PF_Err_NONE) {
        spdlog::info("save AEGP_ClassUnregister fails");
    }
    if (err == A_Err_NOT_IN_CACHE_OR_COMPUTE_PENDING) {
        ERR(computeCacheSuite1->AEGP_ComputeIfNeededAndCheckout(computeClassIdP, &in_data->current_time, true, &receiptForCurrentFrame));
    }
    computeCacheSuite1->AEGP_CheckinComputeReceipt(receiptForCurrentFrame);
}
preFrame = &in_data->current_time;

Views

66

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 11, 2024 Mar 11, 2024

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from using the community">

Votes

Translate

Translate
Community Expert ,
Mar 11, 2024 Mar 11, 2024

Copy link to clipboard

Copied

LATEST

in the future, to find the best place to post your message, use the list here, https://community.adobe.com/

p.s. i don't think the adobe website, and forums in particular, are easy to navigate, so don't spend a lot of time searching that forum list. do your best and we'll move the post (like this one has already been moved) if it helps you get responses.



<"moved from using the community">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines