mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-07 15:43:55 +02:00
Use QOpenGLShaderProgram::bind.
This commit is contained in:
parent
dd79b3c0d5
commit
b3648d0147
3 changed files with 11 additions and 11 deletions
|
@ -789,7 +789,7 @@ void Viewport::RendererGL::paintTile(
|
||||||
f.glDisable(GL_BLEND);
|
f.glDisable(GL_BLEND);
|
||||||
});
|
});
|
||||||
|
|
||||||
f.glUseProgram(_imageProgram->programId());
|
_imageProgram->bind();
|
||||||
_imageProgram->setUniformValue("viewport", uniformViewport);
|
_imageProgram->setUniformValue("viewport", uniformViewport);
|
||||||
_imageProgram->setUniformValue("s_texture", GLint(0));
|
_imageProgram->setUniformValue("s_texture", GLint(0));
|
||||||
|
|
||||||
|
@ -899,7 +899,7 @@ void Viewport::RendererGL::bindFrame(
|
||||||
tileData.trackIndex = imageIndex;
|
tileData.trackIndex = imageIndex;
|
||||||
if (_rgbaFrame) {
|
if (_rgbaFrame) {
|
||||||
ensureARGB32Program();
|
ensureARGB32Program();
|
||||||
f.glUseProgram(program.argb32->programId());
|
program.argb32->bind();
|
||||||
f.glActiveTexture(GL_TEXTURE0);
|
f.glActiveTexture(GL_TEXTURE0);
|
||||||
tileData.textures.bind(f, 0);
|
tileData.textures.bind(f, 0);
|
||||||
if (upload) {
|
if (upload) {
|
||||||
|
@ -922,7 +922,7 @@ void Viewport::RendererGL::bindFrame(
|
||||||
program.argb32->setUniformValue("s_texture", GLint(0));
|
program.argb32->setUniformValue("s_texture", GLint(0));
|
||||||
} else {
|
} else {
|
||||||
const auto yuv = data.yuv420;
|
const auto yuv = data.yuv420;
|
||||||
f.glUseProgram(program.yuv420->programId());
|
program.yuv420->bind();
|
||||||
f.glActiveTexture(GL_TEXTURE0);
|
f.glActiveTexture(GL_TEXTURE0);
|
||||||
tileData.textures.bind(f, 0);
|
tileData.textures.bind(f, 0);
|
||||||
if (upload) {
|
if (upload) {
|
||||||
|
@ -1023,7 +1023,7 @@ void Viewport::RendererGL::drawFirstBlurPass(
|
||||||
QSize blurSize) {
|
QSize blurSize) {
|
||||||
tileData.framebuffers.bind(f, 1);
|
tileData.framebuffers.bind(f, 1);
|
||||||
|
|
||||||
f.glUseProgram(_blurProgram->programId());
|
_blurProgram->bind();
|
||||||
f.glActiveTexture(GL_TEXTURE0);
|
f.glActiveTexture(GL_TEXTURE0);
|
||||||
tileData.textures.bind(f, kScaleForBlurTextureIndex);
|
tileData.textures.bind(f, kScaleForBlurTextureIndex);
|
||||||
|
|
||||||
|
@ -1330,7 +1330,7 @@ void Viewport::RendererGL::validateNoiseTexture(
|
||||||
&program,
|
&program,
|
||||||
VertexShader({}),
|
VertexShader({}),
|
||||||
FragmentShader({ FragmentGenerateNoise() }));
|
FragmentShader({ FragmentGenerateNoise() }));
|
||||||
f.glUseProgram(program.programId());
|
program.bind();
|
||||||
|
|
||||||
GLint position = program.attributeLocation("position");
|
GLint position = program.attributeLocation("position");
|
||||||
f.glVertexAttribPointer(
|
f.glVertexAttribPointer(
|
||||||
|
|
|
@ -209,7 +209,7 @@ void OverlayWidget::RendererGL::paintTransformedVideoFrame(
|
||||||
Assert(data.format == Streaming::FrameFormat::YUV420);
|
Assert(data.format == Streaming::FrameFormat::YUV420);
|
||||||
Assert(!data.yuv420->size.isEmpty());
|
Assert(!data.yuv420->size.isEmpty());
|
||||||
const auto yuv = data.yuv420;
|
const auto yuv = data.yuv420;
|
||||||
_f->glUseProgram(_yuv420Program->programId());
|
_yuv420Program->bind();
|
||||||
|
|
||||||
const auto upload = (_trackFrameIndex != data.index)
|
const auto upload = (_trackFrameIndex != data.index)
|
||||||
|| (_streamedIndex != _owner->streamedIndex());
|
|| (_streamedIndex != _owner->streamedIndex());
|
||||||
|
@ -275,7 +275,7 @@ void OverlayWidget::RendererGL::paintTransformedStaticContent(
|
||||||
auto &program = fillTransparentBackground
|
auto &program = fillTransparentBackground
|
||||||
? _withTransparencyProgram
|
? _withTransparencyProgram
|
||||||
: _imageProgram;
|
: _imageProgram;
|
||||||
_f->glUseProgram(program->programId());
|
program->bind();
|
||||||
if (fillTransparentBackground) {
|
if (fillTransparentBackground) {
|
||||||
program->setUniformValue(
|
program->setUniformValue(
|
||||||
"transparentBg",
|
"transparentBg",
|
||||||
|
@ -489,7 +489,7 @@ void OverlayWidget::RendererGL::paintControl(
|
||||||
offset * 4 * sizeof(GLfloat),
|
offset * 4 * sizeof(GLfloat),
|
||||||
coords,
|
coords,
|
||||||
sizeof(coords));
|
sizeof(coords));
|
||||||
_f->glUseProgram(_fillProgram->programId());
|
_fillProgram->bind();
|
||||||
_fillProgram->setUniformValue("viewport", _uniformViewport);
|
_fillProgram->setUniformValue("viewport", _uniformViewport);
|
||||||
FillRectangle(
|
FillRectangle(
|
||||||
*_f,
|
*_f,
|
||||||
|
@ -502,7 +502,7 @@ void OverlayWidget::RendererGL::paintControl(
|
||||||
coords + (fgOffset - offset) * 4,
|
coords + (fgOffset - offset) * 4,
|
||||||
sizeof(coords) - (fgOffset - offset) * 4 * sizeof(GLfloat));
|
sizeof(coords) - (fgOffset - offset) * 4 * sizeof(GLfloat));
|
||||||
}
|
}
|
||||||
_f->glUseProgram(_controlsProgram->programId());
|
_controlsProgram->bind();
|
||||||
_controlsProgram->setUniformValue("g_opacity", GLfloat(innerOpacity));
|
_controlsProgram->setUniformValue("g_opacity", GLfloat(innerOpacity));
|
||||||
_controlsProgram->setUniformValue("viewport", _uniformViewport);
|
_controlsProgram->setUniformValue("viewport", _uniformViewport);
|
||||||
FillTexturedRectangle(*_f, &*_controlsProgram, fgOffset);
|
FillTexturedRectangle(*_f, &*_controlsProgram, fgOffset);
|
||||||
|
@ -654,7 +654,7 @@ void OverlayWidget::RendererGL::paintUsingRaster(
|
||||||
coords,
|
coords,
|
||||||
sizeof(coords));
|
sizeof(coords));
|
||||||
|
|
||||||
_f->glUseProgram(_imageProgram->programId());
|
_imageProgram->bind();
|
||||||
_imageProgram->setUniformValue("viewport", _uniformViewport);
|
_imageProgram->setUniformValue("viewport", _uniformViewport);
|
||||||
_imageProgram->setUniformValue("s_texture", GLint(0));
|
_imageProgram->setUniformValue("s_texture", GLint(0));
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 4ae6d319634be7aa3530ad3e934a187f630bd6fd
|
Subproject commit cbb65009ffc443bc88137f2758228c1b185d8d20
|
Loading…
Add table
Reference in a new issue