File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -7722,7 +7722,7 @@ HRESULT AllocatorPimpl::GetResourceAllocationInfoMiddle(
7722
7722
}
7723
7723
7724
7724
outAllocInfo = GetResourceAllocationInfoNative (inOutResourceDesc);
7725
- return S_OK;
7725
+ return outAllocInfo. SizeInBytes != UINT64_MAX ? S_OK : E_INVALIDARG ;
7726
7726
}
7727
7727
7728
7728
#ifdef __ID3D12Device8_INTERFACE_DEFINED__
@@ -7738,15 +7738,15 @@ HRESULT AllocatorPimpl::GetResourceAllocationInfoMiddle(
7738
7738
if (m_Device12 != NULL )
7739
7739
{
7740
7740
outAllocInfo = GetResourceAllocationInfo3Native (inOutResourceDesc, NumCastableFormats, pCastableFormats);
7741
- return S_OK;
7741
+ return outAllocInfo. SizeInBytes != UINT64_MAX ? S_OK : E_INVALIDARG ;
7742
7742
}
7743
7743
#else
7744
7744
return E_NOTIMPL;
7745
7745
#endif
7746
7746
}
7747
7747
7748
7748
outAllocInfo = GetResourceAllocationInfo2Native (inOutResourceDesc);
7749
- return S_OK;
7749
+ return outAllocInfo. SizeInBytes != UINT64_MAX ? S_OK : E_INVALIDARG ;
7750
7750
}
7751
7751
7752
7752
#endif // #ifdef __ID3D12Device8_INTERFACE_DEFINED__
Original file line number Diff line number Diff line change @@ -3152,10 +3152,18 @@ static void TestDevice12(const TestContext& ctx)
3152
3152
3153
3153
ComPtr<D3D12MA::Allocation> alloc0;
3154
3154
ComPtr<ID3D12Resource> res0;
3155
- CHECK_HR ( ctx.allocator ->CreateResource3 (&allocDesc, &resourceDesc,
3155
+ HRESULT hr = ctx.allocator ->CreateResource3 (&allocDesc, &resourceDesc,
3156
3156
D3D12_BARRIER_LAYOUT_UNDEFINED, NULL ,
3157
3157
_countof (castableFormats), castableFormats,
3158
- &alloc0, IID_PPV_ARGS (&res0)));
3158
+ &alloc0, IID_PPV_ARGS (&res0));
3159
+
3160
+ if (hr == E_INVALIDARG)
3161
+ {
3162
+ wprintf (L" Allocator::CreateResource3 failed with E_INVALIDARG!\n " );
3163
+ return ;
3164
+ }
3165
+
3166
+ CHECK_HR (hr);
3159
3167
CHECK_BOOL (alloc0 && res0);
3160
3168
}
3161
3169
#endif // #ifdef __ID3D12Device12_INTERFACE_DEFINED__
You can’t perform that action at this time.
0 commit comments