Commit a212c6a3 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

direct3d11: use the same size for the staging texture as the source picture

So we don't need to deal with 2 ways to position the texture.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent f93786b8
......@@ -741,8 +741,8 @@ static picture_pool_t *Pool(vout_display_t *vd, unsigned pool_size)
/* we need a staging texture */
video_format_t staging_fmt;
video_format_Copy(&staging_fmt, &surface_fmt);
staging_fmt.i_width = staging_fmt.i_visible_width;
staging_fmt.i_height = staging_fmt.i_visible_height;
staging_fmt.i_width = staging_fmt.i_width;
staging_fmt.i_height = staging_fmt.i_height;
if ( sys->picQuadConfig->formatTexture != DXGI_FORMAT_R8G8B8A8_UNORM &&
sys->picQuadConfig->formatTexture != DXGI_FORMAT_B5G6R5_UNORM )
{
......@@ -1128,11 +1128,13 @@ static void Prepare(vout_display_t *vd, picture_t *picture, subpicture_t *subpic
if (!is_d3d11_opaque(picture->format.i_chroma))
Direct3D11UnmapPoolTexture(picture);
ID3D11Texture2D_GetDesc(sys->stagingSys.texture[0], &texDesc);
assert(picture->format.i_x_offset + picture->format.i_visible_width <= texDesc.Width);
assert(picture->format.i_y_offset + picture->format.i_visible_height <= texDesc.Height);
D3D11_BOX box = {
.top = picture->format.i_y_offset,
.bottom = picture->format.i_y_offset + texDesc.Height,
.left = picture->format.i_x_offset,
.right = picture->format.i_x_offset + texDesc.Width,
.top = 0,
.bottom = picture->format.i_y_offset + picture->format.i_visible_height,
.left = 0,
.right = picture->format.i_x_offset + picture->format.i_visible_width,
.back = 1,
};
ID3D11DeviceContext_CopySubresourceRegion(sys->d3dcontext,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment