Skip to content

Commit f2ca940

Browse files
committed
Improve map access flags passed to events in D3D12
1 parent 9cbd74d commit f2ca940

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

source/d3d12/d3d12_resource.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ HRESULT STDMETHODCALLTYPE ID3D12Resource_Map(ID3D12Resource *pResource, UINT Sub
6666
to_handle(pResource),
6767
0,
6868
std::numeric_limits<uint64_t>::max(),
69-
reshade::api::map_access::read_write,
69+
pReadRange != nullptr && pReadRange->End <= pReadRange->Begin ? reshade::api::map_access::write_only : reshade::api::map_access::read_write,
7070
ppData);
7171
}
7272
else if (ppData != nullptr)
@@ -84,7 +84,7 @@ HRESULT STDMETHODCALLTYPE ID3D12Resource_Map(ID3D12Resource *pResource, UINT Sub
8484
to_handle(pResource),
8585
Subresource,
8686
nullptr,
87-
reshade::api::map_access::read_write,
87+
pReadRange != nullptr && pReadRange->End <= pReadRange->Begin ? reshade::api::map_access::write_only : reshade::api::map_access::read_write,
8888
&data);
8989

9090
*ppData = data.data;
@@ -96,7 +96,7 @@ HRESULT STDMETHODCALLTYPE ID3D12Resource_Map(ID3D12Resource *pResource, UINT Sub
9696
to_handle(pResource),
9797
Subresource,
9898
nullptr,
99-
reshade::api::map_access::read_write,
99+
pReadRange != nullptr && pReadRange->End <= pReadRange->Begin ? reshade::api::map_access::write_only : reshade::api::map_access::read_write,
100100
nullptr);
101101
}
102102
}

0 commit comments

Comments
 (0)