Aug 29, 2023, 06:15 by tong1.wu-at-intel....@ffmpeg.org:

> +
> +    /**
> +     * Specifed by sync=1 when init d3d12va
> +     *
> +     * Execute commands as sync mode
> +     */
> +    int sync;
>

This is not needed, particularly in the public API.

> +    if (download) {
> +        ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, 
> &barrier);
> +
> +        ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list,
> +            &staging_y_location, 0, 0, 0, &texture_y_location, NULL);
> +
> +        ID3D12GraphicsCommandList_CopyTextureRegion(s->command_list,
> +            &staging_uv_location, 0, 0, 0, &texture_uv_location, NULL);
> +
> +        barrier.Transition.StateBefore = barrier.Transition.StateAfter;
> +        barrier.Transition.StateAfter = D3D12_RESOURCE_STATE_COMMON;
> +        ID3D12GraphicsCommandList_ResourceBarrier(s->command_list, 1, 
> &barrier);
> +
> +        DX_CHECK(ID3D12GraphicsCommandList_Close(s->command_list));
> +
> +        if (!hwctx->sync)
> +            DX_CHECK(ID3D12CommandQueue_Wait(s->command_queue, 
> sync_ctx->fence, sync_ctx->fence_value));

This is wrong. When downloading to RAM, the frames must
always be available and fully downloaded by the time the function
returns. Therefore, a wait must always occur.
Since this is the only place where sync is used, better remove the
option altogether.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to