Bug 1497294 - P6. Fix NV12 playback on legacy D3D11 compositor. r=mattwoodrow
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 11 Oct 2018 01:44:44 +0000
changeset 499199 227a0a6ae1dfbadd73f96c64a307d001fb351108
parent 499198 e62671b3410d0a27ab55852aff7aaca9c7deca5d
child 499200 1b12b56178b666c0f0493d62a8b6aa368d0758b7
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1497294
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497294 - P6. Fix NV12 playback on legacy D3D11 compositor. r=mattwoodrow Depends on D8203 Differential Revision: https://phabricator.services.mozilla.com/D8246
gfx/layers/d3d11/CompositorD3D11.cpp
--- a/gfx/layers/d3d11/CompositorD3D11.cpp
+++ b/gfx/layers/d3d11/CompositorD3D11.cpp
@@ -862,16 +862,19 @@ CompositorD3D11::DrawGeometry(const Geom
                                         &srvDesc,
                                         getter_AddRefs(srViewCbCr));
 
       ID3D11ShaderResourceView* views[] = { srViewY, srViewCbCr };
       mContext->PSSetShaderResources(TexSlot::Y, 2, views);
 
       const float* yuvToRgb = gfxUtils::YuvToRgbMatrix4x3RowMajor(YUVColorSpace::BT601);
       memcpy(&mPSConstants.yuvColorMatrix, yuvToRgb, sizeof(mPSConstants.yuvColorMatrix));
+      // TOTO: need to handle color depth properly. this assumes data is always
+      // 8 or 16 bits.
+      mPSConstants.vCoefficient[0] = 1.0;
 
       SetSamplerForSamplingFilter(texturedEffect->mSamplingFilter);
     }
     break;
   case EffectTypes::YCBCR: {
       EffectYCbCr* ycbcrEffect =
         static_cast<EffectYCbCr*>(aEffectChain.mPrimaryEffect.get());