vo_gpu: initial support for tunable parameters#17700
vo_gpu: initial support for tunable parameters#17700kasper93 merged 5 commits intompv-player:masterfrom
Conversation
this enables callers that already have bstr names to avoid unnecessary string conversions.
does not support everything supported by gpu-next/libplacebo, only a subset that was needed to run some user shaders.
|
Could use some more testing, but it seems to be enough to run CfL_Prediction.glsl for example. Also if anyone knows any other user shader that uses PARAM blocks, please share. |
Many shaders from the following do: https://github.com/hooke007/mpv_PlayKit/tree/main/portable_config/shaders |
|
Thanks. From some quick grepping, it seems like nearly all the features are used in practice aside from I can work on the the lower hanging fruits. But implementing a couple these (I presume) will not be straightforward. So is it okay to only support the lower hanging parts initially and leave out the non-trivial stuff for later, or would that be a blocker? |
I think it should be evaluated if implementing the remaining features requires substantial rewrite of the code added in this PR. If the substantial rewrite is not needed, then this PR can stay as an incremental change. |
Majority of the code added here is just parser code, which is not an accident since I wanted to start with simple changes (enough to make CfL work). I think I actually had parsing support for The |
That's good point, I should be using
Worse case you can treat all variables as const, but for bigger shaders recompilation on every update may be problematic. |
|
Added support for |
There was a problem hiding this comment.
The PR can also run mpv360 at it's current state. Marking this ready for review since I think it's a good enough baseline.
The missing stuff can be added incrementally later and shouldn't require any large rewrite of the parser code added here.
| double max; | ||
| bool has_min; | ||
| bool has_max; | ||
| struct bstr enum_body; |
There was a problem hiding this comment.
Felt like it'd be easier to just collect the enum body in a single bstr and iterate on demand. Avoids placing static limits and also avoids having to carry a dynamic array.
Could just change it to either dynamic array or array with static limit if that's preferred.
| struct bstr hook_tex[SHADER_MAX_HOOKS]; | ||
| struct bstr bind_tex[SHADER_MAX_BINDS]; | ||
| struct gl_user_shader_param params[SHADER_MAX_PARAMS]; | ||
| int num_params; |
There was a problem hiding this comment.
Seemed reasonable. But could change to dynamic array too.
deduplicates some code between vo_gpu and vo_gpu_next
kasper93
left a comment
There was a problem hiding this comment.
LGTM, thanks!
Shouldn't break old shaders, so why not.
does not support everything supported by gpu-next/libplacebo,
only a subset that was needed to run some user shaders.