diff options
author | Lars Knoll <lars.knoll@qt.io> | 2021-04-04 17:10:07 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2021-04-08 12:18:49 +0000 |
commit | ccb7398c3d839f36fcbdcad1e3c9fc13f387713f (patch) | |
tree | 0f01385140274a3b71223cdad7d85bc8ff5721cc | |
parent | bf329564b7e5225ab9a305e62707230e9167c26b (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>
-rw-r--r-- | src/multimedia/shaders/p010le.frag | 4 | ||||
-rw-r--r-- | src/multimedia/video/qvideotexturehelper.cpp | 4 |
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 |