Commit 27780295 by Yuly Novikov Committed by Commit Bot

Vulkan: refactor WrappedObject descendants

Methods receive VkDevice instead of Context and return VkResult instead of angle::Result now. Bug: angleproject:2657 Change-Id: I3eca8692ad0b3b6e96e31fd433ed14e04384990e Reviewed-on: https://chromium-review.googlesource.com/c/1330105Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Yuly Novikov <ynovikov@chromium.org>
parent 0864a7ac
...@@ -116,8 +116,10 @@ angle::Result BufferVk::map(const gl::Context *context, GLenum access, void **ma ...@@ -116,8 +116,10 @@ angle::Result BufferVk::map(const gl::Context *context, GLenum access, void **ma
angle::Result BufferVk::mapImpl(ContextVk *contextVk, void **mapPtr) angle::Result BufferVk::mapImpl(ContextVk *contextVk, void **mapPtr)
{ {
return mBuffer.getDeviceMemory().map(contextVk, 0, mState.getSize(), 0, ANGLE_VK_TRY(contextVk,
reinterpret_cast<uint8_t **>(mapPtr)); mBuffer.getDeviceMemory().map(contextVk->getDevice(), 0, mState.getSize(), 0,
reinterpret_cast<uint8_t **>(mapPtr)));
return angle::Result::Continue();
} }
GLint64 BufferVk::getSize() GLint64 BufferVk::getSize()
...@@ -135,8 +137,9 @@ angle::Result BufferVk::mapRange(const gl::Context *context, ...@@ -135,8 +137,9 @@ angle::Result BufferVk::mapRange(const gl::Context *context,
ContextVk *contextVk = vk::GetImpl(context); ContextVk *contextVk = vk::GetImpl(context);
return mBuffer.getDeviceMemory().map(contextVk, offset, length, 0, ANGLE_VK_TRY(contextVk, mBuffer.getDeviceMemory().map(contextVk->getDevice(), offset, length, 0,
reinterpret_cast<uint8_t **>(mapPtr)); reinterpret_cast<uint8_t **>(mapPtr)));
return angle::Result::Continue();
} }
angle::Result BufferVk::unmap(const gl::Context *context, GLboolean *result) angle::Result BufferVk::unmap(const gl::Context *context, GLboolean *result)
...@@ -181,8 +184,8 @@ angle::Result BufferVk::getIndexRange(const gl::Context *context, ...@@ -181,8 +184,8 @@ angle::Result BufferVk::getIndexRange(const gl::Context *context,
const gl::Type &typeInfo = gl::GetTypeInfo(type); const gl::Type &typeInfo = gl::GetTypeInfo(type);
uint8_t *mapPointer = nullptr; uint8_t *mapPointer = nullptr;
ANGLE_TRY( ANGLE_VK_TRY(contextVk, mBuffer.getDeviceMemory().map(contextVk->getDevice(), offset,
mBuffer.getDeviceMemory().map(contextVk, offset, typeInfo.bytes * count, 0, &mapPointer)); typeInfo.bytes * count, 0, &mapPointer));
*outRange = gl::ComputeIndexRange(type, mapPointer, count, primitiveRestartEnabled); *outRange = gl::ComputeIndexRange(type, mapPointer, count, primitiveRestartEnabled);
...@@ -206,7 +209,8 @@ angle::Result BufferVk::setDataImpl(ContextVk *contextVk, ...@@ -206,7 +209,8 @@ angle::Result BufferVk::setDataImpl(ContextVk *contextVk,
vk::StagingUsage::Write)); vk::StagingUsage::Write));
uint8_t *mapPointer = nullptr; uint8_t *mapPointer = nullptr;
ANGLE_TRY(stagingBuffer.getDeviceMemory().map(contextVk, 0, size, 0, &mapPointer)); ANGLE_VK_TRY(contextVk,
stagingBuffer.getDeviceMemory().map(device, 0, size, 0, &mapPointer));
ASSERT(mapPointer); ASSERT(mapPointer);
memcpy(mapPointer, data, size); memcpy(mapPointer, data, size);
...@@ -222,7 +226,8 @@ angle::Result BufferVk::setDataImpl(ContextVk *contextVk, ...@@ -222,7 +226,8 @@ angle::Result BufferVk::setDataImpl(ContextVk *contextVk,
else else
{ {
uint8_t *mapPointer = nullptr; uint8_t *mapPointer = nullptr;
ANGLE_TRY(mBuffer.getDeviceMemory().map(contextVk, offset, size, 0, &mapPointer)); ANGLE_VK_TRY(contextVk,
mBuffer.getDeviceMemory().map(device, offset, size, 0, &mapPointer));
ASSERT(mapPointer); ASSERT(mapPointer);
memcpy(mapPointer, data, size); memcpy(mapPointer, data, size);
......
...@@ -38,14 +38,14 @@ angle::Result InitAndBeginCommandBuffer(vk::Context *context, ...@@ -38,14 +38,14 @@ angle::Result InitAndBeginCommandBuffer(vk::Context *context,
createInfo.level = VK_COMMAND_BUFFER_LEVEL_SECONDARY; createInfo.level = VK_COMMAND_BUFFER_LEVEL_SECONDARY;
createInfo.commandBufferCount = 1; createInfo.commandBufferCount = 1;
ANGLE_TRY(commandBuffer->init(context, createInfo)); ANGLE_VK_TRY(context, commandBuffer->init(context->getDevice(), createInfo));
VkCommandBufferBeginInfo beginInfo = {}; VkCommandBufferBeginInfo beginInfo = {};
beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; beginInfo.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO;
beginInfo.flags = flags | VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; beginInfo.flags = flags | VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
beginInfo.pInheritanceInfo = &inheritanceInfo; beginInfo.pInheritanceInfo = &inheritanceInfo;
ANGLE_TRY(commandBuffer->begin(context, beginInfo)); ANGLE_VK_TRY(context, commandBuffer->begin(beginInfo));
return angle::Result::Continue(); return angle::Result::Continue();
} }
...@@ -505,7 +505,7 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context, ...@@ -505,7 +505,7 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context,
if (mOutsideRenderPassCommands.valid()) if (mOutsideRenderPassCommands.valid())
{ {
ANGLE_TRY(mOutsideRenderPassCommands.end(context)); ANGLE_VK_TRY(context, mOutsideRenderPassCommands.end());
primaryCommandBuffer->executeCommands(1, &mOutsideRenderPassCommands); primaryCommandBuffer->executeCommands(1, &mOutsideRenderPassCommands);
} }
...@@ -517,7 +517,7 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context, ...@@ -517,7 +517,7 @@ angle::Result CommandGraphNode::visitAndExecute(vk::Context *context,
ANGLE_TRY(renderPassCache->getCompatibleRenderPass(context, serial, mRenderPassDesc, ANGLE_TRY(renderPassCache->getCompatibleRenderPass(context, serial, mRenderPassDesc,
&renderPass)); &renderPass));
ANGLE_TRY(mInsideRenderPassCommands.end(context)); ANGLE_VK_TRY(context, mInsideRenderPassCommands.end());
VkRenderPassBeginInfo beginInfo = {}; VkRenderPassBeginInfo beginInfo = {};
beginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; beginInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO;
...@@ -658,7 +658,7 @@ angle::Result CommandGraph::submitCommands(Context *context, ...@@ -658,7 +658,7 @@ angle::Result CommandGraph::submitCommands(Context *context,
primaryInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; primaryInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY;
primaryInfo.commandBufferCount = 1; primaryInfo.commandBufferCount = 1;
ANGLE_TRY(primaryCommandBufferOut->init(context, primaryInfo)); ANGLE_VK_TRY(context, primaryCommandBufferOut->init(context->getDevice(), primaryInfo));
if (mEnableGraphDiagnostics) if (mEnableGraphDiagnostics)
{ {
...@@ -672,7 +672,7 @@ angle::Result CommandGraph::submitCommands(Context *context, ...@@ -672,7 +672,7 @@ angle::Result CommandGraph::submitCommands(Context *context,
beginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; beginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT;
beginInfo.pInheritanceInfo = nullptr; beginInfo.pInheritanceInfo = nullptr;
ANGLE_TRY(primaryCommandBufferOut->begin(context, beginInfo)); ANGLE_VK_TRY(context, primaryCommandBufferOut->begin(beginInfo));
ANGLE_TRY(context->getRenderer()->traceGpuEvent( ANGLE_TRY(context->getRenderer()->traceGpuEvent(
context, primaryCommandBufferOut, TRACE_EVENT_PHASE_BEGIN, "Primary Command Buffer")); context, primaryCommandBufferOut, TRACE_EVENT_PHASE_BEGIN, "Primary Command Buffer"));
...@@ -713,7 +713,7 @@ angle::Result CommandGraph::submitCommands(Context *context, ...@@ -713,7 +713,7 @@ angle::Result CommandGraph::submitCommands(Context *context,
ANGLE_TRY(context->getRenderer()->traceGpuEvent( ANGLE_TRY(context->getRenderer()->traceGpuEvent(
context, primaryCommandBufferOut, TRACE_EVENT_PHASE_END, "Primary Command Buffer")); context, primaryCommandBufferOut, TRACE_EVENT_PHASE_END, "Primary Command Buffer"));
ANGLE_TRY(primaryCommandBufferOut->end(context)); ANGLE_VK_TRY(context, primaryCommandBufferOut->end());
// TODO(jmadill): Use pool allocation so we don't need to deallocate command graph. // TODO(jmadill): Use pool allocation so we don't need to deallocate command graph.
for (CommandGraphNode *node : mNodes) for (CommandGraphNode *node : mNodes)
......
...@@ -445,7 +445,8 @@ angle::Result ProgramVk::initDefaultUniformBlocks(const gl::Context *glContext) ...@@ -445,7 +445,8 @@ angle::Result ProgramVk::initDefaultUniformBlocks(const gl::Context *glContext)
uniformBufferInfo.queueFamilyIndexCount = 0; uniformBufferInfo.queueFamilyIndexCount = 0;
uniformBufferInfo.pQueueFamilyIndices = nullptr; uniformBufferInfo.pQueueFamilyIndices = nullptr;
ANGLE_TRY(mEmptyUniformBlockStorage.buffer.init(contextVk, uniformBufferInfo)); ANGLE_VK_TRY(contextVk, mEmptyUniformBlockStorage.buffer.init(contextVk->getDevice(),
uniformBufferInfo));
// Assume host visible/coherent memory available. // Assume host visible/coherent memory available.
VkMemoryPropertyFlags flags = VkMemoryPropertyFlags flags =
......
...@@ -135,18 +135,17 @@ angle::Result QueryVk::getResult(const gl::Context *context, bool wait) ...@@ -135,18 +135,17 @@ angle::Result QueryVk::getResult(const gl::Context *context, bool wait)
VkQueryResultFlags flags = (wait ? VK_QUERY_RESULT_WAIT_BIT : 0) | VK_QUERY_RESULT_64_BIT; VkQueryResultFlags flags = (wait ? VK_QUERY_RESULT_WAIT_BIT : 0) | VK_QUERY_RESULT_64_BIT;
angle::Result result = mQueryHelper.getQueryPool()->getResults( VkResult result = mQueryHelper.getQueryPool()->getResults(
contextVk, mQueryHelper.getQuery(), 1, sizeof(mCachedResult), &mCachedResult, contextVk->getDevice(), mQueryHelper.getQuery(), 1, sizeof(mCachedResult), &mCachedResult,
sizeof(mCachedResult), flags); sizeof(mCachedResult), flags);
ANGLE_TRY(result);
// If the results are not ready, do nothing. mCachedResultValid remains false. // If the results are not ready, do nothing. mCachedResultValid remains false.
if (result == angle::Result::Incomplete()) if (result == VK_NOT_READY)
{ {
// If VK_QUERY_RESULT_WAIT_BIT was given, Incomplete() cannot have been returned. // If VK_QUERY_RESULT_WAIT_BIT was given, VK_NOT_READY cannot have been returned.
ASSERT(!wait); ASSERT(!wait);
return angle::Result::Continue(); return angle::Result::Continue();
} }
ANGLE_VK_TRY(contextVk, result);
// Fix up the results to what OpenGL expects. // Fix up the results to what OpenGL expects.
switch (getType()) switch (getType())
...@@ -163,13 +162,12 @@ angle::Result QueryVk::getResult(const gl::Context *context, bool wait) ...@@ -163,13 +162,12 @@ angle::Result QueryVk::getResult(const gl::Context *context, bool wait)
uint64_t timeElapsedEnd = mCachedResult; uint64_t timeElapsedEnd = mCachedResult;
result = mQueryHelperTimeElapsedBegin.getQueryPool()->getResults( result = mQueryHelperTimeElapsedBegin.getQueryPool()->getResults(
contextVk, mQueryHelperTimeElapsedBegin.getQuery(), 1, sizeof(mCachedResult), contextVk->getDevice(), mQueryHelperTimeElapsedBegin.getQuery(), 1,
&mCachedResult, sizeof(mCachedResult), flags); sizeof(mCachedResult), &mCachedResult, sizeof(mCachedResult), flags);
ANGLE_TRY(result);
// Since the result of the end query of time-elapsed is already available, the // Since the result of the end query of time-elapsed is already available, the
// result of begin query must be available too. // result of begin query must be available too.
ASSERT(result != angle::Result::Incomplete()); ASSERT(result != VK_NOT_READY);
ANGLE_VK_TRY(contextVk, result);
mCachedResult = timeElapsedEnd - mCachedResult; mCachedResult = timeElapsedEnd - mCachedResult;
break; break;
......
...@@ -751,7 +751,8 @@ angle::Result WindowSurfaceVk::getCurrentFramebuffer(vk::Context *context, ...@@ -751,7 +751,8 @@ angle::Result WindowSurfaceVk::getCurrentFramebuffer(vk::Context *context,
for (SwapchainImage &swapchainImage : mSwapchainImages) for (SwapchainImage &swapchainImage : mSwapchainImages)
{ {
imageViews[0] = swapchainImage.imageView.getHandle(); imageViews[0] = swapchainImage.imageView.getHandle();
ANGLE_TRY(swapchainImage.framebuffer.init(context, framebufferInfo)); ANGLE_VK_TRY(context,
swapchainImage.framebuffer.init(context->getDevice(), framebufferInfo));
} }
ASSERT(currentFramebuffer.valid()); ASSERT(currentFramebuffer.valid());
......
...@@ -996,7 +996,8 @@ angle::Result TextureVk::syncState(const gl::Context *context, ...@@ -996,7 +996,8 @@ angle::Result TextureVk::syncState(const gl::Context *context,
samplerInfo.borderColor = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK; samplerInfo.borderColor = VK_BORDER_COLOR_INT_TRANSPARENT_BLACK;
samplerInfo.unnormalizedCoordinates = VK_FALSE; samplerInfo.unnormalizedCoordinates = VK_FALSE;
return mSampler.init(contextVk, samplerInfo); ANGLE_VK_TRY(contextVk, mSampler.init(contextVk->getDevice(), samplerInfo));
return angle::Result::Continue();
} }
gl::Error TextureVk::setStorageMultisample(const gl::Context *context, gl::Error TextureVk::setStorageMultisample(const gl::Context *context,
......
...@@ -238,7 +238,7 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context, ...@@ -238,7 +238,7 @@ angle::Result InitializeRenderPassFromDesc(vk::Context *context,
createInfo.dependencyCount = 0; createInfo.dependencyCount = 0;
createInfo.pDependencies = nullptr; createInfo.pDependencies = nullptr;
ANGLE_TRY(renderPass->init(context, createInfo)); ANGLE_VK_TRY(context, renderPass->init(context->getDevice(), createInfo));
return angle::Result::Continue(); return angle::Result::Continue();
} }
...@@ -666,8 +666,8 @@ angle::Result PipelineDesc::initializePipeline(vk::Context *context, ...@@ -666,8 +666,8 @@ angle::Result PipelineDesc::initializePipeline(vk::Context *context,
createInfo.basePipelineHandle = VK_NULL_HANDLE; createInfo.basePipelineHandle = VK_NULL_HANDLE;
createInfo.basePipelineIndex = 0; createInfo.basePipelineIndex = 0;
ANGLE_TRY(pipelineOut->initGraphics(context, createInfo, pipelineCacheVk)); ANGLE_VK_TRY(context,
pipelineOut->initGraphics(context->getDevice(), createInfo, pipelineCacheVk));
return angle::Result::Continue(); return angle::Result::Continue();
} }
...@@ -1235,7 +1235,7 @@ angle::Result DescriptorSetLayoutCache::getDescriptorSetLayout( ...@@ -1235,7 +1235,7 @@ angle::Result DescriptorSetLayoutCache::getDescriptorSetLayout(
createInfo.pBindings = bindings.data(); createInfo.pBindings = bindings.data();
vk::DescriptorSetLayout newLayout; vk::DescriptorSetLayout newLayout;
ANGLE_TRY(newLayout.init(context, createInfo)); ANGLE_VK_TRY(context, newLayout.init(context->getDevice(), createInfo));
auto insertedItem = mPayload.emplace(desc, vk::SharedDescriptorSetLayout(std::move(newLayout))); auto insertedItem = mPayload.emplace(desc, vk::SharedDescriptorSetLayout(std::move(newLayout)));
vk::SharedDescriptorSetLayout &insertedLayout = insertedItem.first->second; vk::SharedDescriptorSetLayout &insertedLayout = insertedItem.first->second;
...@@ -1319,7 +1319,7 @@ angle::Result PipelineLayoutCache::getPipelineLayout( ...@@ -1319,7 +1319,7 @@ angle::Result PipelineLayoutCache::getPipelineLayout(
createInfo.pPushConstantRanges = pushConstantRanges.data(); createInfo.pPushConstantRanges = pushConstantRanges.data();
vk::PipelineLayout newLayout; vk::PipelineLayout newLayout;
ANGLE_TRY(newLayout.init(context, createInfo)); ANGLE_VK_TRY(context, newLayout.init(context->getDevice(), createInfo));
auto insertedItem = mPayload.emplace(desc, vk::SharedPipelineLayout(std::move(newLayout))); auto insertedItem = mPayload.emplace(desc, vk::SharedPipelineLayout(std::move(newLayout)));
vk::SharedPipelineLayout &insertedLayout = insertedItem.first->second; vk::SharedPipelineLayout &insertedLayout = insertedItem.first->second;
......
...@@ -146,7 +146,7 @@ angle::Result DynamicBuffer::allocate(Context *context, ...@@ -146,7 +146,7 @@ angle::Result DynamicBuffer::allocate(Context *context,
createInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; createInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
createInfo.queueFamilyIndexCount = 0; createInfo.queueFamilyIndexCount = 0;
createInfo.pQueueFamilyIndices = nullptr; createInfo.pQueueFamilyIndices = nullptr;
ANGLE_TRY(mBuffer.init(context, createInfo)); ANGLE_VK_TRY(context, mBuffer.init(context->getDevice(), createInfo));
VkMemoryPropertyFlags actualMemoryPropertyFlags = 0; VkMemoryPropertyFlags actualMemoryPropertyFlags = 0;
ANGLE_TRY(AllocateBufferMemory(context, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, ANGLE_TRY(AllocateBufferMemory(context, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT,
...@@ -154,7 +154,7 @@ angle::Result DynamicBuffer::allocate(Context *context, ...@@ -154,7 +154,7 @@ angle::Result DynamicBuffer::allocate(Context *context,
mHostCoherent = (VK_MEMORY_PROPERTY_HOST_COHERENT_BIT == mHostCoherent = (VK_MEMORY_PROPERTY_HOST_COHERENT_BIT ==
(VK_MEMORY_PROPERTY_HOST_COHERENT_BIT & actualMemoryPropertyFlags)); (VK_MEMORY_PROPERTY_HOST_COHERENT_BIT & actualMemoryPropertyFlags));
ANGLE_TRY(mMemory.map(context, 0, mSize, 0, &mMappedMemory)); ANGLE_VK_TRY(context, mMemory.map(context->getDevice(), 0, mSize, 0, &mMappedMemory));
mNextAllocationOffset = 0; mNextAllocationOffset = 0;
mLastFlushOrInvalidateOffset = 0; mLastFlushOrInvalidateOffset = 0;
...@@ -315,7 +315,8 @@ angle::Result DescriptorPoolHelper::init(Context *context, ...@@ -315,7 +315,8 @@ angle::Result DescriptorPoolHelper::init(Context *context,
mFreeDescriptorSets = maxSets; mFreeDescriptorSets = maxSets;
return mDescriptorPool.init(context, descriptorPoolInfo); ANGLE_VK_TRY(context, mDescriptorPool.init(context->getDevice(), descriptorPoolInfo));
return angle::Result::Continue();
} }
void DescriptorPoolHelper::destroy(VkDevice device) void DescriptorPoolHelper::destroy(VkDevice device)
...@@ -337,7 +338,9 @@ angle::Result DescriptorPoolHelper::allocateSets(Context *context, ...@@ -337,7 +338,9 @@ angle::Result DescriptorPoolHelper::allocateSets(Context *context,
ASSERT(mFreeDescriptorSets >= descriptorSetCount); ASSERT(mFreeDescriptorSets >= descriptorSetCount);
mFreeDescriptorSets -= descriptorSetCount; mFreeDescriptorSets -= descriptorSetCount;
return mDescriptorPool.allocateDescriptorSets(context, allocInfo, descriptorSetsOut); ANGLE_VK_TRY(context, mDescriptorPool.allocateDescriptorSets(context->getDevice(), allocInfo,
descriptorSetsOut));
return angle::Result::Continue();
} }
// DynamicDescriptorPool implementation. // DynamicDescriptorPool implementation.
...@@ -599,7 +602,7 @@ angle::Result DynamicQueryPool::allocateNewPool(Context *context) ...@@ -599,7 +602,7 @@ angle::Result DynamicQueryPool::allocateNewPool(Context *context)
vk::QueryPool queryPool; vk::QueryPool queryPool;
ANGLE_TRY(queryPool.init(context, queryPoolInfo)); ANGLE_VK_TRY(context, queryPool.init(context->getDevice(), queryPoolInfo));
return allocateNewEntryPool(context, std::move(queryPool)); return allocateNewEntryPool(context, std::move(queryPool));
} }
...@@ -691,7 +694,7 @@ angle::Result DynamicSemaphorePool::allocateNewPool(Context *context) ...@@ -691,7 +694,7 @@ angle::Result DynamicSemaphorePool::allocateNewPool(Context *context)
for (Semaphore &semaphore : newPool) for (Semaphore &semaphore : newPool)
{ {
ANGLE_TRY(semaphore.init(context)); ANGLE_VK_TRY(context, semaphore.init(context->getDevice()));
} }
// This code is safe as long as the growth of the outer vector in vector<vector<T>> is done by // This code is safe as long as the growth of the outer vector in vector<vector<T>> is done by
...@@ -900,7 +903,7 @@ angle::Result BufferHelper::init(ContextVk *contextVk, ...@@ -900,7 +903,7 @@ angle::Result BufferHelper::init(ContextVk *contextVk,
const VkBufferCreateInfo &createInfo, const VkBufferCreateInfo &createInfo,
VkMemoryPropertyFlags memoryPropertyFlags) VkMemoryPropertyFlags memoryPropertyFlags)
{ {
ANGLE_TRY(mBuffer.init(contextVk, createInfo)); ANGLE_VK_TRY(contextVk, mBuffer.init(contextVk->getDevice(), createInfo));
return vk::AllocateBufferMemory(contextVk, memoryPropertyFlags, &mMemoryPropertyFlags, &mBuffer, return vk::AllocateBufferMemory(contextVk, memoryPropertyFlags, &mMemoryPropertyFlags, &mBuffer,
&mDeviceMemory); &mDeviceMemory);
} }
...@@ -1016,7 +1019,7 @@ angle::Result ImageHelper::init(Context *context, ...@@ -1016,7 +1019,7 @@ angle::Result ImageHelper::init(Context *context,
mCurrentLayout = VK_IMAGE_LAYOUT_UNDEFINED; mCurrentLayout = VK_IMAGE_LAYOUT_UNDEFINED;
ANGLE_TRY(mImage.init(context, imageInfo)); ANGLE_VK_TRY(context, mImage.init(context->getDevice(), imageInfo));
return angle::Result::Continue(); return angle::Result::Continue();
} }
...@@ -1086,7 +1089,7 @@ angle::Result ImageHelper::initLayerImageView(Context *context, ...@@ -1086,7 +1089,7 @@ angle::Result ImageHelper::initLayerImageView(Context *context,
viewInfo.subresourceRange.baseArrayLayer = baseArrayLayer; viewInfo.subresourceRange.baseArrayLayer = baseArrayLayer;
viewInfo.subresourceRange.layerCount = layerCount; viewInfo.subresourceRange.layerCount = layerCount;
ANGLE_TRY(imageViewOut->init(context, viewInfo)); ANGLE_VK_TRY(context, imageViewOut->init(context->getDevice(), viewInfo));
return angle::Result::Continue(); return angle::Result::Continue();
} }
...@@ -1149,7 +1152,7 @@ angle::Result ImageHelper::init2DStaging(Context *context, ...@@ -1149,7 +1152,7 @@ angle::Result ImageHelper::init2DStaging(Context *context,
imageInfo.pQueueFamilyIndices = nullptr; imageInfo.pQueueFamilyIndices = nullptr;
imageInfo.initialLayout = mCurrentLayout; imageInfo.initialLayout = mCurrentLayout;
ANGLE_TRY(mImage.init(context, imageInfo)); ANGLE_VK_TRY(context, mImage.init(context->getDevice(), imageInfo));
// Allocate and bind host visible and coherent Image memory. // Allocate and bind host visible and coherent Image memory.
// TODO(ynovikov): better approach would be to request just visible memory, // TODO(ynovikov): better approach would be to request just visible memory,
...@@ -1455,7 +1458,8 @@ FramebufferHelper::~FramebufferHelper() = default; ...@@ -1455,7 +1458,8 @@ FramebufferHelper::~FramebufferHelper() = default;
angle::Result FramebufferHelper::init(ContextVk *contextVk, angle::Result FramebufferHelper::init(ContextVk *contextVk,
const VkFramebufferCreateInfo &createInfo) const VkFramebufferCreateInfo &createInfo)
{ {
return mFramebuffer.init(contextVk, createInfo); ANGLE_VK_TRY(contextVk, mFramebuffer.init(contextVk->getDevice(), createInfo));
return angle::Result::Continue();
} }
void FramebufferHelper::release(RendererVk *renderer) void FramebufferHelper::release(RendererVk *renderer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment