scenes/opengl: Port lanczos filter to ShaderManager::generateShaderFromFile()
This commit is contained in:
parent
35e0abb089
commit
6494db75e9
4 changed files with 4 additions and 10 deletions
|
@ -76,14 +76,8 @@ void LanczosFilter::init()
|
|||
return;
|
||||
}
|
||||
}
|
||||
QFile ff(gl->glslVersion() >= kVersionNumber(1, 40) ?
|
||||
QStringLiteral(":/scenes/opengl/shaders/1.40/lanczos-fragment.glsl") :
|
||||
QStringLiteral(":/scenes/opengl/shaders/1.10/lanczos-fragment.glsl"));
|
||||
if (!ff.open(QIODevice::ReadOnly)) {
|
||||
qCDebug(KWIN_OPENGL) << "Failed to open lanczos shader";
|
||||
return;
|
||||
}
|
||||
m_shader.reset(ShaderManager::instance()->generateCustomShader(ShaderTrait::MapTexture, QByteArray(), ff.readAll()));
|
||||
|
||||
m_shader.reset(ShaderManager::instance()->generateShaderFromFile(ShaderTrait::MapTexture, QString(), QStringLiteral(":/scenes/opengl/shaders/lanczos.frag")));
|
||||
if (m_shader->isValid()) {
|
||||
ShaderBinder binder(m_shader.data());
|
||||
m_uKernel = m_shader->uniformLocation("kernel");
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/scenes/opengl">
|
||||
<file>shaders/1.10/lanczos-fragment.glsl</file>
|
||||
<file>shaders/1.40/lanczos-fragment.glsl</file>
|
||||
<file>shaders/lanczos.frag</file>
|
||||
<file>shaders/lanczos_core.frag</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Reference in a new issue