Pass gl::Context to impl methods instead of ContextImpl.
In some cases we might have to call back into the GL layer, passing
the Context, and if we just have a ContextImpl pointer this isn't
possible. It also removes the need for SafeGetImpl.
BUG=angleproject:2044
Change-Id: I6363e84b25648c992c25779d4c43f795aa2866d6
Reviewed-on: https://chromium-review.googlesource.com/516835
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Commit-Queue: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/ProgramVk.cpp b/src/libANGLE/renderer/vulkan/ProgramVk.cpp
index 6e53883..b5e63da 100644
--- a/src/libANGLE/renderer/vulkan/ProgramVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ProgramVk.cpp
@@ -10,6 +10,7 @@
#include "libANGLE/renderer/vulkan/ProgramVk.h"
#include "common/debug.h"
+#include "libANGLE/Context.h"
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/GlslangWrapper.h"
#include "libANGLE/renderer/vulkan/RendererVk.h"
@@ -25,16 +26,16 @@
{
}
-void ProgramVk::destroy(const ContextImpl *contextImpl)
+void ProgramVk::destroy(const gl::Context *contextImpl)
{
- VkDevice device = GetAs<ContextVk>(contextImpl)->getDevice();
+ VkDevice device = GetImplAs<ContextVk>(contextImpl)->getDevice();
mLinkedFragmentModule.destroy(device);
mLinkedVertexModule.destroy(device);
mPipelineLayout.destroy(device);
}
-LinkResult ProgramVk::load(const ContextImpl *contextImpl,
+LinkResult ProgramVk::load(const gl::Context *contextImpl,
gl::InfoLog &infoLog,
gl::BinaryInputStream *stream)
{
@@ -58,11 +59,11 @@
UNIMPLEMENTED();
}
-LinkResult ProgramVk::link(ContextImpl *contextImpl,
+LinkResult ProgramVk::link(const gl::Context *glContext,
const gl::VaryingPacking &packing,
gl::InfoLog &infoLog)
{
- ContextVk *context = GetAs<ContextVk>(contextImpl);
+ ContextVk *context = GetImplAs<ContextVk>(glContext);
RendererVk *renderer = context->getRenderer();
GlslangWrapper *glslangWrapper = renderer->getGlslangWrapper();