Hash :
327ba857
Author :
Date :
2016-11-30T12:38:28
Vulkan: Hook up loader code. This integrates the build files for the loader SDK, and tests the compilation by calling InitInstance. There's no current way to test the runtime behaviour since there's no way for the tests to initialize the Vulkan back-end, that will come in the next CL. BUG=angleproject:1319 Change-Id: Ia8bf96ca068eaf40744c9753b59ffaaa5ada8a73 Reviewed-on: https://chromium-review.googlesource.com/367519 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Geoff Lang <geofflang@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
//
// Copyright 2016 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// renderervk_utils:
// Helper functions for the Vulkan Renderer.
//
#ifndef LIBANGLE_RENDERER_VULKAN_RENDERERVK_UTILS_H_
#define LIBANGLE_RENDERER_VULKAN_RENDERERVK_UTILS_H_
#include <vulkan/vulkan.h>
#include "libANGLE/Error.h"
namespace rx
{
const char *VulkanResultString(VkResult result);
namespace vk
{
class Error final
{
public:
Error(VkResult result, const char *file, unsigned int line);
~Error();
Error(const Error &other);
Error &operator=(const Error &other);
gl::Error toGL(GLenum glErrorCode) const;
egl::Error toEGL(EGLint eglErrorCode) const;
operator gl::Error() const;
operator egl::Error() const;
bool isError() const;
private:
std::string getExtendedMessage() const;
VkResult mResult;
const char *mFile;
unsigned int mLine;
};
// Avoid conflicting with X headers which define "Success".
inline Error NoError()
{
return Error(VK_SUCCESS, nullptr, 0);
}
} // namespace vk
} // namespace rx
#define ANGLE_VK_TRY(command) \
{ \
auto ANGLE_LOCAL_VAR = command; \
if (ANGLE_LOCAL_VAR != VK_SUCCESS) \
{ \
return rx::vk::Error(ANGLE_LOCAL_VAR, __FILE__, __LINE__); \
} \
} \
ANGLE_EMPTY_STATEMENT
#endif // LIBANGLE_RENDERER_VULKAN_RENDERERVK_UTILS_H_