microsoft / D3D12TranslationLayer

A library containing utilities for mapping higher-level graphics work to D3D12
MIT License
327 stars 47 forks source link

Fix BlitHelper::ResolveToNonMsaa #50

Closed vdwtanner closed 2 years ago

vdwtanner commented 2 years ago

D3D12's ResolveSubresource expects the destination dimensions to be as large or larger than the source (taking into account msaa scaling). The apps we were testing with happened to call blit with a source Rect of matching dimensions, so when we created our intermediate resource in ResolveToNonMsaa we had the appropriate size. This doesn't work when the app only blits a section of the source resource though. In this case our intermediate resource ends up being too small and the resolve fails. The solution is to create an intermediate resource of the same size as the source resource's underlying d3d12 resource.