[PATCH 0/2] MR126: Silence warnings for null map ranges.
From: Conor McCarthy <cmccarthy(a)codeweavers.com> --- libs/vkd3d/resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 8c050cfe..4754b038 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1259,7 +1259,8 @@ static HRESULT STDMETHODCALLTYPE d3d12_resource_Map(ID3D12Resource *iface, UINT return E_NOTIMPL; } - WARN("Ignoring read range %p.\n", read_range); + if (read_range) + WARN("Ignoring read range %p.\n", read_range); if (FAILED(hr = d3d12_heap_map(resource->heap, resource->heap_offset, resource, data))) WARN("Failed to map resource %p, hr %#x.\n", resource, hr); -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/126
From: Conor McCarthy <cmccarthy(a)codeweavers.com> --- libs/vkd3d/resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/resource.c b/libs/vkd3d/resource.c index 4754b038..7a155370 100644 --- a/libs/vkd3d/resource.c +++ b/libs/vkd3d/resource.c @@ -1287,7 +1287,8 @@ static void STDMETHODCALLTYPE d3d12_resource_Unmap(ID3D12Resource *iface, UINT s return; } - WARN("Ignoring written range %p.\n", written_range); + if (written_range) + WARN("Ignoring written range %p.\n", written_range); d3d12_heap_unmap(resource->heap, resource); } -- GitLab https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/126
My understanding is that if no range is specified then it is understood that the whole resource might be read. If the resource is already mapped `vkInvalidateMappedMemoryRanges()` should be called to ensure the CPU sees a fresh copy. Ignoring this request is a departure from the D3D12 semantics we should emulate, so the `WARN()` should be retained (or maybe it should be a `FIXME()`?). It could be dropped, instead, if the resource is going to be freshly mapped, independently of the read range, I think. -- https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/126#note_27042
participants (3)
-
Conor McCarthy -
Conor McCarthy (@cmccarthy) -
Giovanni Mascellani (@giomasce)