Skip to content

effects: Fix resource file reading for builtin effects

Vlad Zahorodnii requested to merge work/zzag/resources-per-effect into master

Currently, the invert effect doesn't work because it can't load its fragment shader because builtin effects are static libs. We need Q_INIT_RESOURCE() before reading shader code.

This modularizes builtin effects more, which makes easier to add and remove builtin effects, as well as allows to have per effect resources.

Technically, changing the inner workings of the ShaderManager is an API incompatible change, but ShaderManager::generateShaderFromResources() can be used only by builtin effects so it's okay.

ShaderManager::generateShaderFromResources() had to be changed because two resource files can't share the same prefix. Appending "_core" was inspired by QtQuick.

Edited by Vlad Zahorodnii

Merge request reports