diff options
Diffstat (limited to 'runtime/shims/d3d12_com.cpp')
| -rw-r--r-- | runtime/shims/d3d12_com.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/shims/d3d12_com.cpp b/runtime/shims/d3d12_com.cpp index 55c6f86a8..7f6599b91 100644 --- a/runtime/shims/d3d12_com.cpp +++ b/runtime/shims/d3d12_com.cpp | |||
| @@ -433,9 +433,19 @@ public: | |||
| 433 | 433 | ||
| 434 | // The format picks the member of a typeless family to resolve as; the textures' own format is used. | 434 | // The format picks the member of a typeless family to resolve as; the textures' own format is used. |
| 435 | void STDMETHODCALLTYPE ResolveSubresource(ID3D12Resource* dst, UINT dst_subresource, ID3D12Resource* src, | 435 | void STDMETHODCALLTYPE ResolveSubresource(ID3D12Resource* dst, UINT dst_subresource, ID3D12Resource* src, |
| 436 | UINT src_subresource, DXGI_FORMAT) override { | 436 | UINT src_subresource, DXGI_FORMAT format) override { |
| 437 | d3d12_trace::record("ID3D12GraphicsCommandList::ResolveSubresource"); | 437 | d3d12_trace::record("ID3D12GraphicsCommandList::ResolveSubresource"); |
| 438 | if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); | 438 | if (type_ == D3D12_COMMAND_LIST_TYPE_BUNDLE) return check(false); |
| 439 | const auto integer_color = [](ID3D12Resource* resource) { | ||
| 440 | if (!resource) return false; | ||
| 441 | const auto desc = resource->GetDesc(); | ||
| 442 | return !(desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL) && | ||
| 443 | color_resolve_format_is_integer(desc.Format); | ||
| 444 | }; | ||
| 445 | if (color_resolve_format_is_integer(format) || integer_color(dst) || integer_color(src)) { | ||
| 446 | note_once("ResolveSubresource refused: integer colour formats cannot be resolved"); | ||
| 447 | return check(false); | ||
| 448 | } | ||
| 439 | check(list_.resolve_subresource({resource_id(dst), dst_subresource, resource_id(src), src_subresource})); | 449 | check(list_.resolve_subresource({resource_id(dst), dst_subresource, resource_id(src), src_subresource})); |
| 440 | } | 450 | } |
| 441 | 451 | ||