Vulkan: Pass RendererVk to Allocate helpers.
Passing the Renderer pointer instead of the Context pointer makes
these methods a bit easier to work with from the "EGL" sections of
the code. This is a refactoring-only change to aid the Depth/Stencil
implementation.
Bug: angleproject:2357
Change-Id: Icbcc72a1daff4edd947a21672744498781cfc064
Reviewed-on: https://chromium-review.googlesource.com/919523
Reviewed-by: Luc Ferron <lucferron@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 341034f..ced4598 100644
--- a/src/libANGLE/renderer/vulkan/ProgramVk.cpp
+++ b/src/libANGLE/renderer/vulkan/ProgramVk.cpp
@@ -65,7 +65,10 @@
// Assume host vislble/coherent memory available.
VkMemoryPropertyFlags flags =
(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
- ANGLE_TRY(AllocateBufferMemory(vk::GetImpl(context), flags, &storageOut->buffer,
+
+ ContextVk *contextVk = vk::GetImpl(context);
+
+ ANGLE_TRY(AllocateBufferMemory(contextVk->getRenderer(), flags, &storageOut->buffer,
&storageOut->memory, requiredSizeOut));
return gl::NoError();
@@ -264,6 +267,7 @@
gl::Error ProgramVk::initDefaultUniformBlocks(const gl::Context *glContext)
{
ContextVk *contextVk = vk::GetImpl(glContext);
+ RendererVk *renderer = contextVk->getRenderer();
VkDevice device = contextVk->getDevice();
// Process vertex and fragment uniforms into std140 packing.
@@ -364,7 +368,7 @@
VkMemoryPropertyFlags flags =
(VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT);
size_t requiredSize = 0;
- ANGLE_TRY(AllocateBufferMemory(contextVk, flags, &mEmptyUniformBlockStorage.buffer,
+ ANGLE_TRY(AllocateBufferMemory(renderer, flags, &mEmptyUniformBlockStorage.buffer,
&mEmptyUniformBlockStorage.memory, &requiredSize));
}