 +    deptTexDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL;
 +    deptTexDesc.CPUAccessFlags = 0;
 +    deptTexDesc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT;
-+    deptTexDesc.Width = fmt->i_visible_width * 2;
++    deptTexDesc.Width = fmt->i_visible_width;
 +    deptTexDesc.Height = fmt->i_visible_height;
 +    deptTexDesc.MipLevels = 1;
 +    deptTexDesc.MiscFlags = 0;

+    ID3D11Texture2D* pDepthStencil= NULL;
+    HRESULT hr;
+
+    fmt->i_chroma = VLC_CODEC_RGBA;
+    sys->d3dregion_format = DXGI_FORMAT_R8G8B8A8_UNORM;
+
+    hr = IDXGISwapChain_GetBuffer(sys->dxgi_swapChain, 0, &IID_ID3D11Texture2D, (LPVOID*)&pBackBuffer);
+    if (FAILED(hr)) {

+    set_help(D3D11_HELP)
+    set_category(CAT_VIDEO)
+    set_subcategory(SUBCAT_VIDEO_VOUT)
+    set_capability("vout display", 240)
+    add_shortcut("direct3d11")
+    set_callbacks(Open, Close)
+vlc_module_end ()
+
+typedef struct
+{
+    const char   *name;
+    DXGI_FORMAT  format;
+    vlc_fourcc_t fourcc;
+} d3d_format_t;
+
+static const d3d_format_t d3d_formats[] = {
+    { "NV12",   DXGI_FORMAT_NV12,             VLC_CODEC_NV12  },
+    { "YUY2",   DXGI_FORMAT_YUY2,             VLC_CODEC_YUYV  },
+    { "RGBA",   DXGI_FORMAT_R8G8B8A8_UNORM,   VLC_CODEC_RGBA  },
+    { NULL, 0, 0 }
+};
+
+static const vlc_fourcc_t d3d_subpicture_chromas[] = {
