зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1386487 - Add checking mechanism if ID3D11Buffer created fail. r=rhunt, dvander
This commit is contained in:
Родитель
79f2a178d9
Коммит
ab39d5cc75
|
@ -625,7 +625,11 @@ MLGBufferD3D11::Create(ID3D11Device* aDevice,
|
|||
data.SysMemSlicePitch = 0;
|
||||
|
||||
RefPtr<ID3D11Buffer> buffer;
|
||||
aDevice->CreateBuffer(&desc, aInitialData ? &data : nullptr, getter_AddRefs(buffer));
|
||||
HRESULT hr = aDevice->CreateBuffer(&desc, aInitialData ? &data : nullptr, getter_AddRefs(buffer));
|
||||
if (FAILED(hr) || !buffer) {
|
||||
gfxCriticalError() << "Failed to create ID3D11Buffer.";
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return new MLGBufferD3D11(buffer, aType, aSize);
|
||||
}
|
||||
|
@ -1337,6 +1341,7 @@ bool
|
|||
MLGDeviceD3D11::Map(MLGResource* aResource, MLGMapType aType, MLGMappedResource* aMap)
|
||||
{
|
||||
ID3D11Resource* resource = aResource->AsResourceD3D11()->GetResource();
|
||||
MOZ_ASSERT(resource);
|
||||
|
||||
D3D11_MAPPED_SUBRESOURCE map;
|
||||
HRESULT hr = mCtx->Map(resource, 0, ToD3D11Map(aType), 0, &map);
|
||||
|
|
Загрузка…
Ссылка в новой задаче