Page 1 of 1

OpenGL support in OpenFX plugins in DaVinci Resove

PostPosted: Wed Jul 26, 2017 8:48 am
by Roman Kudinov
Hi,

I develop OpenFX plugin and can't make Resolve to render in OpenGL mode. Does anyone know if DaVinci Resolve supports rendering in OpenGL mode?


In kOfxActionDescribe I check the value of kOfxImageEffectPropOpenGLRenderSupported in the host property set. It is set to "true". Then I set this property to true to the effect's property set.


Code: Select all
    const char *oglSupport = NULL;
    gPropHost->propGetString(gHost->host, kOfxImageEffectPropOpenGLRenderSupported, 0, &oglSupport);
    std::cout << "oglSupport = " << oglSupport << std::endl;          //olgSupport == "true"
   
    // get the property handle for the plugin
    OfxPropertySetHandle effectProps;
    gEffectHost->getPropertySet(effect, &effectProps);
   
    //enable OpenGL processing
    gPropHost->propSetString(effectProps, kOfxImageEffectPropOpenGLRenderSupported, 0, "true");


I can fetch pointer to kOfxOpenGLRenderSuite suite successfully.

BUT! kOfxActionOpenGLContextAttached is never called and kOfxImageEffectPropOpenGLEnabled is not set during kOfxImageEffectActionRender action.


Code: Select all
        int oglEnabled = -1;
   status = gPropHost->propGetInt(inArgs, kOfxImageEffectPropOpenGLEnabled, 0, &oglEnabled);


oglEnabled == -1 always

What am I doing wrong?


Thanks

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostPosted: Wed Jan 10, 2018 7:17 pm
by Justin Moore
Bumping this. In https://github.com/NatronGitHub/openfx- ... dertoy.cpp, the plugin specifies that it needs OpenGL support in kOfxImageEffectPropOpenGLRenderSupported, but Resolve calls render with kOfxImageEffectPropOpenGLEnabled set to false always.

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostPosted: Wed Jan 10, 2018 10:23 pm
by Roman Kudinov
I tried to create my own OpenGL context and create textures from buffers provided by DaVinci, but it works unstable on Windows platform - freezes and hangs occur. Seems like it gets in conflict with the host.

So I finished with rendering in OpenCL and CUDA.

Re: OpenGL support in OpenFX plugins in DaVinci Resove

PostPosted: Thu Jan 11, 2018 3:47 am
by Justin Moore
Unfortunately OpenCL/CUDA is not an option for Shadertoy, as the shaders are all written in GLSL.

I've managed to get it working without creating an external context, but it's super slow because I'm uploading/downloading images from the GPU every frame.

Here's the relevant code: https://github.com/DrChat/openfx-misc/c ... 0c18272ad5

Obviously it'd be nice if Resolve did all these copies for me. I think it's just a matter of implementing some unimplemented functionality.