diff --git a/Support/Library/ofxsImageEffect.cpp b/Support/Library/ofxsImageEffect.cpp index b35f7d60..5511ab42 100644 --- a/Support/Library/ofxsImageEffect.cpp +++ b/Support/Library/ofxsImageEffect.cpp @@ -2649,6 +2649,13 @@ namespace OFX { _effectProps.propSetString(kOfxImageEffectPropOpenGLRenderSupported, (v ? "true" : "false"), false); // read/write from OFX 1.4 } } + + /** @brief Does the plugin require OpenGL accelerated rendering ? Can only be called from changedParam or changedClip. */ + void ImageEffect::setNeedsOpenGLRender(bool v) { + if (gHostDescription.supportsOpenGLRender) { + _effectProps.propSetString(kOfxImageEffectPropOpenGLRenderSupported, (v ? "needed" : "false"), false); // read/write from OFX 1.4 + } + } #endif @@ -3846,7 +3853,7 @@ namespace OFX { gHostDescription.supportsCustomInteract = hostProps.propGetInt(kOfxParamHostPropSupportsCustomInteract) != 0; gHostDescription.supportsChoiceAnimation = hostProps.propGetInt(kOfxParamHostPropSupportsChoiceAnimation) != 0; #ifdef OFX_EXTENSIONS_RESOLVE - gHostDescription.supportsStrChoiceAnimation = hostProps.propGetInt(kOfxParamHostPropSupportsStrChoiceAnimation, false) != 0; + gHostDescription.supportsStrChoiceAnimation = hostProps.propGetInt(kOfxParamHostPropSupportsStrChoiceAnimation, false); #endif gHostDescription.supportsBooleanAnimation = hostProps.propGetInt(kOfxParamHostPropSupportsBooleanAnimation) != 0; gHostDescription.supportsCustomAnimation = hostProps.propGetInt(kOfxParamHostPropSupportsCustomAnimation) != 0; @@ -3964,11 +3971,17 @@ namespace OFX { gMemorySuite = (OfxMemorySuiteV1 *) fetchSuite(kOfxMemorySuite, 1); gThreadSuite = (OfxMultiThreadSuiteV1 *) fetchSuite(kOfxMultiThreadSuite, 1); gMessageSuite = (OfxMessageSuiteV1 *) fetchSuite(kOfxMessageSuite, 1); +#ifndef OFX_EXTENSIONS_RESOLVE + //Resolve doesn't support OfxMessageSuiteV2, do not fetch to suppress warning gMessageSuiteV2 = (OfxMessageSuiteV2 *) fetchSuite(kOfxMessageSuite, 2, true); +#endif gProgressSuiteV1 = (OfxProgressSuiteV1 *) fetchSuite(kOfxProgressSuite, 1, true); gProgressSuiteV2 = (OfxProgressSuiteV2 *) fetchSuite(kOfxProgressSuite, 2, true); gTimeLineSuite = (OfxTimeLineSuiteV1 *) fetchSuite(kOfxTimeLineSuite, 1, true); +#ifndef OFX_EXTENSIONS_RESOLVE + // Resolve doesn't support OfxParametricParameterSuiteV1, do not fetch to suppress warning gParametricParameterSuite = (OfxParametricParameterSuiteV1*) fetchSuite(kOfxParametricParameterSuite, 1, true); +#endif #ifdef OFX_SUPPORTS_OPENGLRENDER gOpenGLRenderSuite = (OfxImageEffectOpenGLRenderSuiteV1*) fetchSuite(kOfxOpenGLRenderSuite, 1, true); #endif @@ -4157,6 +4170,7 @@ namespace OFX { args.isEnabledCudaRender = inArgs.propGetInt(kOfxImageEffectPropCudaEnabled, false) != 0; args.isEnabledMetalRender = inArgs.propGetInt(kOfxImageEffectPropMetalEnabled, false) != 0; args.pOpenCLCmdQ = inArgs.propGetPointer(kOfxImageEffectPropOpenCLCommandQueue, false); + args.pCudaStream = inArgs.propGetPointer(kOfxImageEffectPropCudaStream, false); args.pMetalCmdQ = inArgs.propGetPointer(kOfxImageEffectPropMetalCommandQueue, false); #endif @@ -4261,6 +4275,7 @@ namespace OFX { args.isEnabledCudaRender = inArgs.propGetInt(kOfxImageEffectPropCudaEnabled, false) != 0; args.isEnabledMetalRender = inArgs.propGetInt(kOfxImageEffectPropMetalEnabled, false) != 0; args.pOpenCLCmdQ = inArgs.propGetPointer(kOfxImageEffectPropOpenCLCommandQueue, false); + args.pCudaStream = inArgs.propGetPointer(kOfxImageEffectPropCudaStream, false); args.pMetalCmdQ = inArgs.propGetPointer(kOfxImageEffectPropMetalCommandQueue, false); #endif @@ -4303,6 +4318,7 @@ namespace OFX { args.isEnabledCudaRender = inArgs.propGetInt(kOfxImageEffectPropCudaEnabled, false) != 0; args.isEnabledMetalRender = inArgs.propGetInt(kOfxImageEffectPropMetalEnabled, false) != 0; args.pOpenCLCmdQ = inArgs.propGetPointer(kOfxImageEffectPropOpenCLCommandQueue, false); + args.pCudaStream = inArgs.propGetPointer(kOfxImageEffectPropCudaStream, false); args.pMetalCmdQ = inArgs.propGetPointer(kOfxImageEffectPropMetalCommandQueue, false); #endif args.renderScale.x = args.renderScale.y = 1.; diff --git a/Support/Library/ofxsPropertyValidation.cpp b/Support/Library/ofxsPropertyValidation.cpp index a9e9d621..61569c2a 100644 --- a/Support/Library/ofxsPropertyValidation.cpp +++ b/Support/Library/ofxsPropertyValidation.cpp @@ -366,6 +366,7 @@ namespace OFX { // Pointer props with defaults that can be checked against PropertyDescription(kOfxImageEffectPluginPropOverlayInteractV1, OFX::ePointer, 1, eDescDefault, NULLPTR, eDescFinished), + PropertyDescription(kOfxImageEffectPluginPropOverlayInteractV2, OFX::ePointer, 1, eDescDefault, NULLPTR, eDescFinished), // string props that have variable dimension, and can't be checked against for defaults PropertyDescription(kOfxImageEffectPropSupportedContexts, OFX::eString, -1, eDescFinished), @@ -1416,7 +1417,7 @@ namespace OFX { gStrChoiceParamPropSet.addProperty(desc, true); #endif - // do choice params animate + // do boolean params animate desc = new PropertyDescription(kOfxParamPropAnimates, OFX::eInt, 1, eDescDefault, int(getImageEffectHostDescription()->supportsBooleanAnimation), eDescFinished); diff --git a/Support/include/ofxsImageEffect.h b/Support/include/ofxsImageEffect.h index 463045be..5eccee4e 100644 --- a/Support/include/ofxsImageEffect.h +++ b/Support/include/ofxsImageEffect.h @@ -1493,6 +1493,7 @@ namespace OFX { bool isEnabledCudaRender; bool isEnabledMetalRender; void* pOpenCLCmdQ; + void* pCudaStream; void* pMetalCmdQ; #endif #ifdef OFX_SUPPORTS_OPENGLRENDER @@ -1518,6 +1519,7 @@ namespace OFX { bool isEnabledCudaRender; bool isEnabledMetalRender; void* pOpenCLCmdQ; + void* pCudaStream; void* pMetalCmdQ; #endif #ifdef OFX_SUPPORTS_OPENGLRENDER @@ -1946,6 +1948,9 @@ namespace OFX { #ifdef OFX_SUPPORTS_OPENGLRENDER /** @brief Does the plugin support OpenGL accelerated rendering (but is also capable of CPU rendering) ? Can only be called from changedParam or changedClip (OFX 1.4). */ void setSupportsOpenGLRender(bool v); + + /** @brief Does the plugin require OpenGL accelerated rendering ? Can only be called from changedParam or changedClip. */ + void setNeedsOpenGLRender(bool v); #endif /** @brief notify host that the internal data structures need syncing back to parameters for persistence and so on. This is reset by the host after calling SyncPrivateData. */ diff --git a/include/ofxImageEffect.h b/include/ofxImageEffect.h index a5b2a456..bad8b605 100644 --- a/include/ofxImageEffect.h +++ b/include/ofxImageEffect.h @@ -851,6 +851,19 @@ The entry point pointed to must be one that handles custom interaction actions. */ #define kOfxImageEffectPluginPropOverlayInteractV1 "OfxImageEffectPluginPropOverlayInteractV1" +/** @brief Sets the entry for an effect's overlay interaction. Unlike + kOfxImageEffectPluginPropOverlayInteractV1, the overlay interact in the plug-in is expected + to implement the kOfxInteractActionDraw using the OfxDrawSuiteV1. + + - Type - pointer X 1 + - Property Set - plugin descriptor (read/write) + - Default - NULL + - Valid Values - must point to an ::OfxPluginEntryPoint + +The entry point pointed to must be one that handles custom interaction actions. +*/ +#define kOfxImageEffectPluginPropOverlayInteractV2 "OfxImageEffectPluginPropOverlayInteractV2" + /** @brief Indicates whether a plugin or host support multiple resolution images. - Type - int X 1 diff --git a/include/ofxInteract.h b/include/ofxInteract.h index 8ef3695f..d82a2a47 100644 --- a/include/ofxInteract.h +++ b/include/ofxInteract.h @@ -253,8 +253,13 @@ These are the list of actions passed to an interact's entry point function. For /** @brief This action is issued to an interact whenever the host needs the plugin - to redraw the given interact. The interact should issue any openGL calls - it needs at this point. + to redraw the given interact. + + The interact should either issue OpenGL calls to draw itself, or use DrawSuite calls. + + If this is called via kOfxImageEffectPluginPropOverlayInteractV2, drawing MUST use DrawSuite. + + If this is called via kOfxImageEffectPluginPropOverlayInteractV1, drawing SHOULD use OpenGL. Some existing plugins may use DrawSuite via kOfxImageEffectPluginPropOverlayInteractV1 if it's supported by the host, but this is discouraged. Note that the interact may (in the case of custom parameter GUIS) or may not (in the case of image effect overlays) be required to swap buffers,