d3d12: Fix warnings reported by debug layer

Fixing below debug layer report
ID3D12Device::CreateCommittedResource: Ignoring InitialState D3D12_RESOURCE_STATE_COPY_DEST.
Buffers are effectively created in state D3D12_RESOURCE_STATE_COMMON.

Buffer resource will be automatically promoted to D3D12_RESOURCE_STATE_COPY_DEST
at the very first COPY operation time.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5895>
This commit is contained in:
Seungha Yang 2024-01-09 20:27:36 +09:00 committed by GStreamer Marge Bot
parent e1ecd1de2f
commit 7f2b4b6b09
3 changed files with 6 additions and 7 deletions

View file

@ -458,8 +458,7 @@ struct BackgroundRender
heap_prop = CD3DX12_HEAP_PROPERTIES (D3D12_HEAP_TYPE_DEFAULT); heap_prop = CD3DX12_HEAP_PROPERTIES (D3D12_HEAP_TYPE_DEFAULT);
hr = device_handle->CreateCommittedResource (&heap_prop, hr = device_handle->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, &buffer_desc, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, &buffer_desc,
D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_COMMON, nullptr, IID_PPV_ARGS (&vertex_index_buf));
nullptr, IID_PPV_ARGS (&vertex_index_buf));
if (!gst_d3d12_result (hr, device)) { if (!gst_d3d12_result (hr, device)) {
GST_ERROR_OBJECT (device, "Couldn't create index buffer"); GST_ERROR_OBJECT (device, "Couldn't create index buffer");
return; return;

View file

@ -766,7 +766,7 @@ gst_d3d12_converter_setup_resource (GstD3D12Converter * self,
sizeof (g_indices)); sizeof (g_indices));
hr = device->CreateCommittedResource (&heap_prop, hr = device->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED,
&resource_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, &resource_desc, D3D12_RESOURCE_STATE_COMMON, nullptr,
IID_PPV_ARGS (&priv->vertex_index_buf)); IID_PPV_ARGS (&priv->vertex_index_buf));
if (!gst_d3d12_result (hr, self->device)) { if (!gst_d3d12_result (hr, self->device)) {
GST_ERROR_OBJECT (self, "Couldn't create vertex buffer"); GST_ERROR_OBJECT (self, "Couldn't create vertex buffer");
@ -808,7 +808,7 @@ gst_d3d12_converter_setup_resource (GstD3D12Converter * self,
resource_desc = CD3DX12_RESOURCE_DESC::Buffer (sizeof (PSConstBuffer)); resource_desc = CD3DX12_RESOURCE_DESC::Buffer (sizeof (PSConstBuffer));
hr = device->CreateCommittedResource (&heap_prop, hr = device->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED,
&resource_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, &resource_desc, D3D12_RESOURCE_STATE_COMMON, nullptr,
IID_PPV_ARGS (&priv->ps_const_buf)); IID_PPV_ARGS (&priv->ps_const_buf));
if (!gst_d3d12_result (hr, self->device)) { if (!gst_d3d12_result (hr, self->device)) {
GST_ERROR_OBJECT (self, "Couldn't create const buffer"); GST_ERROR_OBJECT (self, "Couldn't create const buffer");

View file

@ -560,7 +560,7 @@ setup_snow_render (GstD3D12TestSrc * self, RenderContext * ctx,
ComPtr < ID3D12Resource > vertex_index_buf; ComPtr < ID3D12Resource > vertex_index_buf;
hr = device->CreateCommittedResource (&heap_prop, hr = device->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED,
&buffer_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, &buffer_desc, D3D12_RESOURCE_STATE_COMMON, nullptr,
IID_PPV_ARGS (&vertex_index_buf)); IID_PPV_ARGS (&vertex_index_buf));
if (!gst_d3d12_result (hr, self->device)) { if (!gst_d3d12_result (hr, self->device)) {
GST_ERROR_OBJECT (self, "Couldn't create index buffer"); GST_ERROR_OBJECT (self, "Couldn't create index buffer");
@ -938,7 +938,7 @@ setup_smpte_render (GstD3D12TestSrc * self, RenderContext * ctx)
ComPtr < ID3D12Resource > vertex_index_buf; ComPtr < ID3D12Resource > vertex_index_buf;
hr = device->CreateCommittedResource (&heap_prop, hr = device->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED,
&buffer_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, &buffer_desc, D3D12_RESOURCE_STATE_COMMON, nullptr,
IID_PPV_ARGS (&vertex_index_buf)); IID_PPV_ARGS (&vertex_index_buf));
if (!gst_d3d12_result (hr, self->device)) { if (!gst_d3d12_result (hr, self->device)) {
GST_ERROR_OBJECT (self, "Couldn't create index buffer"); GST_ERROR_OBJECT (self, "Couldn't create index buffer");
@ -1104,7 +1104,7 @@ setup_checker_render (GstD3D12TestSrc * self, RenderContext * ctx,
ComPtr < ID3D12Resource > vertex_index_buf; ComPtr < ID3D12Resource > vertex_index_buf;
hr = device->CreateCommittedResource (&heap_prop, hr = device->CreateCommittedResource (&heap_prop,
D3D12_HEAP_FLAG_CREATE_NOT_ZEROED, D3D12_HEAP_FLAG_CREATE_NOT_ZEROED,
&buffer_desc, D3D12_RESOURCE_STATE_COPY_DEST, nullptr, &buffer_desc, D3D12_RESOURCE_STATE_COMMON, nullptr,
IID_PPV_ARGS (&vertex_index_buf)); IID_PPV_ARGS (&vertex_index_buf));
if (!gst_d3d12_result (hr, self->device)) { if (!gst_d3d12_result (hr, self->device)) {
GST_ERROR_OBJECT (self, "Couldn't create index buffer"); GST_ERROR_OBJECT (self, "Couldn't create index buffer");