Rename ContextLost to DeviceLost
DeviceLost is a better name because we don't have a "context" as in
OpenGL.
Bug: dawn:153
Change-Id: Idf7fcb731a0e138f46a81fb31f0d11ff58b4fa96
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/10541
Reviewed-by: Kai Ninomiya <kainino@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
diff --git a/dawn.json b/dawn.json
index 9370c64..8f8f8fc 100644
--- a/dawn.json
+++ b/dawn.json
@@ -196,7 +196,7 @@
{"value": 0, "name": "success"},
{"value": 1, "name": "error"},
{"value": 2, "name": "unknown"},
- {"value": 3, "name": "context lost"}
+ {"value": 3, "name": "device lost"}
]
},
"buffer usage": {
@@ -580,7 +580,7 @@
{"value": 0, "name": "success"},
{"value": 1, "name": "error"},
{"value": 2, "name": "unknown"},
- {"value": 3, "name": "context lost"}
+ {"value": 3, "name": "device lost"}
]
},
"fence descriptor": {
diff --git a/generator/templates/opengl/OpenGLFunctionsBase.cpp b/generator/templates/opengl/OpenGLFunctionsBase.cpp
index 81e6f9f..bf5246f 100644
--- a/generator/templates/opengl/OpenGLFunctionsBase.cpp
+++ b/generator/templates/opengl/OpenGLFunctionsBase.cpp
@@ -20,7 +20,7 @@
MaybeError OpenGLFunctionsBase::LoadProc(GetProcAddress getProc, T* memberProc, const char* name) {
*memberProc = reinterpret_cast<T>(getProc(name));
if (DAWN_UNLIKELY(memberProc == nullptr)) {
- return DAWN_CONTEXT_LOST_ERROR(std::string("Couldn't load GL proc: ") + name);
+ return DAWN_DEVICE_LOST_ERROR(std::string("Couldn't load GL proc: ") + name);
}
return {};
}
diff --git a/src/dawn_native/Error.h b/src/dawn_native/Error.h
index 50ff9f0..82efbee 100644
--- a/src/dawn_native/Error.h
+++ b/src/dawn_native/Error.h
@@ -25,7 +25,7 @@
// file to avoid having all files including headers like <string> and <vector>
class ErrorData;
- enum class ErrorType : uint32_t { Validation, ContextLost, Unimplemented, OutOfMemory };
+ enum class ErrorType : uint32_t { Validation, DeviceLost, Unimplemented, OutOfMemory };
// MaybeError and ResultOrError are meant to be used as return value for function that are not
// expected to, but might fail. The handling of error is potentially much slower than successes.
@@ -46,7 +46,7 @@
#define DAWN_MAKE_ERROR(TYPE, MESSAGE) \
::dawn_native::MakeError(TYPE, MESSAGE, __FILE__, __func__, __LINE__)
#define DAWN_VALIDATION_ERROR(MESSAGE) DAWN_MAKE_ERROR(ErrorType::Validation, MESSAGE)
-#define DAWN_CONTEXT_LOST_ERROR(MESSAGE) DAWN_MAKE_ERROR(ErrorType::ContextLost, MESSAGE)
+#define DAWN_DEVICE_LOST_ERROR(MESSAGE) DAWN_MAKE_ERROR(ErrorType::DeviceLost, MESSAGE)
#define DAWN_UNIMPLEMENTED_ERROR(MESSAGE) DAWN_MAKE_ERROR(ErrorType::Unimplemented, MESSAGE)
#define DAWN_OUT_OF_MEMORY_ERROR(MESSAGE) DAWN_MAKE_ERROR(ErrorType::OutOfMemory, MESSAGE)
diff --git a/src/dawn_native/d3d12/AdapterD3D12.cpp b/src/dawn_native/d3d12/AdapterD3D12.cpp
index bb14171..c39791a 100644
--- a/src/dawn_native/d3d12/AdapterD3D12.cpp
+++ b/src/dawn_native/d3d12/AdapterD3D12.cpp
@@ -63,7 +63,7 @@
const PlatformFunctions* functions = GetBackend()->GetFunctions();
if (FAILED(functions->d3d12CreateDevice(GetHardwareAdapter(), D3D_FEATURE_LEVEL_11_0,
_uuidof(ID3D12Device), &mD3d12Device))) {
- return DAWN_CONTEXT_LOST_ERROR("D3D12CreateDevice failed");
+ return DAWN_DEVICE_LOST_ERROR("D3D12CreateDevice failed");
}
DAWN_TRY_ASSIGN(mDeviceInfo, GatherDeviceInfo(*this));
diff --git a/src/dawn_native/d3d12/BackendD3D12.cpp b/src/dawn_native/d3d12/BackendD3D12.cpp
index 473eedb..71beb6c 100644
--- a/src/dawn_native/d3d12/BackendD3D12.cpp
+++ b/src/dawn_native/d3d12/BackendD3D12.cpp
@@ -61,7 +61,7 @@
}
if (FAILED(functions->createDxgiFactory2(dxgiFactoryFlags, IID_PPV_ARGS(&factory)))) {
- return DAWN_CONTEXT_LOST_ERROR("Failed to create a DXGI factory");
+ return DAWN_DEVICE_LOST_ERROR("Failed to create a DXGI factory");
}
ASSERT(factory != nullptr);
diff --git a/src/dawn_native/d3d12/D3D12Info.cpp b/src/dawn_native/d3d12/D3D12Info.cpp
index 3b2b57d..1431b34 100644
--- a/src/dawn_native/d3d12/D3D12Info.cpp
+++ b/src/dawn_native/d3d12/D3D12Info.cpp
@@ -33,7 +33,7 @@
D3D12_FEATURE_DATA_ARCHITECTURE arch = {};
if (FAILED(adapter.GetDevice()->CheckFeatureSupport(D3D12_FEATURE_ARCHITECTURE, &arch,
sizeof(arch)))) {
- return DAWN_CONTEXT_LOST_ERROR("CheckFeatureSupport failed");
+ return DAWN_DEVICE_LOST_ERROR("CheckFeatureSupport failed");
}
info.isUMA = arch.UMA;
diff --git a/src/dawn_native/d3d12/PlatformFunctions.cpp b/src/dawn_native/d3d12/PlatformFunctions.cpp
index b3354b1..747cb68 100644
--- a/src/dawn_native/d3d12/PlatformFunctions.cpp
+++ b/src/dawn_native/d3d12/PlatformFunctions.cpp
@@ -44,7 +44,7 @@
"D3D12SerializeVersionedRootSignature", &error) ||
!mD3D12Lib.GetProc(&d3d12CreateVersionedRootSignatureDeserializer,
"D3D12CreateVersionedRootSignatureDeserializer", &error)) {
- return DAWN_CONTEXT_LOST_ERROR(error.c_str());
+ return DAWN_DEVICE_LOST_ERROR(error.c_str());
}
return {};
@@ -55,7 +55,7 @@
if (!mDXGILib.Open("dxgi.dll", &error) ||
!mDXGILib.GetProc(&dxgiGetDebugInterface1, "DXGIGetDebugInterface1", &error) ||
!mDXGILib.GetProc(&createDxgiFactory2, "CreateDXGIFactory2", &error)) {
- return DAWN_CONTEXT_LOST_ERROR(error.c_str());
+ return DAWN_DEVICE_LOST_ERROR(error.c_str());
}
return {};
@@ -65,7 +65,7 @@
std::string error;
if (!mD3DCompilerLib.Open("d3dcompiler_47.dll", &error) ||
!mD3DCompilerLib.GetProc(&d3dCompile, "D3DCompile", &error)) {
- return DAWN_CONTEXT_LOST_ERROR(error.c_str());
+ return DAWN_DEVICE_LOST_ERROR(error.c_str());
}
return {};
diff --git a/src/dawn_native/d3d12/StagingBufferD3D12.cpp b/src/dawn_native/d3d12/StagingBufferD3D12.cpp
index da5db48..6b6adfa 100644
--- a/src/dawn_native/d3d12/StagingBufferD3D12.cpp
+++ b/src/dawn_native/d3d12/StagingBufferD3D12.cpp
@@ -42,7 +42,7 @@
// TODO(bryan.bernhart@intel.com): Record the GPU pointer for generic non-upload usage.
if (FAILED(mUploadHeap->Map(0, nullptr, &mMappedPointer))) {
- return DAWN_CONTEXT_LOST_ERROR("Unable to map staging buffer.");
+ return DAWN_DEVICE_LOST_ERROR("Unable to map staging buffer.");
}
return {};
@@ -60,4 +60,4 @@
return mUploadHeap.Get();
}
-}} // namespace dawn_native::d3d12
\ No newline at end of file
+}} // namespace dawn_native::d3d12
diff --git a/src/dawn_native/metal/BackendMTL.mm b/src/dawn_native/metal/BackendMTL.mm
index febe38a..80287dd 100644
--- a/src/dawn_native/metal/BackendMTL.mm
+++ b/src/dawn_native/metal/BackendMTL.mm
@@ -52,7 +52,7 @@
}
if (vendorId == 0) {
- return DAWN_CONTEXT_LOST_ERROR("Failed to find vendor id with the device");
+ return DAWN_DEVICE_LOST_ERROR("Failed to find vendor id with the device");
}
// Set vendor id with 0
@@ -102,7 +102,7 @@
// Get a matching dictionary for the IOGraphicsAccelerator2
CFMutableDictionaryRef matchingDict = IORegistryEntryIDMatching([device registryID]);
if (matchingDict == nullptr) {
- return DAWN_CONTEXT_LOST_ERROR("Failed to create the matching dict for the device");
+ return DAWN_DEVICE_LOST_ERROR("Failed to create the matching dict for the device");
}
// IOServiceGetMatchingService will consume the reference on the matching dictionary,
@@ -110,7 +110,7 @@
io_registry_entry_t acceleratorEntry =
IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
if (acceleratorEntry == IO_OBJECT_NULL) {
- return DAWN_CONTEXT_LOST_ERROR(
+ return DAWN_DEVICE_LOST_ERROR(
"Failed to get the IO registry entry for the accelerator");
}
@@ -119,8 +119,7 @@
if (IORegistryEntryGetParentEntry(acceleratorEntry, kIOServicePlane, &deviceEntry) !=
kIOReturnSuccess) {
IOObjectRelease(acceleratorEntry);
- return DAWN_CONTEXT_LOST_ERROR(
- "Failed to get the IO registry entry for the device");
+ return DAWN_DEVICE_LOST_ERROR("Failed to get the IO registry entry for the device");
}
ASSERT(deviceEntry != IO_OBJECT_NULL);
diff --git a/src/dawn_native/metal/StagingBufferMTL.mm b/src/dawn_native/metal/StagingBufferMTL.mm
index 114b01d..491b35c 100644
--- a/src/dawn_native/metal/StagingBufferMTL.mm
+++ b/src/dawn_native/metal/StagingBufferMTL.mm
@@ -32,7 +32,7 @@
mMappedPointer = [mBuffer contents];
if (mMappedPointer == nullptr) {
- return DAWN_CONTEXT_LOST_ERROR("Unable to map staging buffer.");
+ return DAWN_DEVICE_LOST_ERROR("Unable to map staging buffer.");
}
return {};
@@ -47,4 +47,4 @@
return mBuffer;
}
-}} // namespace dawn_native::metal
\ No newline at end of file
+}} // namespace dawn_native::metal
diff --git a/src/dawn_native/null/DeviceNull.cpp b/src/dawn_native/null/DeviceNull.cpp
index 2ea0075..8fcfe0e 100644
--- a/src/dawn_native/null/DeviceNull.cpp
+++ b/src/dawn_native/null/DeviceNull.cpp
@@ -173,7 +173,7 @@
MaybeError Device::IncrementMemoryUsage(size_t bytes) {
static_assert(kMaxMemoryUsage <= std::numeric_limits<size_t>::max() / 2, "");
if (bytes > kMaxMemoryUsage || mMemoryUsage + bytes > kMaxMemoryUsage) {
- return DAWN_CONTEXT_LOST_ERROR("Out of memory.");
+ return DAWN_DEVICE_LOST_ERROR("Out of memory.");
}
mMemoryUsage += bytes;
return {};
diff --git a/src/dawn_native/opengl/OpenGLFunctions.cpp b/src/dawn_native/opengl/OpenGLFunctions.cpp
index d4a72b3..0bc5781 100644
--- a/src/dawn_native/opengl/OpenGLFunctions.cpp
+++ b/src/dawn_native/opengl/OpenGLFunctions.cpp
@@ -22,7 +22,7 @@
MaybeError OpenGLFunctions::Initialize(GetProcAddress getProc) {
PFNGLGETSTRINGPROC getString = reinterpret_cast<PFNGLGETSTRINGPROC>(getProc("glGetString"));
if (getString == nullptr) {
- return DAWN_CONTEXT_LOST_ERROR("Couldn't load glGetString");
+ return DAWN_DEVICE_LOST_ERROR("Couldn't load glGetString");
}
std::string version = reinterpret_cast<const char*>(getString(GL_VERSION));
diff --git a/src/dawn_native/vulkan/BackendVk.cpp b/src/dawn_native/vulkan/BackendVk.cpp
index e7516c2..dff6bbe 100644
--- a/src/dawn_native/vulkan/BackendVk.cpp
+++ b/src/dawn_native/vulkan/BackendVk.cpp
@@ -61,7 +61,7 @@
MaybeError Backend::Initialize() {
if (!mVulkanLib.Open(kVulkanLibName)) {
- return DAWN_CONTEXT_LOST_ERROR(std::string("Couldn't open ") + kVulkanLibName);
+ return DAWN_DEVICE_LOST_ERROR(std::string("Couldn't open ") + kVulkanLibName);
}
DAWN_TRY(mFunctions.LoadGlobalProcs(mVulkanLib));
diff --git a/src/dawn_native/vulkan/DeviceVk.cpp b/src/dawn_native/vulkan/DeviceVk.cpp
index 57c9eeb..025f2c7 100644
--- a/src/dawn_native/vulkan/DeviceVk.cpp
+++ b/src/dawn_native/vulkan/DeviceVk.cpp
@@ -397,7 +397,7 @@
}
if (universalQueueFamily == -1) {
- return DAWN_CONTEXT_LOST_ERROR("No universal queue family");
+ return DAWN_DEVICE_LOST_ERROR("No universal queue family");
}
mQueueFamily = static_cast<uint32_t>(universalQueueFamily);
}
diff --git a/src/dawn_native/vulkan/StagingBufferVk.cpp b/src/dawn_native/vulkan/StagingBufferVk.cpp
index 4e96f85..38bb84e 100644
--- a/src/dawn_native/vulkan/StagingBufferVk.cpp
+++ b/src/dawn_native/vulkan/StagingBufferVk.cpp
@@ -36,24 +36,24 @@
if (mDevice->fn.CreateBuffer(mDevice->GetVkDevice(), &createInfo, nullptr, &mBuffer) !=
VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("Unable to create staging buffer.");
+ return DAWN_DEVICE_LOST_ERROR("Unable to create staging buffer.");
}
VkMemoryRequirements requirements;
mDevice->fn.GetBufferMemoryRequirements(mDevice->GetVkDevice(), mBuffer, &requirements);
if (!mDevice->GetMemoryAllocator()->Allocate(requirements, true, &mAllocation)) {
- return DAWN_CONTEXT_LOST_ERROR("Unable to allocate memory for staging buffer.");
+ return DAWN_DEVICE_LOST_ERROR("Unable to allocate memory for staging buffer.");
}
if (mDevice->fn.BindBufferMemory(mDevice->GetVkDevice(), mBuffer, mAllocation.GetMemory(),
mAllocation.GetMemoryOffset()) != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("Unable to attach memory to the staging buffer.");
+ return DAWN_DEVICE_LOST_ERROR("Unable to attach memory to the staging buffer.");
}
mMappedPointer = mAllocation.GetMappedPointer();
if (mMappedPointer == nullptr) {
- return DAWN_CONTEXT_LOST_ERROR("Unable to map staging buffer.");
+ return DAWN_DEVICE_LOST_ERROR("Unable to map staging buffer.");
}
return {};
@@ -69,4 +69,4 @@
return mBuffer;
}
-}} // namespace dawn_native::vulkan
\ No newline at end of file
+}} // namespace dawn_native::vulkan
diff --git a/src/dawn_native/vulkan/VulkanError.cpp b/src/dawn_native/vulkan/VulkanError.cpp
index a01475c..543c9b0 100644
--- a/src/dawn_native/vulkan/VulkanError.cpp
+++ b/src/dawn_native/vulkan/VulkanError.cpp
@@ -67,7 +67,7 @@
}
std::string message = std::string(context) + " failed with " + VkResultAsString(result);
- return DAWN_CONTEXT_LOST_ERROR(message);
+ return DAWN_DEVICE_LOST_ERROR(message);
}
}} // namespace dawn_native::vulkan
diff --git a/src/dawn_native/vulkan/VulkanFunctions.cpp b/src/dawn_native/vulkan/VulkanFunctions.cpp
index b3e32e0..0d36776 100644
--- a/src/dawn_native/vulkan/VulkanFunctions.cpp
+++ b/src/dawn_native/vulkan/VulkanFunctions.cpp
@@ -22,12 +22,12 @@
#define GET_GLOBAL_PROC(name) \
name = reinterpret_cast<decltype(name)>(GetInstanceProcAddr(nullptr, "vk" #name)); \
if (name == nullptr) { \
- return DAWN_CONTEXT_LOST_ERROR(std::string("Couldn't get proc vk") + #name); \
+ return DAWN_DEVICE_LOST_ERROR(std::string("Couldn't get proc vk") + #name); \
}
MaybeError VulkanFunctions::LoadGlobalProcs(const DynamicLib& vulkanLib) {
if (!vulkanLib.GetProc(&GetInstanceProcAddr, "vkGetInstanceProcAddr")) {
- return DAWN_CONTEXT_LOST_ERROR("Couldn't get vkGetInstanceProcAddr");
+ return DAWN_DEVICE_LOST_ERROR("Couldn't get vkGetInstanceProcAddr");
}
GET_GLOBAL_PROC(CreateInstance);
@@ -44,7 +44,7 @@
#define GET_INSTANCE_PROC(name) \
name = reinterpret_cast<decltype(name)>(GetInstanceProcAddr(instance, "vk" #name)); \
if (name == nullptr) { \
- return DAWN_CONTEXT_LOST_ERROR(std::string("Couldn't get proc vk") + #name); \
+ return DAWN_DEVICE_LOST_ERROR(std::string("Couldn't get proc vk") + #name); \
}
MaybeError VulkanFunctions::LoadInstanceProcs(VkInstance instance,
@@ -106,10 +106,10 @@
return {};
}
-#define GET_DEVICE_PROC(name) \
- name = reinterpret_cast<decltype(name)>(GetDeviceProcAddr(device, "vk" #name)); \
- if (name == nullptr) { \
- return DAWN_CONTEXT_LOST_ERROR(std::string("Couldn't get proc vk") + #name); \
+#define GET_DEVICE_PROC(name) \
+ name = reinterpret_cast<decltype(name)>(GetDeviceProcAddr(device, "vk" #name)); \
+ if (name == nullptr) { \
+ return DAWN_DEVICE_LOST_ERROR(std::string("Couldn't get proc vk") + #name); \
}
MaybeError VulkanFunctions::LoadDeviceProcs(VkDevice device,
diff --git a/src/dawn_native/vulkan/VulkanInfo.cpp b/src/dawn_native/vulkan/VulkanInfo.cpp
index 2174662..f4f0284 100644
--- a/src/dawn_native/vulkan/VulkanInfo.cpp
+++ b/src/dawn_native/vulkan/VulkanInfo.cpp
@@ -67,13 +67,13 @@
// incomplete otherwise. This means that both values represent a success.
// This is the same for all Enumarte functions
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateInstanceLayerProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateInstanceLayerProperties");
}
info.layers.resize(count);
result = vkFunctions.EnumerateInstanceLayerProperties(&count, info.layers.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateInstanceLayerProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateInstanceLayerProperties");
}
for (const auto& layer : info.layers) {
@@ -95,14 +95,14 @@
VkResult result =
vkFunctions.EnumerateInstanceExtensionProperties(nullptr, &count, nullptr);
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateInstanceExtensionProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateInstanceExtensionProperties");
}
info.extensions.resize(count);
result = vkFunctions.EnumerateInstanceExtensionProperties(nullptr, &count,
info.extensions.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateInstanceExtensionProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateInstanceExtensionProperties");
}
for (const auto& extension : info.extensions) {
@@ -164,13 +164,13 @@
uint32_t count = 0;
VkResult result = vkFunctions.EnumeratePhysicalDevices(instance, &count, nullptr);
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumeratePhysicalDevices");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumeratePhysicalDevices");
}
std::vector<VkPhysicalDevice> physicalDevices(count);
result = vkFunctions.EnumeratePhysicalDevices(instance, &count, physicalDevices.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumeratePhysicalDevices");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumeratePhysicalDevices");
}
return physicalDevices;
@@ -212,14 +212,14 @@
VkResult result =
vkFunctions.EnumerateDeviceLayerProperties(physicalDevice, &count, nullptr);
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateDeviceLayerProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateDeviceLayerProperties");
}
info.layers.resize(count);
result = vkFunctions.EnumerateDeviceLayerProperties(physicalDevice, &count,
info.layers.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateDeviceLayerProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateDeviceLayerProperties");
}
}
@@ -229,14 +229,14 @@
VkResult result = vkFunctions.EnumerateDeviceExtensionProperties(
physicalDevice, nullptr, &count, nullptr);
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateDeviceExtensionProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateDeviceExtensionProperties");
}
info.extensions.resize(count);
result = vkFunctions.EnumerateDeviceExtensionProperties(physicalDevice, nullptr, &count,
info.extensions.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkEnumerateDeviceExtensionProperties");
+ return DAWN_DEVICE_LOST_ERROR("vkEnumerateDeviceExtensionProperties");
}
for (const auto& extension : info.extensions) {
@@ -277,7 +277,7 @@
VkResult result = vkFunctions.GetPhysicalDeviceSurfaceCapabilitiesKHR(
physicalDevice, surface, &info->capabilities);
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
+ return DAWN_DEVICE_LOST_ERROR("vkGetPhysicalDeviceSurfaceCapabilitiesKHR");
}
}
@@ -292,7 +292,7 @@
physicalDevice, i, surface, &supported);
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkGetPhysicalDeviceSurfaceSupportKHR");
+ return DAWN_DEVICE_LOST_ERROR("vkGetPhysicalDeviceSurfaceSupportKHR");
}
info->supportedQueueFamilies[i] = (supported == VK_TRUE);
@@ -305,14 +305,14 @@
VkResult result = vkFunctions.GetPhysicalDeviceSurfaceFormatsKHR(
physicalDevice, surface, &count, nullptr);
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkGetPhysicalDeviceSurfaceFormatsKHR");
+ return DAWN_DEVICE_LOST_ERROR("vkGetPhysicalDeviceSurfaceFormatsKHR");
}
info->formats.resize(count);
result = vkFunctions.GetPhysicalDeviceSurfaceFormatsKHR(physicalDevice, surface, &count,
info->formats.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkGetPhysicalDeviceSurfaceFormatsKHR");
+ return DAWN_DEVICE_LOST_ERROR("vkGetPhysicalDeviceSurfaceFormatsKHR");
}
}
@@ -322,14 +322,14 @@
VkResult result = vkFunctions.GetPhysicalDeviceSurfacePresentModesKHR(
physicalDevice, surface, &count, nullptr);
if (result != VK_SUCCESS && result != VK_INCOMPLETE) {
- return DAWN_CONTEXT_LOST_ERROR("vkGetPhysicalDeviceSurfacePresentModesKHR");
+ return DAWN_DEVICE_LOST_ERROR("vkGetPhysicalDeviceSurfacePresentModesKHR");
}
info->presentModes.resize(count);
result = vkFunctions.GetPhysicalDeviceSurfacePresentModesKHR(
physicalDevice, surface, &count, info->presentModes.data());
if (result != VK_SUCCESS) {
- return DAWN_CONTEXT_LOST_ERROR("vkGetPhysicalDeviceSurfacePresentModesKHR");
+ return DAWN_DEVICE_LOST_ERROR("vkGetPhysicalDeviceSurfacePresentModesKHR");
}
}
diff --git a/src/dawn_wire/client/ApiProcs.cpp b/src/dawn_wire/client/ApiProcs.cpp
index 64c2fe9..95d0e54 100644
--- a/src/dawn_wire/client/ApiProcs.cpp
+++ b/src/dawn_wire/client/ApiProcs.cpp
@@ -59,7 +59,7 @@
MemoryTransferService::ReadHandle* readHandle =
buffer->device->GetClient()->GetMemoryTransferService()->CreateReadHandle(buffer->size);
if (readHandle == nullptr) {
- callback(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0, userdata);
+ callback(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0, userdata);
return;
}
@@ -90,7 +90,7 @@
buffer->device->GetClient()->GetMemoryTransferService()->CreateWriteHandle(
buffer->size);
if (writeHandle == nullptr) {
- callback(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0, userdata);
+ callback(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0, userdata);
return;
}
@@ -223,7 +223,7 @@
result.buffer = reinterpret_cast<DawnBuffer>(buffer);
result.data = nullptr;
result.dataLength = 0;
- callback(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, result, userdata);
+ callback(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, result, userdata);
return;
}
diff --git a/src/dawn_wire/client/ClientDoers.cpp b/src/dawn_wire/client/ClientDoers.cpp
index 7cb0b52..abaa41c 100644
--- a/src/dawn_wire/client/ClientDoers.cpp
+++ b/src/dawn_wire/client/ClientDoers.cpp
@@ -88,7 +88,7 @@
if (!GetMappedData()) {
// Dawn promises that all callbacks are called in finite time. Even if a fatal error
// occurs, the callback is called.
- request.readCallback(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0,
+ request.readCallback(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0,
request.userdata);
return false;
} else {
@@ -152,7 +152,7 @@
if (!GetMappedData()) {
// Dawn promises that all callbacks are called in finite time. Even if a fatal error
// occurs, the callback is called.
- request.writeCallback(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0,
+ request.writeCallback(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0,
request.userdata);
return false;
} else {
diff --git a/src/tests/unittests/wire/WireMemoryTransferServiceTests.cpp b/src/tests/unittests/wire/WireMemoryTransferServiceTests.cpp
index 3feb809..21c7c94 100644
--- a/src/tests/unittests/wire/WireMemoryTransferServiceTests.cpp
+++ b/src/tests/unittests/wire/WireMemoryTransferServiceTests.cpp
@@ -513,9 +513,9 @@
MockReadHandleCreationFailure();
// Failed creation of a ReadHandle is a fatal failure and the client synchronously receives a
- // CONTEXT_LOST callback.
+ // DEVICE_LOST callback.
EXPECT_CALL(*mockBufferMapReadCallback,
- Call(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0, _))
+ Call(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0, _))
.Times(1);
dawnBufferMapReadAsync(buffer, ToMockBufferMapReadCallback, nullptr);
@@ -580,9 +580,9 @@
MockClientReadHandleDeserializeInitializeFailure(clientHandle);
// Failed deserialization is a fatal failure and the client synchronously receives a
- // CONTEXT_LOST callback.
+ // DEVICE_LOST callback.
EXPECT_CALL(*mockBufferMapReadCallback,
- Call(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0, _))
+ Call(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0, _))
.Times(1);
// The handle will be destroyed since deserializing failed.
@@ -702,9 +702,9 @@
MockWriteHandleCreationFailure();
// Failed creation of a WriteHandle is a fatal failure and the client synchronously receives a
- // CONTEXT_LOST callback.
+ // DEVICE_LOST callback.
EXPECT_CALL(*mockBufferMapWriteCallback,
- Call(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0, _))
+ Call(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0, _))
.Times(1);
dawnBufferMapWriteAsync(buffer, ToMockBufferMapWriteCallback, nullptr);
@@ -765,9 +765,9 @@
// Mock a failure.
MockClientWriteHandleOpenFailure(clientHandle);
- // Failing to open a handle is a fatal failure and the client receives a CONTEXT_LOST callback.
+ // Failing to open a handle is a fatal failure and the client receives a DEVICE_LOST callback.
EXPECT_CALL(*mockBufferMapWriteCallback,
- Call(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, nullptr, 0, _))
+ Call(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, nullptr, 0, _))
.Times(1);
// Since opening the handle fails, it gets destroyed immediately.
@@ -885,9 +885,9 @@
descriptor.size = sizeof(mBufferContent);
// Failed creation of a WriteHandle is a fatal failure. The client synchronously receives
- // a CONTEXT_LOST callback.
+ // a DEVICE_LOST callback.
EXPECT_CALL(*mockCreateBufferMappedCallback,
- Call(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, _, nullptr, 0, _))
+ Call(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, _, nullptr, 0, _))
.Times(1);
dawnDeviceCreateBufferMappedAsync(device, &descriptor, ToMockCreateBufferMappedCallback, nullptr);
@@ -934,9 +934,9 @@
// Since the mapping succeeds, the client opens the WriteHandle.
MockClientWriteHandleOpenFailure(clientHandle);
- // Failing to open a handle is a fatal failure. The client receives a CONTEXT_LOST callback.
+ // Failing to open a handle is a fatal failure. The client receives a DEVICE_LOST callback.
EXPECT_CALL(*mockCreateBufferMappedCallback,
- Call(DAWN_BUFFER_MAP_ASYNC_STATUS_CONTEXT_LOST, _, nullptr, 0, _))
+ Call(DAWN_BUFFER_MAP_ASYNC_STATUS_DEVICE_LOST, _, nullptr, 0, _))
.Times(1);
// Since opening the handle fails, it is destroyed immediately.