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>
This commit is contained in:
parent
4078ed8b62
commit
5603dc9044
|
@ -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": {
|
||||
|
|
|
@ -20,7 +20,7 @@ template<typename T>
|
|||
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 {};
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace dawn_native {
|
|||
// 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 @@ namespace dawn_native {
|
|||
#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)
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
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));
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
}
|
||||
|
||||
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);
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
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;
|
||||
|
|
|
@ -44,7 +44,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
"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 @@ namespace dawn_native { namespace d3d12 {
|
|||
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 @@ namespace dawn_native { namespace d3d12 {
|
|||
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 {};
|
||||
|
|
|
@ -42,7 +42,7 @@ namespace dawn_native { namespace d3d12 {
|
|||
// 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 @@ namespace dawn_native { namespace d3d12 {
|
|||
return mUploadHeap.Get();
|
||||
}
|
||||
|
||||
}} // namespace dawn_native::d3d12
|
||||
}} // namespace dawn_native::d3d12
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace dawn_native { namespace metal {
|
|||
}
|
||||
|
||||
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 @@ namespace dawn_native { namespace metal {
|
|||
// 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 @@ namespace dawn_native { namespace metal {
|
|||
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 @@ namespace dawn_native { namespace metal {
|
|||
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);
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace dawn_native { namespace metal {
|
|||
|
||||
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 @@ namespace dawn_native { namespace metal {
|
|||
return mBuffer;
|
||||
}
|
||||
|
||||
}} // namespace dawn_native::metal
|
||||
}} // namespace dawn_native::metal
|
||||
|
|
|
@ -173,7 +173,7 @@ namespace dawn_native { namespace null {
|
|||
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 {};
|
||||
|
|
|
@ -22,7 +22,7 @@ namespace dawn_native { namespace opengl {
|
|||
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));
|
||||
|
|
|
@ -61,7 +61,7 @@ namespace dawn_native { namespace vulkan {
|
|||
|
||||
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));
|
||||
|
|
|
@ -397,7 +397,7 @@ namespace dawn_native { namespace vulkan {
|
|||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -36,24 +36,24 @@ namespace dawn_native { namespace vulkan {
|
|||
|
||||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
return mBuffer;
|
||||
}
|
||||
|
||||
}} // namespace dawn_native::vulkan
|
||||
}} // namespace dawn_native::vulkan
|
||||
|
|
|
@ -67,7 +67,7 @@ namespace dawn_native { namespace vulkan {
|
|||
}
|
||||
|
||||
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
|
||||
|
|
|
@ -22,12 +22,12 @@ namespace dawn_native { namespace vulkan {
|
|||
#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 @@ namespace dawn_native { namespace vulkan {
|
|||
#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 @@ namespace dawn_native { namespace vulkan {
|
|||
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,
|
||||
|
|
|
@ -67,13 +67,13 @@ namespace dawn_native { namespace vulkan {
|
|||
// 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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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 @@ namespace dawn_native { namespace vulkan {
|
|||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace dawn_wire { namespace client {
|
|||
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 @@ namespace dawn_wire { namespace client {
|
|||
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 @@ namespace dawn_wire { namespace client {
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace dawn_wire { namespace client {
|
|||
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 @@ namespace dawn_wire { namespace client {
|
|||
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 {
|
||||
|
|
|
@ -513,9 +513,9 @@ TEST_F(WireMemoryTransferServiceTests, BufferMapReadHandleCreationFailure) {
|
|||
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 @@ TEST_F(WireMemoryTransferServiceTests, BufferMapReadDeserializeInitialDataFailur
|
|||
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 @@ TEST_F(WireMemoryTransferServiceTests, BufferMapWriteHandleCreationFailure) {
|
|||
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 @@ TEST_F(WireMemoryTransferServiceTests, BufferMapWriteHandleOpenFailure) {
|
|||
// 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 @@ TEST_F(WireMemoryTransferServiceTests, CreateBufferMappedAsyncWriteHandleCreatio
|
|||
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 @@ TEST_F(WireMemoryTransferServiceTests, CreateBufferMappedAsyncHandleOpenFailure)
|
|||
// 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.
|
||||
|
|
Loading…
Reference in New Issue