summaryrefslogtreecommitdiffstats
path: root/src/multimedia
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2021-04-04 17:10:07 +0200
committerLars Knoll <lars.knoll@qt.io>2021-04-08 12:18:49 +0000
commitccb7398c3d839f36fcbdcad1e3c9fc13f387713f (patch)
tree0f01385140274a3b71223cdad7d85bc8ff5721cc /src/multimedia
parentbf329564b7e5225ab9a305e62707230e9167c26b (diff)
Use the new RHI texture formats for 16bit textures
Use R16 and RG16 to handle rendering of P010 and P016 pixel formats. Change-Id: I96d2c44aea405d24ab4a6e88c42b6a5eff89166f Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/multimedia')
-rw-r--r--src/multimedia/shaders/p010le.frag4
-rw-r--r--src/multimedia/video/qvideotexturehelper.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/multimedia/shaders/p010le.frag b/src/multimedia/shaders/p010le.frag
index 514884b97..9ef6bd648 100644
--- a/src/multimedia/shaders/p010le.frag
+++ b/src/multimedia/shaders/p010le.frag
@@ -18,8 +18,8 @@ layout(binding = 2) uniform sampler2D plane2Texture;
void main()
{
- float Y = texture(plane1Texture, plane1TexCoord).g;
- vec2 UV = texture(plane2Texture, plane2TexCoord).ga;
+ float Y = texture(plane1Texture, plane1TexCoord).r;
+ vec2 UV = texture(plane2Texture, plane2TexCoord).rg;
vec4 color = vec4(Y, UV.x, UV.y, 1.);
fragColor = ubuf.colorMatrix * color * ubuf.opacity;
}
diff --git a/src/multimedia/video/qvideotexturehelper.cpp b/src/multimedia/video/qvideotexturehelper.cpp
index ff0f43db0..1eed562aa 100644
--- a/src/multimedia/video/qvideotexturehelper.cpp
+++ b/src/multimedia/video/qvideotexturehelper.cpp
@@ -183,7 +183,7 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats]
// Format_P010LE
{ 2,
- { QRhiTexture::RG8, QRhiTexture::BGRA8, QRhiTexture::UnknownFormat },
+ { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat },
{ { 1, 1 }, { 2, 2 }, { 1, 1 } }
},
// Format_P010BE
@@ -193,7 +193,7 @@ static const TextureDescription descriptions[QVideoSurfaceFormat::NPixelFormats]
},
// Format_P016LE
{ 2,
- { QRhiTexture::RG8, QRhiTexture::BGRA8, QRhiTexture::UnknownFormat },
+ { QRhiTexture::R16, QRhiTexture::RG16, QRhiTexture::UnknownFormat },
{ { 1, 1 }, { 2, 2 }, { 1, 1 } }
},
// Format_P016BE