Fix compilation of VkResult changes on MSVC and ChromeOS
Bug: dawn:295 Change-Id: I8156af4789fca155163e8beed57805eefe6ec686 Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/14640 Reviewed-by: Austin Eng <enga@chromium.org> Commit-Queue: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
1586b4d73e
commit
c073adaa76
|
@ -18,8 +18,12 @@
|
||||||
|
|
||||||
namespace dawn_native { namespace vulkan {
|
namespace dawn_native { namespace vulkan {
|
||||||
|
|
||||||
const char* VkResultAsString(VkResult result) {
|
const char* VkResultAsString(::VkResult result) {
|
||||||
switch (result) {
|
// Convert to a uint32_t to silence and MSVC warning that the fake errors don't appear in
|
||||||
|
// the original VkResult enum.
|
||||||
|
uint32_t code = static_cast<uint32_t>(result);
|
||||||
|
|
||||||
|
switch (code) {
|
||||||
case VK_SUCCESS:
|
case VK_SUCCESS:
|
||||||
return "VK_SUCCESS";
|
return "VK_SUCCESS";
|
||||||
case VK_NOT_READY:
|
case VK_NOT_READY:
|
||||||
|
|
|
@ -24,7 +24,7 @@ constexpr VkResult VK_FAKE_DEVICE_OOM_FOR_TESTING = static_cast<VkResult>(VK_RES
|
||||||
namespace dawn_native { namespace vulkan {
|
namespace dawn_native { namespace vulkan {
|
||||||
|
|
||||||
// Returns a string version of the result.
|
// Returns a string version of the result.
|
||||||
const char* VkResultAsString(VkResult result);
|
const char* VkResultAsString(::VkResult result);
|
||||||
|
|
||||||
MaybeError CheckVkSuccessImpl(VkResult result, const char* context);
|
MaybeError CheckVkSuccessImpl(VkResult result, const char* context);
|
||||||
MaybeError CheckVkOOMThenSuccessImpl(VkResult result, const char* context);
|
MaybeError CheckVkOOMThenSuccessImpl(VkResult result, const char* context);
|
||||||
|
|
|
@ -141,8 +141,9 @@ namespace dawn_native { namespace vulkan { namespace external_memory {
|
||||||
imageFormatProps.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
|
imageFormatProps.sType = VK_STRUCTURE_TYPE_IMAGE_FORMAT_PROPERTIES_2;
|
||||||
imageFormatProps.pNext = &externalImageFormatProps;
|
imageFormatProps.pNext = &externalImageFormatProps;
|
||||||
|
|
||||||
VkResult result = mDevice->fn.GetPhysicalDeviceImageFormatProperties2KHR(
|
VkResult result =
|
||||||
physicalDevice, &imageFormatInfo, &imageFormatProps);
|
WkResult::WrapUnsafe(mDevice->fn.GetPhysicalDeviceImageFormatProperties2KHR(
|
||||||
|
physicalDevice, &imageFormatInfo, &imageFormatProps));
|
||||||
if (result != VK_SUCCESS) {
|
if (result != VK_SUCCESS) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue