d3d12decoder: Fix bitstream buffer usage

Resource state of a buffer in upload heap should stay in
generic-read although it's effectively in common state. Some drivers
complains about the wrong state.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6088>
This commit is contained in:
Seungha Yang 2024-02-10 20:11:29 +09:00
parent b3a29b61c5
commit e2eff3e4a3

View file

@ -987,7 +987,7 @@ gst_d3d12_decoder_upload_bitstream (GstD3D12Decoder * self, gpointer data,
D3D12_RESOURCE_DESC desc = CD3DX12_RESOURCE_DESC::Buffer (alloc_size);
hr = priv->cmd->device->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, &desc,
D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS (&bitstream));
D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, IID_PPV_ARGS (&bitstream));
if (!gst_d3d12_result (hr, self->device)) {
GST_ERROR_OBJECT (self, "Failed to create bitstream buffer");
return FALSE;