From e2eff3e4a36c363223841d6ff432b071421102b5 Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 10 Feb 2024 20:11:29 +0900 Subject: [PATCH] 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: --- subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp index a651f794fb..c8211a78b9 100644 --- a/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d12/gstd3d12decoder.cpp @@ -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;