diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-11-29 15:09:42 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2022-01-20 08:12:51 +0000 |
commit | ce0db89ff538517351a5cace7ad8511add08371d (patch) | |
tree | 99df725e636f29de6d23ac0a97fcba270d458d3e | |
parent | 73103ac04c20fbbff4b3fea3a990cbd05dd29a29 (diff) |
Fix rendering with OpenGL based RHI on macOS
Somehow we ended up having the wrong bit swizzling in the shader for
the GL_TEXTURE_RECTANGLE shader.
Also add some explanation about the SamplerRect pixel format to the
documentation.
Change-Id: I2f2ff25490ccc831988d5221a5c4b1ab541d777e
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit e03582ab5b99b0930742e26e00753b17871a8752)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/multimedia/shaders/rectsampler_bgra.frag | 2 | ||||
-rw-r--r-- | src/multimedia/video/qvideoframeformat.cpp | 6 | ||||
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/multimedia/shaders/rectsampler_bgra.frag b/src/multimedia/shaders/rectsampler_bgra.frag index 8dc9192e1..0bf5cb187 100644 --- a/src/multimedia/shaders/rectsampler_bgra.frag +++ b/src/multimedia/shaders/rectsampler_bgra.frag @@ -14,5 +14,5 @@ layout(binding = 1) uniform sampler2DRect rgbTexture; void main() { - fragColor = texture(rgbTexture, texCoord).bgra * ubuf.opacity; + fragColor = texture(rgbTexture, texCoord).rgba * ubuf.opacity; } diff --git a/src/multimedia/video/qvideoframeformat.cpp b/src/multimedia/video/qvideoframeformat.cpp index 758411e70..1a687b40d 100644 --- a/src/multimedia/video/qvideoframeformat.cpp +++ b/src/multimedia/video/qvideoframeformat.cpp @@ -238,10 +238,12 @@ QT_DEFINE_QESDP_SPECIALIZATION_DTOR(QVideoFrameFormatPrivate); The frame is stored in compressed Jpeg format. \value Format_SamplerExternalOES - The frame is stored in external OES texture format. + The frame is stored in external OES texture format. This is currently only being used on Android. \value Format_SamplerRect - The frame is stored in rectangle texture format. + The frame is stored in rectangle texture format (GL_TEXTURE_RECTANGLE). This is only being used on + macOS with an OpenGL based Rendering Hardware interface. The underlying pixel format stored in the + texture is Format_BRGA8888. */ /*! diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp index b7911911b..07942d93b 100644 --- a/src/multimedia/video/qvideotexturehelper.cpp +++ b/src/multimedia/video/qvideotexturehelper.cpp @@ -246,7 +246,7 @@ static const TextureDescription descriptions[QVideoFrameFormat::NPixelFormats] = { 1, 0, [](int, int) { return 0; }, - { QRhiTexture::RGBA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, + { QRhiTexture::BGRA8, QRhiTexture::UnknownFormat, QRhiTexture::UnknownFormat }, { { 1, 1 }, { 1, 1 }, { 1, 1 } } } }; |