diff --git a/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json b/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json index 54fa5ca2066..d3ce654f53b 100644 --- a/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json +++ b/scripts/code_generation_hashes/Vulkan_internal_shader_programs.json @@ -1,6 +1,6 @@ { "src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py": - "533126aa7c34c64e7ea8c635db4c45fa", + "62278fc740a3deaf2bd07ef77422b1c4", "src/libANGLE/renderer/vulkan/shaders/gen/Blit3DSrc.frag.00000000.inc": "dcc2e34fb04417a2f4dc26ebab803380", "src/libANGLE/renderer/vulkan/shaders/gen/Blit3DSrc.frag.00000001.inc": @@ -358,9 +358,9 @@ "src/libANGLE/renderer/vulkan/shaders/src/OverlayDraw.vert": "5aa33152fce5b9261c4d427ad2babdd7", "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp": - "75829eadf0c0b4bce5834a851f4c4034", + "e9f13dec1bd2b0171deaa1de3516a626", "src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h": - "f355d503dcd38440bde220bb57d8dc49", + "b5fd3e48b63232c8faab1342701b257a", "tools/glslang/glslang_validator.exe.sha1": "17e862cc6f462fecbf50b24ed6544a27", "tools/glslang/glslang_validator.sha1": diff --git a/src/libANGLE/renderer/vulkan/BufferVk.cpp b/src/libANGLE/renderer/vulkan/BufferVk.cpp index 6eab24e9892..031e8bd0431 100644 --- a/src/libANGLE/renderer/vulkan/BufferVk.cpp +++ b/src/libANGLE/renderer/vulkan/BufferVk.cpp @@ -390,7 +390,7 @@ void BufferVk::destroy(const gl::Context *context) (void)release(contextVk); } -void BufferVk::releaseConversionBuffers(vk::Context *context) +void BufferVk::releaseConversionBuffers(vk::ErrorContext *context) { for (ConversionBuffer &buffer : mVertexConversionBuffers) { diff --git a/src/libANGLE/renderer/vulkan/BufferVk.h b/src/libANGLE/renderer/vulkan/BufferVk.h index 59fd765a312..76a898fc342 100644 --- a/src/libANGLE/renderer/vulkan/BufferVk.h +++ b/src/libANGLE/renderer/vulkan/BufferVk.h @@ -51,7 +51,7 @@ class ConversionBuffer bool valid() const { return mData && mData->valid(); } vk::BufferHelper *getBuffer() const { return mData.get(); } - void release(vk::Context *context) { mData->release(context); } + void release(vk::ErrorContext *context) { mData->release(context); } void destroy(vk::Renderer *renderer) { mData->destroy(renderer); } private: @@ -293,7 +293,7 @@ class BufferVk : public BufferImpl VkMemoryPropertyFlags memoryPropertyFlags, size_t size) const; - void releaseConversionBuffers(vk::Context *context); + void releaseConversionBuffers(vk::ErrorContext *context); vk::BufferHelper mBuffer; diff --git a/src/libANGLE/renderer/vulkan/CLContextVk.cpp b/src/libANGLE/renderer/vulkan/CLContextVk.cpp index 8ee43135450..ebb68bba3a4 100644 --- a/src/libANGLE/renderer/vulkan/CLContextVk.cpp +++ b/src/libANGLE/renderer/vulkan/CLContextVk.cpp @@ -29,7 +29,7 @@ namespace rx CLContextVk::CLContextVk(const cl::Context &context, const cl::DevicePtrs devicePtrs) : CLContextImpl(context), - vk::Context(getPlatform()->getRenderer()), + vk::ErrorContext(getPlatform()->getRenderer()), mAssociatedDevices(devicePtrs) { mDeviceQueueIndex = mRenderer->getDefaultDeviceQueueIndex(); diff --git a/src/libANGLE/renderer/vulkan/CLContextVk.h b/src/libANGLE/renderer/vulkan/CLContextVk.h index 52e91d83614..862cd94f37b 100644 --- a/src/libANGLE/renderer/vulkan/CLContextVk.h +++ b/src/libANGLE/renderer/vulkan/CLContextVk.h @@ -26,7 +26,7 @@ namespace rx class CLKernelVk; -class CLContextVk : public CLContextImpl, public vk::Context +class CLContextVk : public CLContextImpl, public vk::ErrorContext { public: CLContextVk(const cl::Context &context, const cl::DevicePtrs devicePtrs); diff --git a/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp b/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp index f8e40d6f298..305c50b44fe 100644 --- a/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp +++ b/src/libANGLE/renderer/vulkan/CLPlatformVk.cpp @@ -194,7 +194,7 @@ const std::string &CLPlatformVk::GetVersionString() } CLPlatformVk::CLPlatformVk(const cl::Platform &platform) - : CLPlatformImpl(platform), vk::Context(new vk::Renderer()), mBlobCache(1024 * 1024) + : CLPlatformImpl(platform), vk::ErrorContext(new vk::Renderer()), mBlobCache(1024 * 1024) {} void CLPlatformVk::handleError(VkResult result, diff --git a/src/libANGLE/renderer/vulkan/CLPlatformVk.h b/src/libANGLE/renderer/vulkan/CLPlatformVk.h index 2d4e638141b..9e9350ce999 100644 --- a/src/libANGLE/renderer/vulkan/CLPlatformVk.h +++ b/src/libANGLE/renderer/vulkan/CLPlatformVk.h @@ -21,7 +21,7 @@ namespace rx { -class CLPlatformVk : public CLPlatformImpl, public vk::Context, public vk::GlobalOps +class CLPlatformVk : public CLPlatformImpl, public vk::ErrorContext, public vk::GlobalOps { public: using Ptr = std::unique_ptr; @@ -50,7 +50,7 @@ class CLPlatformVk : public CLPlatformImpl, public vk::Context, public vk::Globa angle::Result initBackendRenderer(); - // vk::Context + // vk::ErrorContext void handleError(VkResult result, const char *file, const char *function, diff --git a/src/libANGLE/renderer/vulkan/CommandQueue.cpp b/src/libANGLE/renderer/vulkan/CommandQueue.cpp index 1584a8d5a98..b3db7bc1af3 100644 --- a/src/libANGLE/renderer/vulkan/CommandQueue.cpp +++ b/src/libANGLE/renderer/vulkan/CommandQueue.cpp @@ -121,7 +121,7 @@ void RecyclableFence::destroy(VkDevice device) } // FenceRecycler implementation -void FenceRecycler::destroy(Context *context) +void FenceRecycler::destroy(ErrorContext *context) { std::lock_guard lock(mMutex); mRecycler.destroy(context->getDevice()); @@ -185,7 +185,7 @@ void CommandBatch::destroy(VkDevice device) // Do not clean other members to catch invalid reuse attempt with ASSERTs. } -angle::Result CommandBatch::release(Context *context) +angle::Result CommandBatch::release(ErrorContext *context) { if (mPrimaryCommands.valid()) { @@ -341,7 +341,7 @@ void CleanUpThread::handleError(VkResult errorCode, } CleanUpThread::CleanUpThread(Renderer *renderer, CommandQueue *commandQueue) - : Context(renderer), + : ErrorContext(renderer), mCommandQueue(commandQueue), mTaskThreadShouldExit(false), mNeedCleanUp(false) @@ -349,7 +349,7 @@ CleanUpThread::CleanUpThread(Renderer *renderer, CommandQueue *commandQueue) CleanUpThread::~CleanUpThread() = default; -angle::Result CleanUpThread::checkAndPopPendingError(Context *errorHandlingContext) +angle::Result CleanUpThread::checkAndPopPendingError(ErrorContext *errorHandlingContext) { std::lock_guard queueLock(mErrorMutex); if (mErrors.empty()) @@ -431,7 +431,7 @@ angle::Result CleanUpThread::init() return angle::Result::Continue; } -void CleanUpThread::destroy(Context *context) +void CleanUpThread::destroy(ErrorContext *context) { { // Request to terminate the worker thread @@ -459,7 +459,7 @@ CommandPoolAccess::~CommandPoolAccess() = default; // CommandPoolAccess public API implementation. These must be thread safe and never called from // CommandPoolAccess class itself. -angle::Result CommandPoolAccess::initCommandPool(Context *context, +angle::Result CommandPoolAccess::initCommandPool(ErrorContext *context, ProtectionType protectionType, const uint32_t queueFamilyIndex) { @@ -497,7 +497,7 @@ void CommandPoolAccess::destroyPrimaryCommandBuffer(VkDevice device, primaryCommands->destroy(device); } -angle::Result CommandPoolAccess::collectPrimaryCommandBuffer(Context *context, +angle::Result CommandPoolAccess::collectPrimaryCommandBuffer(ErrorContext *context, const ProtectionType protectionType, PrimaryCommandBuffer *primaryCommands) { @@ -511,7 +511,7 @@ angle::Result CommandPoolAccess::collectPrimaryCommandBuffer(Context *context, } angle::Result CommandPoolAccess::flushOutsideRPCommands( - Context *context, + ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, OutsideRenderPassCommandBufferHelper **outsideRPCommands) @@ -523,7 +523,7 @@ angle::Result CommandPoolAccess::flushOutsideRPCommands( } angle::Result CommandPoolAccess::flushRenderPassCommands( - Context *context, + ErrorContext *context, const ProtectionType &protectionType, const egl::ContextPriority &priority, const RenderPass &renderPass, @@ -559,7 +559,7 @@ void CommandPoolAccess::flushWaitSemaphores( } angle::Result CommandPoolAccess::getCommandsAndWaitSemaphores( - Context *context, + ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, CommandBatch *batchOut, @@ -599,7 +599,7 @@ CommandQueue::CommandQueue() CommandQueue::~CommandQueue() = default; -void CommandQueue::destroy(Context *context) +void CommandQueue::destroy(ErrorContext *context) { std::lock_guard queueSubmitLock(mQueueSubmitMutex); std::lock_guard cmdCompleteLock(mCmdCompleteMutex); @@ -619,7 +619,7 @@ void CommandQueue::destroy(Context *context) ASSERT(mNumAllCommands == 0); } -angle::Result CommandQueue::init(Context *context, +angle::Result CommandQueue::init(ErrorContext *context, const QueueFamily &queueFamily, bool enableProtectedContent, uint32_t queueCount) @@ -670,7 +670,7 @@ void CommandQueue::handleDeviceLost(Renderer *renderer) } } -angle::Result CommandQueue::postSubmitCheck(Context *context) +angle::Result CommandQueue::postSubmitCheck(ErrorContext *context) { Renderer *renderer = context->getRenderer(); @@ -702,7 +702,7 @@ angle::Result CommandQueue::postSubmitCheck(Context *context) return angle::Result::Continue; } -angle::Result CommandQueue::finishResourceUse(Context *context, +angle::Result CommandQueue::finishResourceUse(ErrorContext *context, const ResourceUse &use, uint64_t timeout) { @@ -732,7 +732,7 @@ angle::Result CommandQueue::finishResourceUse(Context *context, return angle::Result::Continue; } -angle::Result CommandQueue::finishQueueSerial(Context *context, +angle::Result CommandQueue::finishQueueSerial(ErrorContext *context, const QueueSerial &queueSerial, uint64_t timeout) { @@ -740,7 +740,7 @@ angle::Result CommandQueue::finishQueueSerial(Context *context, return finishResourceUse(context, use, timeout); } -angle::Result CommandQueue::waitIdle(Context *context, uint64_t timeout) +angle::Result CommandQueue::waitIdle(ErrorContext *context, uint64_t timeout) { // Fill the local variable with lock ResourceUse use; @@ -756,7 +756,7 @@ angle::Result CommandQueue::waitIdle(Context *context, uint64_t timeout) return finishResourceUse(context, use, timeout); } -angle::Result CommandQueue::waitForResourceUseToFinishWithUserTimeout(Context *context, +angle::Result CommandQueue::waitForResourceUseToFinishWithUserTimeout(ErrorContext *context, const ResourceUse &use, uint64_t timeout, VkResult *result) @@ -823,7 +823,7 @@ bool CommandQueue::isBusy(Renderer *renderer) const return false; } -angle::Result CommandQueue::submitCommands(Context *context, +angle::Result CommandQueue::submitCommands(ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, VkSemaphore signalSemaphore, @@ -889,7 +889,7 @@ angle::Result CommandQueue::submitCommands(Context *context, return queueSubmitLocked(context, priority, submitInfo, scopedBatch, submitQueueSerial); } -angle::Result CommandQueue::queueSubmitOneOff(Context *context, +angle::Result CommandQueue::queueSubmitOneOff(ErrorContext *context, ProtectionType protectionType, egl::ContextPriority contextPriority, VkCommandBuffer commandBufferHandle, @@ -938,7 +938,7 @@ angle::Result CommandQueue::queueSubmitOneOff(Context *context, return queueSubmitLocked(context, contextPriority, submitInfo, scopedBatch, submitQueueSerial); } -angle::Result CommandQueue::queueSubmitLocked(Context *context, +angle::Result CommandQueue::queueSubmitLocked(ErrorContext *context, egl::ContextPriority contextPriority, const VkSubmitInfo &submitInfo, DeviceScoped &commandBatch, @@ -1025,7 +1025,7 @@ void CommandQueue::resetPerFramePerfCounters() mPerfCounters.vkQueueSubmitCallsPerFrame = 0; } -angle::Result CommandQueue::releaseFinishedCommandsAndCleanupGarbage(Context *context) +angle::Result CommandQueue::releaseFinishedCommandsAndCleanupGarbage(ErrorContext *context) { Renderer *renderer = context->getRenderer(); if (renderer->isAsyncCommandBufferResetAndGarbageCleanupEnabled()) @@ -1042,7 +1042,7 @@ angle::Result CommandQueue::releaseFinishedCommandsAndCleanupGarbage(Context *co return angle::Result::Continue; } -angle::Result CommandQueue::cleanupSomeGarbage(Context *context, +angle::Result CommandQueue::cleanupSomeGarbage(ErrorContext *context, size_t minInFlightBatchesToKeep, bool *anyGarbageCleanedOut) { @@ -1074,7 +1074,7 @@ angle::Result CommandQueue::cleanupSomeGarbage(Context *context, } // CommandQueue private API implementation. These are called by public API, so lock already held. -angle::Result CommandQueue::checkOneCommandBatchLocked(Context *context, bool *finished) +angle::Result CommandQueue::checkOneCommandBatchLocked(ErrorContext *context, bool *finished) { ASSERT(!mInFlightCommands.empty()); @@ -1096,7 +1096,7 @@ angle::Result CommandQueue::checkOneCommandBatchLocked(Context *context, bool *f return angle::Result::Continue; } -angle::Result CommandQueue::finishOneCommandBatch(Context *context, +angle::Result CommandQueue::finishOneCommandBatch(ErrorContext *context, uint64_t timeout, std::unique_lock *lock) { @@ -1130,7 +1130,7 @@ void CommandQueue::onCommandBatchFinishedLocked(CommandBatch &&batch) moveInFlightBatchToFinishedQueueLocked(std::move(batch)); } -angle::Result CommandQueue::releaseFinishedCommandsLocked(Context *context) +angle::Result CommandQueue::releaseFinishedCommandsLocked(ErrorContext *context) { ANGLE_TRACE_EVENT0("gpu.angle", "releaseFinishedCommandsLocked"); @@ -1145,7 +1145,7 @@ angle::Result CommandQueue::releaseFinishedCommandsLocked(Context *context) return angle::Result::Continue; } -angle::Result CommandQueue::checkCompletedCommandsLocked(Context *context) +angle::Result CommandQueue::checkCompletedCommandsLocked(ErrorContext *context) { while (!mInFlightCommands.empty()) { diff --git a/src/libANGLE/renderer/vulkan/CommandQueue.h b/src/libANGLE/renderer/vulkan/CommandQueue.h index 1b405a0a883..862b57c888c 100644 --- a/src/libANGLE/renderer/vulkan/CommandQueue.h +++ b/src/libANGLE/renderer/vulkan/CommandQueue.h @@ -45,7 +45,7 @@ class FenceRecycler public: FenceRecycler() {} ~FenceRecycler() {} - void destroy(Context *context); + void destroy(ErrorContext *context); void fetch(VkDevice device, Fence *fenceOut); void recycle(Fence &&fence); @@ -87,7 +87,7 @@ class CommandBatch final : angle::NonCopyable CommandBatch &operator=(CommandBatch &&other); void destroy(VkDevice device); - angle::Result release(Context *context); + angle::Result release(ErrorContext *context); void setQueueSerial(const QueueSerial &serial); void setProtectionType(ProtectionType protectionType); @@ -204,19 +204,19 @@ class CommandPoolAccess : angle::NonCopyable public: CommandPoolAccess(); ~CommandPoolAccess(); - angle::Result initCommandPool(Context *context, + angle::Result initCommandPool(ErrorContext *context, ProtectionType protectionType, const uint32_t queueFamilyIndex); void destroy(VkDevice device); void destroyPrimaryCommandBuffer(VkDevice device, PrimaryCommandBuffer *primaryCommands) const; - angle::Result collectPrimaryCommandBuffer(Context *context, + angle::Result collectPrimaryCommandBuffer(ErrorContext *context, const ProtectionType protectionType, PrimaryCommandBuffer *primaryCommands); - angle::Result flushOutsideRPCommands(Context *context, + angle::Result flushOutsideRPCommands(ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, OutsideRenderPassCommandBufferHelper **outsideRPCommands); - angle::Result flushRenderPassCommands(Context *context, + angle::Result flushRenderPassCommands(ErrorContext *context, const ProtectionType &protectionType, const egl::ContextPriority &priority, const RenderPass &renderPass, @@ -229,7 +229,7 @@ class CommandPoolAccess : angle::NonCopyable std::vector &&waitSemaphoreStageMasks); angle::Result getCommandsAndWaitSemaphores( - Context *context, + ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, CommandBatch *batchOut, @@ -237,7 +237,7 @@ class CommandPoolAccess : angle::NonCopyable std::vector *waitSemaphoreStageMasksOut); private: - angle::Result ensurePrimaryCommandBufferValidLocked(Context *context, + angle::Result ensurePrimaryCommandBufferValidLocked(ErrorContext *context, const ProtectionType &protectionType, const egl::ContextPriority &priority) { @@ -281,12 +281,12 @@ class CommandQueue : angle::NonCopyable CommandQueue(); ~CommandQueue(); - angle::Result init(Context *context, + angle::Result init(ErrorContext *context, const QueueFamily &queueFamily, bool enableProtectedContent, uint32_t queueCount); - void destroy(Context *context); + void destroy(ErrorContext *context); void handleDeviceLost(Renderer *renderer); @@ -331,25 +331,27 @@ class CommandQueue : angle::NonCopyable } // Wait until the desired serial has been completed. - angle::Result finishResourceUse(Context *context, const ResourceUse &use, uint64_t timeout); - angle::Result finishQueueSerial(Context *context, + angle::Result finishResourceUse(ErrorContext *context, + const ResourceUse &use, + uint64_t timeout); + angle::Result finishQueueSerial(ErrorContext *context, const QueueSerial &queueSerial, uint64_t timeout); - angle::Result waitIdle(Context *context, uint64_t timeout); - angle::Result waitForResourceUseToFinishWithUserTimeout(Context *context, + angle::Result waitIdle(ErrorContext *context, uint64_t timeout); + angle::Result waitForResourceUseToFinishWithUserTimeout(ErrorContext *context, const ResourceUse &use, uint64_t timeout, VkResult *result); bool isBusy(Renderer *renderer) const; - angle::Result submitCommands(Context *context, + angle::Result submitCommands(ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, VkSemaphore signalSemaphore, SharedExternalFence &&externalFence, const QueueSerial &submitQueueSerial); - angle::Result queueSubmitOneOff(Context *context, + angle::Result queueSubmitOneOff(ErrorContext *context, ProtectionType protectionType, egl::ContextPriority contextPriority, VkCommandBuffer commandBufferHandle, @@ -361,7 +363,7 @@ class CommandQueue : angle::NonCopyable VkResult queuePresent(egl::ContextPriority contextPriority, const VkPresentInfoKHR &presentInfo); - angle::Result checkCompletedCommands(Context *context) + angle::Result checkCompletedCommands(ErrorContext *context) { std::lock_guard lock(mCmdCompleteMutex); return checkCompletedCommandsLocked(context); @@ -369,7 +371,7 @@ class CommandQueue : angle::NonCopyable bool hasFinishedCommands() const { return !mFinishedCommandBatches.empty(); } - angle::Result checkAndCleanupCompletedCommands(Context *context) + angle::Result checkAndCleanupCompletedCommands(ErrorContext *context) { ANGLE_TRY(checkCompletedCommands(context)); @@ -392,7 +394,7 @@ class CommandQueue : angle::NonCopyable std::move(waitSemaphoreStageMasks)); } ANGLE_INLINE angle::Result flushOutsideRPCommands( - Context *context, + ErrorContext *context, ProtectionType protectionType, egl::ContextPriority priority, OutsideRenderPassCommandBufferHelper **outsideRPCommands) @@ -401,7 +403,7 @@ class CommandQueue : angle::NonCopyable outsideRPCommands); } ANGLE_INLINE angle::Result flushRenderPassCommands( - Context *context, + ErrorContext *context, ProtectionType protectionType, const egl::ContextPriority &priority, const RenderPass &renderPass, @@ -417,17 +419,17 @@ class CommandQueue : angle::NonCopyable // Release finished commands and clean up garbage immediately, or request async clean up if // enabled. - angle::Result releaseFinishedCommandsAndCleanupGarbage(Context *context); - angle::Result releaseFinishedCommands(Context *context) + angle::Result releaseFinishedCommandsAndCleanupGarbage(ErrorContext *context); + angle::Result releaseFinishedCommands(ErrorContext *context) { std::lock_guard lock(mCmdReleaseMutex); return releaseFinishedCommandsLocked(context); } - angle::Result postSubmitCheck(Context *context); + angle::Result postSubmitCheck(ErrorContext *context); // Try to cleanup garbage and return if something was cleaned. Otherwise, wait for the // mInFlightCommands and retry. - angle::Result cleanupSomeGarbage(Context *context, + angle::Result cleanupSomeGarbage(ErrorContext *context, size_t minInFlightBatchesToKeep, bool *anyGarbageCleanedOut); @@ -435,19 +437,19 @@ class CommandQueue : angle::NonCopyable private: // Check the first command buffer in mInFlightCommands and update mLastCompletedSerials if // finished - angle::Result checkOneCommandBatchLocked(Context *context, bool *finished); + angle::Result checkOneCommandBatchLocked(ErrorContext *context, bool *finished); // Similar to checkOneCommandBatch, except we will wait for it to finish - angle::Result finishOneCommandBatch(Context *context, + angle::Result finishOneCommandBatch(ErrorContext *context, uint64_t timeout, std::unique_lock *lock); void onCommandBatchFinishedLocked(CommandBatch &&batch); // Walk mFinishedCommands, reset and recycle all command buffers. - angle::Result releaseFinishedCommandsLocked(Context *context); + angle::Result releaseFinishedCommandsLocked(ErrorContext *context); // Walk mInFlightCommands, check and update mLastCompletedSerials for all commands that are // finished - angle::Result checkCompletedCommandsLocked(Context *context); + angle::Result checkCompletedCommandsLocked(ErrorContext *context); - angle::Result queueSubmitLocked(Context *context, + angle::Result queueSubmitLocked(ErrorContext *context, egl::ContextPriority contextPriority, const VkSubmitInfo &submitInfo, DeviceScoped &commandBatch, @@ -495,7 +497,7 @@ class CommandQueue : angle::NonCopyable }; // A helper thread used to clean up garbage -class CleanUpThread : public Context +class CleanUpThread : public ErrorContext { public: CleanUpThread(Renderer *renderer, CommandQueue *commandQueue); @@ -509,7 +511,7 @@ class CleanUpThread : public Context angle::Result init(); - void destroy(Context *context); + void destroy(ErrorContext *context); void requestCleanUp(); @@ -521,7 +523,7 @@ class CleanUpThread : public Context std::lock_guard queueLock(mErrorMutex); return !mErrors.empty(); } - angle::Result checkAndPopPendingError(Context *errorHandlingContext); + angle::Result checkAndPopPendingError(ErrorContext *errorHandlingContext); // Entry point for clean up thread, calls processTasksImpl to do the // work. called by Renderer::initializeDevice on main thread diff --git a/src/libANGLE/renderer/vulkan/ContextVk.cpp b/src/libANGLE/renderer/vulkan/ContextVk.cpp index 2a811d0b3a8..45703ba60e3 100644 --- a/src/libANGLE/renderer/vulkan/ContextVk.cpp +++ b/src/libANGLE/renderer/vulkan/ContextVk.cpp @@ -550,7 +550,7 @@ vk::ImageLayout GetImageWriteLayoutAndSubresource(const gl::ImageUnit &imageUnit } template -void OnTextureBufferRead(vk::Context *context, +void OnTextureBufferRead(vk::ErrorContext *context, vk::BufferHelper *buffer, gl::ShaderBitSet stages, CommandBufferT *commandBufferHelper) @@ -569,7 +569,7 @@ void OnTextureBufferRead(vk::Context *context, } template -void OnImageBufferWrite(vk::Context *context, +void OnImageBufferWrite(vk::ErrorContext *context, BufferVk *bufferVk, gl::ShaderBitSet stages, CommandBufferT *commandBufferHelper) @@ -713,7 +713,7 @@ bool BlendModeSupportsDither(const ContextVk *contextVk, size_t colorIndex) return ditheringCompatibleBlendFactors || allowAdditionalBlendFactors; } -bool ShouldUseGraphicsDriverUniformsExtended(const vk::Context *context) +bool ShouldUseGraphicsDriverUniformsExtended(const vk::ErrorContext *context) { return context->getFeatures().emulateTransformFeedback.enabled; } @@ -874,7 +874,7 @@ ANGLE_INLINE void ContextVk::onRenderPassFinished(RenderPassClosureReason reason // ContextVk implementation. ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, vk::Renderer *renderer) : ContextImpl(state, errorSet), - vk::Context(renderer), + vk::ErrorContext(renderer), mGraphicsDirtyBitHandlers{}, mComputeDirtyBitHandlers{}, mRenderPassCommandBuffer(nullptr), @@ -1238,7 +1238,7 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, vk::Rendere mPipelineDirtyBitsMask.reset(gl::state::DIRTY_BIT_VERTEX_ARRAY_BINDING); } - // Stash the mRefCountedEventRecycler in vk::Context for ImageHelper to conveniently access + // Stash the mRefCountedEventRecycler in vk::ErrorContext for ImageHelper to conveniently access mShareGroupRefCountedEventsGarbageRecycler = mShareGroupVk->getRefCountedEventsGarbageRecycler(); @@ -8433,7 +8433,7 @@ bool ContextVk::shouldConvertUint8VkIndexType(gl::DrawElementsType glIndexType) !mRenderer->getFeatures().supportsIndexTypeUint8.enabled); } -uint32_t GetDriverUniformSize(vk::Context *context, PipelineType pipelineType) +uint32_t GetDriverUniformSize(vk::ErrorContext *context, PipelineType pipelineType) { if (pipelineType == PipelineType::Compute) { diff --git a/src/libANGLE/renderer/vulkan/ContextVk.h b/src/libANGLE/renderer/vulkan/ContextVk.h index f5ebb87441f..6942bc8f6e0 100644 --- a/src/libANGLE/renderer/vulkan/ContextVk.h +++ b/src/libANGLE/renderer/vulkan/ContextVk.h @@ -76,7 +76,7 @@ static constexpr GLbitfield kImageMemoryBarrierBits = GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT | GL_TEXTURE_UPDATE_BARRIER_BIT | GL_FRAMEBUFFER_BARRIER_BIT; -class ContextVk : public ContextImpl, public vk::Context, public MultisampleTextureInitializer +class ContextVk : public ContextImpl, public vk::ErrorContext, public MultisampleTextureInitializer { public: ContextVk(const gl::State &state, gl::ErrorSet *errorSet, vk::Renderer *renderer); @@ -1806,7 +1806,7 @@ ANGLE_INLINE bool UseLineRaster(const ContextVk *contextVk, gl::PrimitiveMode mo return gl::IsLineMode(mode); } -uint32_t GetDriverUniformSize(vk::Context *context, PipelineType pipelineType); +uint32_t GetDriverUniformSize(vk::ErrorContext *context, PipelineType pipelineType); } // namespace rx // Generate a perf warning, and insert an event marker in the command buffer. diff --git a/src/libANGLE/renderer/vulkan/DisplayVk.cpp b/src/libANGLE/renderer/vulkan/DisplayVk.cpp index 8c221941798..14c7c2f3b57 100644 --- a/src/libANGLE/renderer/vulkan/DisplayVk.cpp +++ b/src/libANGLE/renderer/vulkan/DisplayVk.cpp @@ -153,7 +153,7 @@ void InstallDebugAnnotator(egl::Display *display, vk::Renderer *renderer) DisplayVk::DisplayVk(const egl::DisplayState &state) : DisplayImpl(state), - vk::Context(new vk::Renderer()), + vk::ErrorContext(new vk::Renderer()), mScratchBuffer(1000u), mSupportedColorspaceFormatsMap{} {} diff --git a/src/libANGLE/renderer/vulkan/DisplayVk.h b/src/libANGLE/renderer/vulkan/DisplayVk.h index b3e5c61d3a1..365a4e28647 100644 --- a/src/libANGLE/renderer/vulkan/DisplayVk.h +++ b/src/libANGLE/renderer/vulkan/DisplayVk.h @@ -17,7 +17,7 @@ namespace rx { -class DisplayVk : public DisplayImpl, public vk::Context, public vk::GlobalOps +class DisplayVk : public DisplayImpl, public vk::ErrorContext, public vk::GlobalOps { public: DisplayVk(const egl::DisplayState &state); diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp index 0cbe81940e0..a4b0ed3d885 100644 --- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp +++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp @@ -2692,7 +2692,7 @@ void FramebufferVk::updateRenderPassDesc(ContextVk *contextVk) } angle::Result FramebufferVk::getAttachmentsAndRenderTargets( - vk::Context *context, + vk::ErrorContext *context, vk::FramebufferAttachmentsVector *unpackedAttachments, vk::FramebufferAttachmentsVector *packedRenderTargetsInfoOut) { diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.h b/src/libANGLE/renderer/vulkan/FramebufferVk.h index 21423366f47..fd16765d90b 100644 --- a/src/libANGLE/renderer/vulkan/FramebufferVk.h +++ b/src/libANGLE/renderer/vulkan/FramebufferVk.h @@ -188,7 +188,7 @@ class FramebufferVk : public FramebufferImpl // sparse to be placed in |RenderPassFramebuffer|, but the calling function will have to pack // them to match the render buffers before creating a framebuffer. angle::Result getAttachmentsAndRenderTargets( - vk::Context *context, + vk::ErrorContext *context, vk::FramebufferAttachmentsVector *unpackedAttachments, vk::FramebufferAttachmentsVector *packedRenderTargetsInfoOut); diff --git a/src/libANGLE/renderer/vulkan/PersistentCommandPool.cpp b/src/libANGLE/renderer/vulkan/PersistentCommandPool.cpp index a86c5bb9715..1c761847214 100644 --- a/src/libANGLE/renderer/vulkan/PersistentCommandPool.cpp +++ b/src/libANGLE/renderer/vulkan/PersistentCommandPool.cpp @@ -22,7 +22,7 @@ PersistentCommandPool::~PersistentCommandPool() ASSERT(!mCommandPool.valid() && mFreeBuffers.empty()); } -angle::Result PersistentCommandPool::init(Context *context, +angle::Result PersistentCommandPool::init(ErrorContext *context, ProtectionType protectionType, uint32_t queueFamilyIndex) { @@ -69,7 +69,7 @@ void PersistentCommandPool::destroy(VkDevice device) mCommandPool.destroy(device); } -angle::Result PersistentCommandPool::allocate(Context *context, +angle::Result PersistentCommandPool::allocate(ErrorContext *context, PrimaryCommandBuffer *commandBufferOut) { if (mFreeBuffers.empty()) @@ -84,7 +84,7 @@ angle::Result PersistentCommandPool::allocate(Context *context, return angle::Result::Continue; } -angle::Result PersistentCommandPool::collect(Context *context, PrimaryCommandBuffer &&buffer) +angle::Result PersistentCommandPool::collect(ErrorContext *context, PrimaryCommandBuffer &&buffer) { // VK_COMMAND_BUFFER_RESET_RELEASE_RESOURCES_BIT NOT set, The CommandBuffer // can still hold the memory resource @@ -94,7 +94,7 @@ angle::Result PersistentCommandPool::collect(Context *context, PrimaryCommandBuf return angle::Result::Continue; } -angle::Result PersistentCommandPool::allocateCommandBuffer(Context *context) +angle::Result PersistentCommandPool::allocateCommandBuffer(ErrorContext *context) { PrimaryCommandBuffer commandBuffer; { diff --git a/src/libANGLE/renderer/vulkan/PersistentCommandPool.h b/src/libANGLE/renderer/vulkan/PersistentCommandPool.h index 15f0453d69a..485755b6338 100644 --- a/src/libANGLE/renderer/vulkan/PersistentCommandPool.h +++ b/src/libANGLE/renderer/vulkan/PersistentCommandPool.h @@ -28,15 +28,17 @@ class PersistentCommandPool final ~PersistentCommandPool(); void destroy(VkDevice device); - angle::Result init(Context *context, ProtectionType protectionType, uint32_t queueFamilyIndex); + angle::Result init(ErrorContext *context, + ProtectionType protectionType, + uint32_t queueFamilyIndex); - angle::Result allocate(Context *context, PrimaryCommandBuffer *commandBufferOut); - angle::Result collect(Context *context, PrimaryCommandBuffer &&buffer); + angle::Result allocate(ErrorContext *context, PrimaryCommandBuffer *commandBufferOut); + angle::Result collect(ErrorContext *context, PrimaryCommandBuffer &&buffer); bool valid() const { return mCommandPool.valid(); } private: - angle::Result allocateCommandBuffer(Context *context); + angle::Result allocateCommandBuffer(ErrorContext *context); std::vector mFreeBuffers; diff --git a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp index c2b42d85499..d328a3f1d3a 100644 --- a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp +++ b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.cpp @@ -27,7 +27,7 @@ namespace // Limit decompressed vulkan pipelines to 10MB per program. static constexpr size_t kMaxLocalPipelineCacheSize = 10 * 1024 * 1024; -bool ValidateTransformedSpirV(vk::Context *context, +bool ValidateTransformedSpirV(vk::ErrorContext *context, const gl::ShaderBitSet &linkedShaderStages, const ShaderInterfaceVariableInfoMap &variableInfoMap, const gl::ShaderMap &spirvBlobs) @@ -86,7 +86,7 @@ uint32_t GetInterfaceBlockArraySize(const std::vector &block return arraySize; } -void SetupDefaultPipelineState(const vk::Context *context, +void SetupDefaultPipelineState(const vk::ErrorContext *context, const gl::ProgramExecutable &glExecutable, gl::PrimitiveMode mode, vk::PipelineRobustness pipelineRobustness, @@ -248,7 +248,7 @@ vk::GraphicsPipelineSubset GetWarmUpSubset(const angle::FeaturesVk &features) : vk::GraphicsPipelineSubset::Complete; } -angle::Result UpdateFullTexturesDescriptorSet(vk::Context *context, +angle::Result UpdateFullTexturesDescriptorSet(vk::ErrorContext *context, const ShaderInterfaceVariableInfoMap &variableInfoMap, const vk::WriteDescriptorDescs &writeDescriptorDescs, UpdateDescriptorSetsBuilder *updateBuilder, @@ -354,15 +354,15 @@ angle::Result UpdateFullTexturesDescriptorSet(vk::Context *context, } } // namespace -class ProgramExecutableVk::WarmUpTaskCommon : public vk::Context, public LinkSubTask +class ProgramExecutableVk::WarmUpTaskCommon : public vk::ErrorContext, public LinkSubTask { public: - WarmUpTaskCommon(vk::Renderer *renderer) : vk::Context(renderer) {} + WarmUpTaskCommon(vk::Renderer *renderer) : vk::ErrorContext(renderer) {} WarmUpTaskCommon(vk::Renderer *renderer, ProgramExecutableVk *executableVk, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess) - : vk::Context(renderer), + : vk::ErrorContext(renderer), mExecutableVk(executableVk), mPipelineRobustness(pipelineRobustness), mPipelineProtectedAccess(pipelineProtectedAccess) @@ -523,7 +523,7 @@ ShaderInfo::ShaderInfo() {} ShaderInfo::~ShaderInfo() = default; -angle::Result ShaderInfo::initShaders(vk::Context *context, +angle::Result ShaderInfo::initShaders(vk::ErrorContext *context, const gl::ShaderBitSet &linkedShaderStages, const gl::ShaderMap &spirvBlobs, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -596,7 +596,7 @@ ProgramInfo::ProgramInfo() {} ProgramInfo::~ProgramInfo() = default; -angle::Result ProgramInfo::initProgram(vk::Context *context, +angle::Result ProgramInfo::initProgram(vk::ErrorContext *context, gl::ShaderType shaderType, bool isLastPreFragmentStage, bool isTransformFeedbackProgram, @@ -732,7 +732,7 @@ void ProgramExecutableVk::reset(ContextVk *contextVk) } } -angle::Result ProgramExecutableVk::initializePipelineCache(vk::Context *context, +angle::Result ProgramExecutableVk::initializePipelineCache(vk::ErrorContext *context, bool compressed, const std::vector &pipelineData) { @@ -769,7 +769,7 @@ angle::Result ProgramExecutableVk::initializePipelineCache(vk::Context *context, return angle::Result::Continue; } -angle::Result ProgramExecutableVk::ensurePipelineCacheInitialized(vk::Context *context) +angle::Result ProgramExecutableVk::ensurePipelineCacheInitialized(vk::ErrorContext *context) { if (!mPipelineCache.valid()) { @@ -953,7 +953,7 @@ angle::Result ProgramExecutableVk::getPipelineCacheWarmUpTasks( } angle::Result ProgramExecutableVk::prepareForWarmUpPipelineCache( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess, vk::GraphicsPipelineSubset subset, @@ -1035,7 +1035,7 @@ angle::Result ProgramExecutableVk::prepareForWarmUpPipelineCache( } angle::Result ProgramExecutableVk::warmUpComputePipelineCache( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess) { @@ -1062,7 +1062,7 @@ angle::Result ProgramExecutableVk::warmUpComputePipelineCache( } angle::Result ProgramExecutableVk::warmUpGraphicsPipelineCache( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess, vk::GraphicsPipelineSubset subset, @@ -1156,7 +1156,7 @@ void ProgramExecutableVk::waitForGraphicsPostLinkTasks( waitForPostLinkTasksImpl(contextVk); } -angle::Result ProgramExecutableVk::mergePipelineCacheToRenderer(vk::Context *context) const +angle::Result ProgramExecutableVk::mergePipelineCacheToRenderer(vk::ErrorContext *context) const { // Merge the cache with Renderer's if (context->getFeatures().mergeProgramPipelineCachesToGlobalCache.enabled) @@ -1255,7 +1255,7 @@ void ProgramExecutableVk::addImageDescriptorSetDesc(vk::DescriptorSetLayoutDesc } } -void ProgramExecutableVk::addInputAttachmentDescriptorSetDesc(vk::Context *context, +void ProgramExecutableVk::addInputAttachmentDescriptorSetDesc(vk::ErrorContext *context, vk::DescriptorSetLayoutDesc *descOut) { if (!mExecutable->getLinkedShaderStages()[gl::ShaderType::Fragment]) @@ -1307,7 +1307,7 @@ void ProgramExecutableVk::addInputAttachmentDescriptorSetDesc(vk::Context *conte } angle::Result ProgramExecutableVk::addTextureDescriptorSetDesc( - vk::Context *context, + vk::ErrorContext *context, const gl::ActiveTextureArray *activeTextures, vk::DescriptorSetLayoutDesc *descOut) { @@ -1407,7 +1407,7 @@ angle::Result ProgramExecutableVk::addTextureDescriptorSetDesc( return angle::Result::Continue; } -void ProgramExecutableVk::initializeWriteDescriptorDesc(vk::Context *context) +void ProgramExecutableVk::initializeWriteDescriptorDesc(vk::ErrorContext *context) { const gl::ShaderBitSet &linkedShaderStages = mExecutable->getLinkedShaderStages(); @@ -1481,7 +1481,7 @@ ProgramTransformOptions ProgramExecutableVk::getTransformOptions( } angle::Result ProgramExecutableVk::initGraphicsShaderPrograms( - vk::Context *context, + vk::ErrorContext *context, ProgramTransformOptions transformOptions) { ASSERT(mExecutable->hasLinkedShaderStage(gl::ShaderType::Vertex)); @@ -1505,7 +1505,7 @@ angle::Result ProgramExecutableVk::initGraphicsShaderPrograms( } angle::Result ProgramExecutableVk::initProgramThenCreateGraphicsPipeline( - vk::Context *context, + vk::ErrorContext *context, ProgramTransformOptions transformOptions, vk::GraphicsPipelineSubset pipelineSubset, vk::PipelineCacheAccess *pipelineCache, @@ -1522,7 +1522,7 @@ angle::Result ProgramExecutableVk::initProgramThenCreateGraphicsPipeline( } angle::Result ProgramExecutableVk::createGraphicsPipelineImpl( - vk::Context *context, + vk::ErrorContext *context, ProgramTransformOptions transformOptions, vk::GraphicsPipelineSubset pipelineSubset, vk::PipelineCacheAccess *pipelineCache, @@ -1673,7 +1673,7 @@ angle::Result ProgramExecutableVk::linkGraphicsPipelineLibraries( } angle::Result ProgramExecutableVk::getOrCreateComputePipeline( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, PipelineSource source, vk::PipelineRobustness pipelineRobustness, @@ -1692,7 +1692,7 @@ angle::Result ProgramExecutableVk::getOrCreateComputePipeline( } angle::Result ProgramExecutableVk::createPipelineLayout( - vk::Context *context, + vk::ErrorContext *context, PipelineLayoutCache *pipelineLayoutCache, DescriptorSetLayoutCache *descriptorSetLayoutCache, gl::ActiveTextureArray *activeTextures) @@ -1818,7 +1818,7 @@ angle::Result ProgramExecutableVk::createPipelineLayout( } angle::Result ProgramExecutableVk::initializeDescriptorPools( - vk::Context *context, + vk::ErrorContext *context, DescriptorSetLayoutCache *descriptorSetLayoutCache, vk::DescriptorSetArray *metaDescriptorPools) { @@ -1873,7 +1873,7 @@ void ProgramExecutableVk::resolvePrecisionMismatch(const gl::ProgramMergedVaryin } angle::Result ProgramExecutableVk::getOrAllocateDescriptorSet( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, const vk::DescriptorSetDescBuilder &descriptorSetDesc, @@ -1912,7 +1912,7 @@ angle::Result ProgramExecutableVk::getOrAllocateDescriptorSet( } angle::Result ProgramExecutableVk::updateShaderResourcesDescriptorSet( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, const vk::WriteDescriptorDescs &writeDescriptorDescs, @@ -1941,7 +1941,7 @@ angle::Result ProgramExecutableVk::updateShaderResourcesDescriptorSet( } angle::Result ProgramExecutableVk::updateUniformsAndXfbDescriptorSet( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, const vk::WriteDescriptorDescs &writeDescriptorDescs, @@ -1958,7 +1958,7 @@ angle::Result ProgramExecutableVk::updateUniformsAndXfbDescriptorSet( } angle::Result ProgramExecutableVk::updateTexturesDescriptorSet( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, const gl::ActiveTextureArray &textures, const gl::SamplerBindingVector &samplers, @@ -2015,7 +2015,7 @@ angle::Result ProgramExecutableVk::updateTexturesDescriptorSet( template angle::Result ProgramExecutableVk::bindDescriptorSets( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, vk::CommandBufferHelperCommon *commandBufferHelper, CommandBufferT *commandBuffer, @@ -2085,13 +2085,13 @@ angle::Result ProgramExecutableVk::bindDescriptorSets( } template angle::Result ProgramExecutableVk::bindDescriptorSets( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, vk::CommandBufferHelperCommon *commandBufferHelper, vk::priv::SecondaryCommandBuffer *commandBuffer, PipelineType pipelineType); template angle::Result ProgramExecutableVk::bindDescriptorSets( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, vk::CommandBufferHelperCommon *commandBufferHelper, vk::VulkanSecondaryCommandBuffer *commandBuffer, @@ -2109,7 +2109,7 @@ void ProgramExecutableVk::setAllDefaultUniformsDirty() } } -angle::Result ProgramExecutableVk::updateUniforms(vk::Context *context, +angle::Result ProgramExecutableVk::updateUniforms(vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, vk::BufferHelper *emptyBuffer, @@ -2201,7 +2201,7 @@ angle::Result ProgramExecutableVk::updateUniforms(vk::Context *context, } size_t ProgramExecutableVk::calcUniformUpdateRequiredSpace( - vk::Context *context, + vk::ErrorContext *context, gl::ShaderMap *uniformOffsets) const { size_t requiredSpace = 0; @@ -2229,7 +2229,7 @@ void ProgramExecutableVk::onProgramBind() } angle::Result ProgramExecutableVk::resizeUniformBlockMemory( - vk::Context *context, + vk::ErrorContext *context, const gl::ShaderMap &requiredBufferSize) { for (gl::ShaderType shaderType : mExecutable->getLinkedShaderStages()) diff --git a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h index e96147a938e..1e2726d96c1 100644 --- a/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h +++ b/src/libANGLE/renderer/vulkan/ProgramExecutableVk.h @@ -32,7 +32,7 @@ class ShaderInfo final : angle::NonCopyable ShaderInfo(); ~ShaderInfo(); - angle::Result initShaders(vk::Context *context, + angle::Result initShaders(vk::ErrorContext *context, const gl::ShaderBitSet &linkedShaderStages, const gl::ShaderMap &spirvBlobs, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -76,7 +76,7 @@ class ProgramInfo final : angle::NonCopyable ProgramInfo(); ~ProgramInfo(); - angle::Result initProgram(vk::Context *context, + angle::Result initProgram(vk::ErrorContext *context, gl::ShaderType shaderType, bool isLastPreFragmentStage, bool isTransformFeedbackProgram, @@ -197,7 +197,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl const vk::GraphicsPipelineDesc **descPtrOut, vk::PipelineHelper **pipelineOut); - angle::Result getOrCreateComputePipeline(vk::Context *context, + angle::Result getOrCreateComputePipeline(vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, PipelineSource source, vk::PipelineRobustness pipelineRobustness, @@ -206,16 +206,16 @@ class ProgramExecutableVk : public ProgramExecutableImpl const vk::PipelineLayout &getPipelineLayout() const { return *mPipelineLayout; } void resetLayout(ContextVk *contextVk); - angle::Result createPipelineLayout(vk::Context *context, + angle::Result createPipelineLayout(vk::ErrorContext *context, PipelineLayoutCache *pipelineLayoutCache, DescriptorSetLayoutCache *descriptorSetLayoutCache, gl::ActiveTextureArray *activeTextures); angle::Result initializeDescriptorPools( - vk::Context *context, + vk::ErrorContext *context, DescriptorSetLayoutCache *descriptorSetLayoutCache, vk::DescriptorSetArray *metaDescriptorPools); - angle::Result updateTexturesDescriptorSet(vk::Context *context, + angle::Result updateTexturesDescriptorSet(vk::ErrorContext *context, uint32_t currentFrame, const gl::ActiveTextureArray &textures, const gl::SamplerBindingVector &samplers, @@ -223,7 +223,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl UpdateDescriptorSetsBuilder *updateBuilder); angle::Result updateShaderResourcesDescriptorSet( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, const vk::WriteDescriptorDescs &writeDescriptorDescs, @@ -231,7 +231,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl vk::SharedDescriptorSetCacheKey *newSharedCacheKeyOut); angle::Result updateUniformsAndXfbDescriptorSet( - vk::Context *context, + vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, const vk::WriteDescriptorDescs &writeDescriptorDescs, @@ -240,7 +240,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl vk::SharedDescriptorSetCacheKey *sharedCacheKeyOut); template - angle::Result bindDescriptorSets(vk::Context *context, + angle::Result bindDescriptorSets(vk::ErrorContext *context, uint32_t currentFrame, vk::CommandBufferHelperCommon *commandBufferHelper, CommandBufferT *commandBuffer, @@ -268,7 +268,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl return (mImmutableSamplerIndexMap == immutableSamplerIndexMap); } - size_t getDefaultUniformAlignedSize(vk::Context *context, gl::ShaderType shaderType) const + size_t getDefaultUniformAlignedSize(vk::ErrorContext *context, gl::ShaderType shaderType) const { vk::Renderer *renderer = context->getRenderer(); size_t alignment = static_cast( @@ -304,7 +304,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl } void setAllDefaultUniformsDirty(); - angle::Result updateUniforms(vk::Context *context, + angle::Result updateUniforms(vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, vk::BufferHelper *emptyBuffer, @@ -341,7 +341,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl void waitForGraphicsPostLinkTasks(ContextVk *contextVk, const vk::GraphicsPipelineDesc ¤tGraphicsPipelineDesc); - angle::Result mergePipelineCacheToRenderer(vk::Context *context) const; + angle::Result mergePipelineCacheToRenderer(vk::ErrorContext *context) const; const vk::WriteDescriptorDescs &getShaderResourceWriteDescriptorDescs() const { @@ -359,10 +359,10 @@ class ProgramExecutableVk : public ProgramExecutableImpl return mTextureWriteDescriptorDescs; } // The following functions are for internal use of programs, including from a threaded link job: - angle::Result resizeUniformBlockMemory(vk::Context *context, + angle::Result resizeUniformBlockMemory(vk::ErrorContext *context, const gl::ShaderMap &requiredBufferSize); void resolvePrecisionMismatch(const gl::ProgramMergedVaryings &mergedVaryings); - angle::Result initShaders(vk::Context *context, + angle::Result initShaders(vk::ErrorContext *context, const gl::ShaderBitSet &linkedShaderStages, const gl::ShaderMap &spirvBlobs, bool isGLES1) @@ -370,7 +370,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl return mOriginalShaderInfo.initShaders(context, linkedShaderStages, spirvBlobs, mVariableInfoMap, isGLES1); } - void assignAllSpvLocations(vk::Context *context, + void assignAllSpvLocations(vk::ErrorContext *context, const gl::ProgramState &programState, const gl::ProgramLinkedResources &resources) { @@ -397,17 +397,17 @@ class ProgramExecutableVk : public ProgramExecutableImpl const std::vector &atomicCounterBuffers, vk::DescriptorSetLayoutDesc *descOut); void addImageDescriptorSetDesc(vk::DescriptorSetLayoutDesc *descOut); - void addInputAttachmentDescriptorSetDesc(vk::Context *context, + void addInputAttachmentDescriptorSetDesc(vk::ErrorContext *context, vk::DescriptorSetLayoutDesc *descOut); angle::Result addTextureDescriptorSetDesc( - vk::Context *context, + vk::ErrorContext *context, const gl::ActiveTextureArray *activeTextures, vk::DescriptorSetLayoutDesc *descOut); - size_t calcUniformUpdateRequiredSpace(vk::Context *context, + size_t calcUniformUpdateRequiredSpace(vk::ErrorContext *context, gl::ShaderMap *uniformOffsets) const; - ANGLE_INLINE angle::Result initProgram(vk::Context *context, + ANGLE_INLINE angle::Result initProgram(vk::ErrorContext *context, gl::ShaderType shaderType, bool isLastPreFragmentStage, bool isTransformFeedbackProgram, @@ -431,7 +431,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl } ANGLE_INLINE angle::Result initGraphicsShaderProgram( - vk::Context *context, + vk::ErrorContext *context, gl::ShaderType shaderType, bool isLastPreFragmentStage, bool isTransformFeedbackProgram, @@ -445,7 +445,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl } ANGLE_INLINE angle::Result initComputeProgram( - vk::Context *context, + vk::ErrorContext *context, ProgramInfo *programInfo, const ShaderInterfaceVariableInfoMap &variableInfoMap, const vk::ComputePipelineOptions &pipelineOptions) @@ -458,9 +458,9 @@ class ProgramExecutableVk : public ProgramExecutableImpl ProgramTransformOptions getTransformOptions(ContextVk *contextVk, const vk::GraphicsPipelineDesc &desc); - angle::Result initGraphicsShaderPrograms(vk::Context *context, + angle::Result initGraphicsShaderPrograms(vk::ErrorContext *context, ProgramTransformOptions transformOptions); - angle::Result initProgramThenCreateGraphicsPipeline(vk::Context *context, + angle::Result initProgramThenCreateGraphicsPipeline(vk::ErrorContext *context, ProgramTransformOptions transformOptions, vk::GraphicsPipelineSubset pipelineSubset, vk::PipelineCacheAccess *pipelineCache, @@ -469,7 +469,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl const vk::RenderPass &compatibleRenderPass, const vk::GraphicsPipelineDesc **descPtrOut, vk::PipelineHelper **pipelineOut); - angle::Result createGraphicsPipelineImpl(vk::Context *context, + angle::Result createGraphicsPipelineImpl(vk::ErrorContext *context, ProgramTransformOptions transformOptions, vk::GraphicsPipelineSubset pipelineSubset, vk::PipelineCacheAccess *pipelineCache, @@ -479,7 +479,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl const vk::GraphicsPipelineDesc **descPtrOut, vk::PipelineHelper **pipelineOut); angle::Result prepareForWarmUpPipelineCache( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess, vk::GraphicsPipelineSubset subset, @@ -487,10 +487,10 @@ class ProgramExecutableVk : public ProgramExecutableImpl angle::FixedVector *surfaceRotationVariationsOut, vk::GraphicsPipelineDesc **graphicsPipelineDescOut, vk::RenderPass *renderPassOut); - angle::Result warmUpComputePipelineCache(vk::Context *context, + angle::Result warmUpComputePipelineCache(vk::ErrorContext *context, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess); - angle::Result warmUpGraphicsPipelineCache(vk::Context *context, + angle::Result warmUpGraphicsPipelineCache(vk::ErrorContext *context, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess, vk::GraphicsPipelineSubset subset, @@ -500,7 +500,7 @@ class ProgramExecutableVk : public ProgramExecutableImpl vk::PipelineHelper *placeholderPipelineHelper); void waitForPostLinkTasksImpl(ContextVk *contextVk); - angle::Result getOrAllocateDescriptorSet(vk::Context *context, + angle::Result getOrAllocateDescriptorSet(vk::ErrorContext *context, uint32_t currentFrame, UpdateDescriptorSetsBuilder *updateBuilder, const vk::DescriptorSetDescBuilder &descriptorSetDesc, @@ -510,12 +510,12 @@ class ProgramExecutableVk : public ProgramExecutableImpl // When loading from cache / binary, initialize the pipeline cache with given data. Otherwise // the cache is lazily created as needed. - angle::Result initializePipelineCache(vk::Context *context, + angle::Result initializePipelineCache(vk::ErrorContext *context, bool compressed, const std::vector &pipelineData); - angle::Result ensurePipelineCacheInitialized(vk::Context *context); + angle::Result ensurePipelineCacheInitialized(vk::ErrorContext *context); - void initializeWriteDescriptorDesc(vk::Context *context); + void initializeWriteDescriptorDesc(vk::ErrorContext *context); // Descriptor sets and pools for shader resources for this program. vk::DescriptorSetArray mDescriptorSets; diff --git a/src/libANGLE/renderer/vulkan/ProgramVk.cpp b/src/libANGLE/renderer/vulkan/ProgramVk.cpp index 200e2d5cf0e..095616f75e5 100644 --- a/src/libANGLE/renderer/vulkan/ProgramVk.cpp +++ b/src/libANGLE/renderer/vulkan/ProgramVk.cpp @@ -48,7 +48,7 @@ class Std140BlockLayoutEncoderFactory : public gl::CustomBlockLayoutEncoderFacto sh::BlockLayoutEncoder *makeEncoder() override { return new sh::Std140BlockEncoder(); } }; -class LinkTaskVk final : public vk::Context, public LinkTask +class LinkTaskVk final : public vk::ErrorContext, public LinkTask { public: LinkTaskVk(vk::Renderer *renderer, @@ -58,7 +58,7 @@ class LinkTaskVk final : public vk::Context, public LinkTask bool isGLES1, vk::PipelineRobustness pipelineRobustness, vk::PipelineProtectedAccess pipelineProtectedAccess) - : vk::Context(renderer), + : vk::ErrorContext(renderer), mState(state), mExecutable(&mState.getExecutable()), mIsGLES1(isGLES1), diff --git a/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp b/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp index f0e7bd5576a..9c85cd85525 100644 --- a/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp +++ b/src/libANGLE/renderer/vulkan/RenderTargetVk.cpp @@ -181,7 +181,7 @@ const vk::ImageHelper &RenderTargetVk::getResolveImageForRenderPass() const return *mResolveImage; } -angle::Result RenderTargetVk::getImageViewImpl(vk::Context *context, +angle::Result RenderTargetVk::getImageViewImpl(vk::ErrorContext *context, const vk::ImageHelper &image, vk::ImageViewHelper *imageViews, const vk::ImageView **imageViewOut) const @@ -199,14 +199,14 @@ angle::Result RenderTargetVk::getImageViewImpl(vk::Context *context, imageViewOut); } -angle::Result RenderTargetVk::getImageView(vk::Context *context, +angle::Result RenderTargetVk::getImageView(vk::ErrorContext *context, const vk::ImageView **imageViewOut) const { ASSERT(mImage); return getImageViewImpl(context, *mImage, mImageViews, imageViewOut); } -angle::Result RenderTargetVk::getImageViewWithColorspace(vk::Context *context, +angle::Result RenderTargetVk::getImageViewWithColorspace(vk::ErrorContext *context, gl::SrgbWriteControlMode mode, const vk::ImageView **imageViewOut) const { @@ -215,14 +215,14 @@ angle::Result RenderTargetVk::getImageViewWithColorspace(vk::Context *context, return getImageViewImpl(context, *mImage, mImageViews, imageViewOut); } -angle::Result RenderTargetVk::getResolveImageView(vk::Context *context, +angle::Result RenderTargetVk::getResolveImageView(vk::ErrorContext *context, const vk::ImageView **imageViewOut) const { ASSERT(mResolveImage); return getImageViewImpl(context, *mResolveImage, mResolveImageViews, imageViewOut); } -angle::Result RenderTargetVk::getDepthOrStencilImageView(vk::Context *context, +angle::Result RenderTargetVk::getDepthOrStencilImageView(vk::ErrorContext *context, VkImageAspectFlagBits aspect, const vk::ImageView **imageViewOut) const { @@ -231,7 +231,7 @@ angle::Result RenderTargetVk::getDepthOrStencilImageView(vk::Context *context, } angle::Result RenderTargetVk::getDepthOrStencilImageViewForCopy( - vk::Context *context, + vk::ErrorContext *context, VkImageAspectFlagBits aspect, const vk::ImageView **imageViewOut) const { @@ -241,7 +241,7 @@ angle::Result RenderTargetVk::getDepthOrStencilImageViewForCopy( } angle::Result RenderTargetVk::getResolveDepthOrStencilImageView( - vk::Context *context, + vk::ErrorContext *context, VkImageAspectFlagBits aspect, const vk::ImageView **imageViewOut) const { @@ -251,7 +251,7 @@ angle::Result RenderTargetVk::getResolveDepthOrStencilImageView( } angle::Result RenderTargetVk::getDepthOrStencilImageViewImpl( - vk::Context *context, + vk::ErrorContext *context, const vk::ImageHelper &image, vk::ImageViewHelper *imageViews, VkImageAspectFlagBits aspect, @@ -291,7 +291,7 @@ vk::ImageHelper *RenderTargetVk::getOwnerOfData() const return isResolveImageOwnerOfData() ? mResolveImage : mImage; } -angle::Result RenderTargetVk::getCopyImageView(vk::Context *context, +angle::Result RenderTargetVk::getCopyImageView(vk::ErrorContext *context, const vk::ImageView **imageViewOut) const { const vk::ImageViewHelper *imageViews = diff --git a/src/libANGLE/renderer/vulkan/RenderTargetVk.h b/src/libANGLE/renderer/vulkan/RenderTargetVk.h index 19d45e34624..e9df6d17ab6 100644 --- a/src/libANGLE/renderer/vulkan/RenderTargetVk.h +++ b/src/libANGLE/renderer/vulkan/RenderTargetVk.h @@ -92,25 +92,26 @@ class RenderTargetVk final : public FramebufferAttachmentRenderTarget vk::ImageHelper &getImageForWrite() const; // For cube maps we use single-level single-layer 2D array views. - angle::Result getImageView(vk::Context *context, const vk::ImageView **imageViewOut) const; - angle::Result getImageViewWithColorspace(vk::Context *context, + angle::Result getImageView(vk::ErrorContext *context, const vk::ImageView **imageViewOut) const; + angle::Result getImageViewWithColorspace(vk::ErrorContext *context, gl::SrgbWriteControlMode srgbWriteContrlMode, const vk::ImageView **imageViewOut) const; - angle::Result getResolveImageView(vk::Context *context, + angle::Result getResolveImageView(vk::ErrorContext *context, const vk::ImageView **imageViewOut) const; - angle::Result getDepthOrStencilImageView(vk::Context *context, + angle::Result getDepthOrStencilImageView(vk::ErrorContext *context, VkImageAspectFlagBits aspect, const vk::ImageView **imageViewOut) const; - angle::Result getDepthOrStencilImageViewForCopy(vk::Context *context, + angle::Result getDepthOrStencilImageViewForCopy(vk::ErrorContext *context, VkImageAspectFlagBits aspect, const vk::ImageView **imageViewOut) const; - angle::Result getResolveDepthOrStencilImageView(vk::Context *context, + angle::Result getResolveDepthOrStencilImageView(vk::ErrorContext *context, VkImageAspectFlagBits aspect, const vk::ImageView **imageViewOut) const; // For 3D textures, the 2D view created for render target is invalid to read from. The // following will return a view to the whole image (for all types, including 3D and 2DArray). - angle::Result getCopyImageView(vk::Context *context, const vk::ImageView **imageViewOut) const; + angle::Result getCopyImageView(vk::ErrorContext *context, + const vk::ImageView **imageViewOut) const; angle::FormatID getImageActualFormatID() const; const angle::Format &getImageActualFormat() const; @@ -208,11 +209,11 @@ class RenderTargetVk final : public FramebufferAttachmentRenderTarget void invalidateImageAndViews(); void reset(); - angle::Result getImageViewImpl(vk::Context *context, + angle::Result getImageViewImpl(vk::ErrorContext *context, const vk::ImageHelper &image, vk::ImageViewHelper *imageViews, const vk::ImageView **imageViewOut) const; - angle::Result getDepthOrStencilImageViewImpl(vk::Context *context, + angle::Result getDepthOrStencilImageViewImpl(vk::ErrorContext *context, const vk::ImageHelper &image, vk::ImageViewHelper *imageViews, VkImageAspectFlagBits aspect, diff --git a/src/libANGLE/renderer/vulkan/SecondaryCommandBuffer.h b/src/libANGLE/renderer/vulkan/SecondaryCommandBuffer.h index 0894d46cabb..e316a1d9af1 100644 --- a/src/libANGLE/renderer/vulkan/SecondaryCommandBuffer.h +++ b/src/libANGLE/renderer/vulkan/SecondaryCommandBuffer.h @@ -27,7 +27,7 @@ class ContextVk; namespace vk { -class Context; +class ErrorContext; class RenderPassDesc; class SecondaryCommandPool; @@ -831,7 +831,7 @@ class SecondaryCommandBuffer final : angle::NonCopyable // buffer. static constexpr bool ExecutesInline() { return true; } - static angle::Result InitializeCommandPool(Context *context, + static angle::Result InitializeCommandPool(ErrorContext *context, SecondaryCommandPool *pool, uint32_t queueFamilyIndex, ProtectionType protectionType) @@ -1119,7 +1119,7 @@ class SecondaryCommandBuffer final : angle::NonCopyable std::string dumpCommands(const char *separator) const; // Initialize the SecondaryCommandBuffer by setting the allocator it will use - angle::Result initialize(vk::Context *context, + angle::Result initialize(vk::ErrorContext *context, vk::SecondaryCommandPool *pool, bool isRenderPassCommandBuffer, SecondaryCommandMemoryAllocator *allocator) @@ -1137,11 +1137,12 @@ class SecondaryCommandBuffer final : angle::NonCopyable mCommandAllocator.detachAllocator(destination); } - angle::Result begin(Context *context, const VkCommandBufferInheritanceInfo &inheritanceInfo) + angle::Result begin(ErrorContext *context, + const VkCommandBufferInheritanceInfo &inheritanceInfo) { return angle::Result::Continue; } - angle::Result end(Context *context) { return angle::Result::Continue; } + angle::Result end(ErrorContext *context) { return angle::Result::Continue; } void open() { mIsOpen = true; } void close() { mIsOpen = false; } diff --git a/src/libANGLE/renderer/vulkan/SecondaryCommandPool.cpp b/src/libANGLE/renderer/vulkan/SecondaryCommandPool.cpp index fb4980d40b4..2a6d0711444 100644 --- a/src/libANGLE/renderer/vulkan/SecondaryCommandPool.cpp +++ b/src/libANGLE/renderer/vulkan/SecondaryCommandPool.cpp @@ -26,7 +26,7 @@ SecondaryCommandPool::~SecondaryCommandPool() ASSERT(mCollectedBuffersOverflow.empty()); } -angle::Result SecondaryCommandPool::init(Context *context, +angle::Result SecondaryCommandPool::init(ErrorContext *context, uint32_t queueFamilyIndex, ProtectionType protectionType) { @@ -56,7 +56,8 @@ void SecondaryCommandPool::destroy(VkDevice device) mCommandPool.destroy(device); } -angle::Result SecondaryCommandPool::allocate(Context *context, VulkanSecondaryCommandBuffer *buffer) +angle::Result SecondaryCommandPool::allocate(ErrorContext *context, + VulkanSecondaryCommandBuffer *buffer) { ASSERT(valid()); ASSERT(!buffer->valid()); diff --git a/src/libANGLE/renderer/vulkan/SecondaryCommandPool.h b/src/libANGLE/renderer/vulkan/SecondaryCommandPool.h index f052ec05d91..704c0c130c0 100644 --- a/src/libANGLE/renderer/vulkan/SecondaryCommandPool.h +++ b/src/libANGLE/renderer/vulkan/SecondaryCommandPool.h @@ -19,7 +19,7 @@ namespace rx { namespace vk { -class Context; +class ErrorContext; class VulkanSecondaryCommandBuffer; // VkCommandPool must be externally synchronized when its Command Buffers are: allocated, freed, @@ -31,13 +31,15 @@ class SecondaryCommandPool final : angle::NonCopyable SecondaryCommandPool(); ~SecondaryCommandPool(); - angle::Result init(Context *context, uint32_t queueFamilyIndex, ProtectionType protectionType); + angle::Result init(ErrorContext *context, + uint32_t queueFamilyIndex, + ProtectionType protectionType); void destroy(VkDevice device); bool valid() const { return mCommandPool.valid(); } // Call only from the Context thread that owns the SecondaryCommandPool instance. - angle::Result allocate(Context *context, VulkanSecondaryCommandBuffer *buffer); + angle::Result allocate(ErrorContext *context, VulkanSecondaryCommandBuffer *buffer); // Single threaded - use external synchronization. void collect(VulkanSecondaryCommandBuffer *buffer); diff --git a/src/libANGLE/renderer/vulkan/Suballocation.cpp b/src/libANGLE/renderer/vulkan/Suballocation.cpp index 1cd5a0edd3c..dfe2350e516 100644 --- a/src/libANGLE/renderer/vulkan/Suballocation.cpp +++ b/src/libANGLE/renderer/vulkan/Suballocation.cpp @@ -84,7 +84,7 @@ void BufferBlock::destroy(Renderer *renderer) mDeviceMemory.destroy(device); } -VkResult BufferBlock::init(Context *context, +VkResult BufferBlock::init(ErrorContext *context, Buffer &buffer, uint32_t memoryTypeIndex, vma::VirtualBlockCreateFlags flags, @@ -112,7 +112,7 @@ VkResult BufferBlock::init(Context *context, return VK_SUCCESS; } -void BufferBlock::initWithoutVirtualBlock(Context *context, +void BufferBlock::initWithoutVirtualBlock(ErrorContext *context, Buffer &buffer, MemoryAllocationType memoryAllocationType, uint32_t memoryTypeIndex, @@ -177,7 +177,7 @@ void BufferBlock::calculateStats(vma::StatInfo *pStatInfo) const } // BufferSuballocation implementation. -VkResult BufferSuballocation::map(Context *context) +VkResult BufferSuballocation::map(ErrorContext *context) { return mBufferBlock->map(context->getDevice()); } diff --git a/src/libANGLE/renderer/vulkan/Suballocation.h b/src/libANGLE/renderer/vulkan/Suballocation.h index 0431e3e6f39..34ac84b0edc 100644 --- a/src/libANGLE/renderer/vulkan/Suballocation.h +++ b/src/libANGLE/renderer/vulkan/Suballocation.h @@ -25,7 +25,7 @@ enum class MemoryAllocationType; namespace vk { -class Context; +class ErrorContext; // BufferBlock class BufferBlock final : angle::NonCopyable @@ -36,14 +36,14 @@ class BufferBlock final : angle::NonCopyable ~BufferBlock(); void destroy(Renderer *renderer); - VkResult init(Context *context, + VkResult init(ErrorContext *context, Buffer &buffer, uint32_t memoryTypeIndex, vma::VirtualBlockCreateFlags flags, DeviceMemory &deviceMemory, VkMemoryPropertyFlags memoryPropertyFlags, VkDeviceSize size); - void initWithoutVirtualBlock(Context *context, + void initWithoutVirtualBlock(ErrorContext *context, Buffer &buffer, MemoryAllocationType memoryAllocationType, uint32_t memoryTypeIndex, @@ -190,7 +190,7 @@ class BufferSuballocation final : angle::NonCopyable VmaVirtualAllocation allocation, VkDeviceSize offset, VkDeviceSize size); - void initWithEntireBuffer(Context *context, + void initWithEntireBuffer(ErrorContext *context, Buffer &buffer, MemoryAllocationType memoryAllocationType, uint32_t memoryTypeIndex, @@ -212,7 +212,7 @@ class BufferSuballocation final : angle::NonCopyable void invalidate(const VkDevice &device); VkDeviceSize getOffset() const; bool valid() const; - VkResult map(Context *context); + VkResult map(ErrorContext *context); BufferSerial getBlockSerial() const; uint8_t *getBlockMemory() const; VkDeviceSize getBlockMemorySize() const; @@ -375,7 +375,7 @@ ANGLE_INLINE void BufferSuballocation::init(BufferBlock *block, } ANGLE_INLINE void BufferSuballocation::initWithEntireBuffer( - Context *context, + ErrorContext *context, Buffer &buffer, MemoryAllocationType memoryAllocationType, uint32_t memoryTypeIndex, diff --git a/src/libANGLE/renderer/vulkan/SurfaceVk.cpp b/src/libANGLE/renderer/vulkan/SurfaceVk.cpp index 24ecd9020c5..eacbd023ae9 100644 --- a/src/libANGLE/renderer/vulkan/SurfaceVk.cpp +++ b/src/libANGLE/renderer/vulkan/SurfaceVk.cpp @@ -392,7 +392,7 @@ angle::Result GetPresentModes(DisplayVk *displayVk, return angle::Result::Continue; } -angle::Result NewSemaphore(vk::Context *context, +angle::Result NewSemaphore(vk::ErrorContext *context, vk::Recycler *semaphoreRecycler, vk::Semaphore *semaphoreOut) { @@ -1554,7 +1554,7 @@ angle::Result WindowSurfaceVk::recreateSwapchain(ContextVk *contextVk, const gl: return result; } -angle::Result WindowSurfaceVk::resizeSwapchainImages(vk::Context *context, uint32_t imageCount) +angle::Result WindowSurfaceVk::resizeSwapchainImages(vk::ErrorContext *context, uint32_t imageCount) { if (static_cast(imageCount) != mSwapchainImages.size()) { @@ -1580,7 +1580,8 @@ angle::Result WindowSurfaceVk::resizeSwapchainImages(vk::Context *context, uint3 return angle::Result::Continue; } -angle::Result WindowSurfaceVk::createSwapChain(vk::Context *context, const gl::Extents &extents) +angle::Result WindowSurfaceVk::createSwapChain(vk::ErrorContext *context, + const gl::Extents &extents) { ANGLE_TRACE_EVENT0("gpu.angle", "WindowSurfaceVk::createSwapchain"); @@ -2044,7 +2045,7 @@ void WindowSurfaceVk::releaseSwapchainImages(ContextVk *contextVk) mSwapchainImages.clear(); } -angle::Result WindowSurfaceVk::finish(vk::Context *context) +angle::Result WindowSurfaceVk::finish(vk::ErrorContext *context) { vk::Renderer *renderer = context->getRenderer(); @@ -2183,7 +2184,7 @@ egl::Error WindowSurfaceVk::swap(const gl::Context *context) return angle::ToEGL(result, EGL_BAD_SURFACE); } -angle::Result WindowSurfaceVk::computePresentOutOfDate(vk::Context *context, +angle::Result WindowSurfaceVk::computePresentOutOfDate(vk::ErrorContext *context, VkResult result, bool *presentOutOfDate) { @@ -2517,7 +2518,7 @@ angle::Result WindowSurfaceVk::present(ContextVk *contextVk, return angle::Result::Continue; } -angle::Result WindowSurfaceVk::throttleCPU(vk::Context *context, +angle::Result WindowSurfaceVk::throttleCPU(vk::ErrorContext *context, const QueueSerial ¤tSubmitSerial) { // Wait on the oldest serial and replace it with the newest as the circular buffer moves @@ -2533,7 +2534,7 @@ angle::Result WindowSurfaceVk::throttleCPU(vk::Context *context, // necessarily hold the EGL lock. // // As this is an unlocked tail call, it must not access anything else in Renderer. The - // display passed to |finishQueueSerial| is a |vk::Context|, and the only possible + // display passed to |finishQueueSerial| is a |vk::ErrorContext|, and the only possible // modification to it is through |handleError()|. egl::Display::GetCurrentThreadUnlockedTailCall()->add( [context, swapSerial](void *resultOut) { @@ -2546,7 +2547,7 @@ angle::Result WindowSurfaceVk::throttleCPU(vk::Context *context, return angle::Result::Continue; } -angle::Result WindowSurfaceVk::cleanUpPresentHistory(vk::Context *context) +angle::Result WindowSurfaceVk::cleanUpPresentHistory(vk::ErrorContext *context) { const VkDevice device = context->getDevice(); @@ -2613,7 +2614,7 @@ angle::Result WindowSurfaceVk::cleanUpPresentHistory(vk::Context *context) return angle::Result::Continue; } -angle::Result WindowSurfaceVk::cleanUpOldSwapchains(vk::Context *context) +angle::Result WindowSurfaceVk::cleanUpOldSwapchains(vk::ErrorContext *context) { const VkDevice device = context->getDevice(); @@ -2809,7 +2810,7 @@ bool WindowSurfaceVk::skipAcquireNextSwapchainImageForSharedPresentMode() const // This method will either return VK_SUCCESS or VK_ERROR_*. Thus, it is appropriate to ASSERT that // the return value won't be VK_SUBOPTIMAL_KHR. -VkResult WindowSurfaceVk::acquireNextSwapchainImage(vk::Context *context) +VkResult WindowSurfaceVk::acquireNextSwapchainImage(vk::ErrorContext *context) { ASSERT(mAcquireOperation.state != impl::ImageAcquireState::Ready); @@ -2841,7 +2842,7 @@ VkResult WindowSurfaceVk::acquireNextSwapchainImage(vk::Context *context) return postProcessUnlockedAcquire(context); } -VkResult WindowSurfaceVk::postProcessUnlockedAcquire(vk::Context *context) +VkResult WindowSurfaceVk::postProcessUnlockedAcquire(vk::ErrorContext *context) { ASSERT(mAcquireOperation.state == impl::ImageAcquireState::NeedToProcessResult); diff --git a/src/libANGLE/renderer/vulkan/SurfaceVk.h b/src/libANGLE/renderer/vulkan/SurfaceVk.h index 68deed8a3ce..9bfce763758 100644 --- a/src/libANGLE/renderer/vulkan/SurfaceVk.h +++ b/src/libANGLE/renderer/vulkan/SurfaceVk.h @@ -396,8 +396,9 @@ class WindowSurfaceVk : public SurfaceVk VkBool32 mSupportsProtectedSwapchain; private: - virtual angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) = 0; - virtual angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) = 0; + virtual angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) = 0; + virtual angle::Result getCurrentWindowSize(vk::ErrorContext *context, + gl::Extents *extentsOut) = 0; vk::PresentMode getDesiredSwapchainPresentMode() const; void setDesiredSwapchainPresentMode(vk::PresentMode presentMode); @@ -405,12 +406,12 @@ class WindowSurfaceVk : public SurfaceVk angle::Result initializeImpl(DisplayVk *displayVk, bool *anyMatchesOut); angle::Result recreateSwapchain(ContextVk *contextVk, const gl::Extents &extents); - angle::Result createSwapChain(vk::Context *context, const gl::Extents &extents); + angle::Result createSwapChain(vk::ErrorContext *context, const gl::Extents &extents); angle::Result collectOldSwapchain(ContextVk *contextVk, VkSwapchainKHR swapchain); angle::Result queryAndAdjustSurfaceCaps(ContextVk *contextVk, VkSurfaceCapabilitiesKHR *surfaceCaps); angle::Result checkForOutOfDateSwapchain(ContextVk *contextVk, bool forceRecreate); - angle::Result resizeSwapchainImages(vk::Context *context, uint32_t imageCount); + angle::Result resizeSwapchainImages(vk::ErrorContext *context, uint32_t imageCount); void releaseSwapchainImages(ContextVk *contextVk); void destroySwapChainImages(DisplayVk *displayVk); angle::Result prepareForAcquireNextSwapchainImage(const gl::Context *context, @@ -418,15 +419,15 @@ class WindowSurfaceVk : public SurfaceVk // This method calls vkAcquireNextImageKHR() to acquire the next swapchain image. It is called // when the swapchain is initially created and when present() finds the swapchain out of date. // Otherwise, it is scheduled to be called later by deferAcquireNextImage(). - VkResult acquireNextSwapchainImage(vk::Context *context); + VkResult acquireNextSwapchainImage(vk::ErrorContext *context); // Process the result of vkAcquireNextImageKHR. - VkResult postProcessUnlockedAcquire(vk::Context *context); + VkResult postProcessUnlockedAcquire(vk::ErrorContext *context); // This method is called when a swapchain image is presented. It schedules // acquireNextSwapchainImage() to be called later. void deferAcquireNextImage(); bool skipAcquireNextSwapchainImageForSharedPresentMode() const; - angle::Result computePresentOutOfDate(vk::Context *context, + angle::Result computePresentOutOfDate(vk::ErrorContext *context, VkResult result, bool *presentOutOfDate); angle::Result prePresentSubmit(ContextVk *contextVk, const vk::Semaphore &presentSemaphore); @@ -436,17 +437,17 @@ class WindowSurfaceVk : public SurfaceVk const void *pNextChain, bool *presentOutOfDate); - angle::Result cleanUpPresentHistory(vk::Context *context); - angle::Result cleanUpOldSwapchains(vk::Context *context); + angle::Result cleanUpPresentHistory(vk::ErrorContext *context); + angle::Result cleanUpOldSwapchains(vk::ErrorContext *context); // Throttle the CPU such that application's logic and command buffer recording doesn't get more // than two frame ahead of the frame being rendered (and three frames ahead of the one being // presented). This is a failsafe, as the application should ensure command buffer recording is // not ahead of the frame being rendered by *one* frame. - angle::Result throttleCPU(vk::Context *context, const QueueSerial ¤tSubmitSerial); + angle::Result throttleCPU(vk::ErrorContext *context, const QueueSerial ¤tSubmitSerial); // Finish all GPU operations on the surface - angle::Result finish(vk::Context *context); + angle::Result finish(vk::ErrorContext *context); void updateOverlay(ContextVk *contextVk) const; bool overlayHasEnabledWidget(ContextVk *contextVk) const; diff --git a/src/libANGLE/renderer/vulkan/SyncVk.cpp b/src/libANGLE/renderer/vulkan/SyncVk.cpp index b6a14546c4b..0dee4398660 100644 --- a/src/libANGLE/renderer/vulkan/SyncVk.cpp +++ b/src/libANGLE/renderer/vulkan/SyncVk.cpp @@ -144,7 +144,7 @@ angle::Result SyncHelper::initialize(ContextVk *contextVk, SyncFenceScope scope) return contextVk->onSyncObjectInit(this, scope); } -angle::Result SyncHelper::prepareForClientWait(Context *context, +angle::Result SyncHelper::prepareForClientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, @@ -177,7 +177,7 @@ angle::Result SyncHelper::prepareForClientWait(Context *context, return angle::Result::Continue; } -angle::Result SyncHelper::clientWait(Context *context, +angle::Result SyncHelper::clientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, @@ -246,7 +246,7 @@ angle::Result SyncHelper::serverWait(ContextVk *contextVk) return angle::Result::Continue; } -angle::Result SyncHelper::getStatus(Context *context, ContextVk *contextVk, bool *signaledOut) +angle::Result SyncHelper::getStatus(ErrorContext *context, ContextVk *contextVk, bool *signaledOut) { // Submit commands if it was deferred on the context that issued the sync object ANGLE_TRY(submitSyncIfDeferred(contextVk, RenderPassClosureReason::SyncObjectClientWait)); @@ -440,7 +440,7 @@ angle::Result SyncHelperNativeFence::initializeWithFd(ContextVk *contextVk, int return angle::Result::Continue; } -angle::Result SyncHelperNativeFence::prepareForClientWait(Context *context, +angle::Result SyncHelperNativeFence::prepareForClientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, @@ -472,7 +472,7 @@ angle::Result SyncHelperNativeFence::prepareForClientWait(Context *context, return angle::Result::Continue; } -angle::Result SyncHelperNativeFence::clientWait(Context *context, +angle::Result SyncHelperNativeFence::clientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, @@ -538,7 +538,7 @@ angle::Result SyncHelperNativeFence::serverWait(ContextVk *contextVk) return angle::Result::Continue; } -angle::Result SyncHelperNativeFence::getStatus(Context *context, +angle::Result SyncHelperNativeFence::getStatus(ErrorContext *context, ContextVk *contextVk, bool *signaledOut) { @@ -551,7 +551,7 @@ angle::Result SyncHelperNativeFence::getStatus(Context *context, return angle::Result::Continue; } -angle::Result SyncHelperNativeFence::dupNativeFenceFD(Context *context, int *fdOut) const +angle::Result SyncHelperNativeFence::dupNativeFenceFD(ErrorContext *context, int *fdOut) const { if (mExternalFence->getFenceFd() == kInvalidFenceFd) { diff --git a/src/libANGLE/renderer/vulkan/SyncVk.h b/src/libANGLE/renderer/vulkan/SyncVk.h index c4912f87722..6305ade1a0d 100644 --- a/src/libANGLE/renderer/vulkan/SyncVk.h +++ b/src/libANGLE/renderer/vulkan/SyncVk.h @@ -61,15 +61,17 @@ class SyncHelperInterface : angle::NonCopyable virtual void releaseToRenderer(Renderer *renderer) = 0; - virtual angle::Result clientWait(Context *context, + virtual angle::Result clientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, MapVkResultToApiType mappingFunction, void *outResult) = 0; virtual angle::Result serverWait(ContextVk *contextVk) = 0; - virtual angle::Result getStatus(Context *context, ContextVk *contextVk, bool *signaledOut) = 0; - virtual angle::Result dupNativeFenceFD(Context *context, int *fdOut) const = 0; + virtual angle::Result getStatus(ErrorContext *context, + ContextVk *contextVk, + bool *signaledOut) = 0; + virtual angle::Result dupNativeFenceFD(ErrorContext *context, int *fdOut) const = 0; }; // Implementation of fence types - glFenceSync, and EGLSync(EGL_SYNC_FENCE_KHR). @@ -87,15 +89,17 @@ class SyncHelper final : public vk::Resource, public SyncHelperInterface void releaseToRenderer(Renderer *renderer) override; - angle::Result clientWait(Context *context, + angle::Result clientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, MapVkResultToApiType mappingFunction, void *resultOut) override; angle::Result serverWait(ContextVk *contextVk) override; - angle::Result getStatus(Context *context, ContextVk *contextVk, bool *signaledOut) override; - angle::Result dupNativeFenceFD(Context *context, int *fdOut) const override + angle::Result getStatus(ErrorContext *context, + ContextVk *contextVk, + bool *signaledOut) override; + angle::Result dupNativeFenceFD(ErrorContext *context, int *fdOut) const override { return angle::Result::Stop; } @@ -106,7 +110,7 @@ class SyncHelper final : public vk::Resource, public SyncHelperInterface private: angle::Result submitSyncIfDeferred(ContextVk *contextVk, RenderPassClosureReason reason); - angle::Result prepareForClientWait(Context *context, + angle::Result prepareForClientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, @@ -126,18 +130,20 @@ class SyncHelperNativeFence final : public SyncHelperInterface void releaseToRenderer(Renderer *renderer) override; - angle::Result clientWait(Context *context, + angle::Result clientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, MapVkResultToApiType mappingFunction, void *resultOut) override; angle::Result serverWait(ContextVk *contextVk) override; - angle::Result getStatus(Context *context, ContextVk *contextVk, bool *signaledOut) override; - angle::Result dupNativeFenceFD(Context *context, int *fdOut) const override; + angle::Result getStatus(ErrorContext *context, + ContextVk *contextVk, + bool *signaledOut) override; + angle::Result dupNativeFenceFD(ErrorContext *context, int *fdOut) const override; private: - angle::Result prepareForClientWait(Context *context, + angle::Result prepareForClientWait(ErrorContext *context, ContextVk *contextVk, bool flushCommands, uint64_t timeout, diff --git a/src/libANGLE/renderer/vulkan/TextureVk.cpp b/src/libANGLE/renderer/vulkan/TextureVk.cpp index 18ce349370e..d8f2d9ac15c 100644 --- a/src/libANGLE/renderer/vulkan/TextureVk.cpp +++ b/src/libANGLE/renderer/vulkan/TextureVk.cpp @@ -3787,7 +3787,7 @@ const vk::ImageView &TextureVk::getCopyImageView() const return imageViews.getLinearCopyImageView(); } -angle::Result TextureVk::getLevelLayerImageView(vk::Context *context, +angle::Result TextureVk::getLevelLayerImageView(vk::ErrorContext *context, gl::LevelIndex level, size_t layer, const vk::ImageView **imageViewOut) @@ -3802,7 +3802,7 @@ angle::Result TextureVk::getLevelLayerImageView(vk::Context *context, imageViewOut); } -angle::Result TextureVk::getStorageImageView(vk::Context *context, +angle::Result TextureVk::getStorageImageView(vk::ErrorContext *context, const gl::ImageUnit &binding, const vk::ImageView **imageViewOut) { @@ -3837,7 +3837,7 @@ angle::Result TextureVk::getStorageImageView(vk::Context *context, format->getActualImageFormatID(getRequiredImageAccess()), imageViewOut); } -vk::BufferHelper *TextureVk::getPossiblyEmulatedTextureBuffer(vk::Context *context) const +vk::BufferHelper *TextureVk::getPossiblyEmulatedTextureBuffer(vk::ErrorContext *context) const { vk::Renderer *renderer = context->getRenderer(); @@ -3851,7 +3851,7 @@ vk::BufferHelper *TextureVk::getPossiblyEmulatedTextureBuffer(vk::Context *conte return &bufferVk->getBuffer(); } -angle::Result TextureVk::getBufferView(vk::Context *context, +angle::Result TextureVk::getBufferView(vk::ErrorContext *context, const vk::Format *imageUniformFormat, const gl::SamplerBinding *samplerBinding, bool isImage, diff --git a/src/libANGLE/renderer/vulkan/TextureVk.h b/src/libANGLE/renderer/vulkan/TextureVk.h index c760820b8f9..e63070236e3 100644 --- a/src/libANGLE/renderer/vulkan/TextureVk.h +++ b/src/libANGLE/renderer/vulkan/TextureVk.h @@ -239,7 +239,7 @@ class TextureVk : public TextureImpl, public angle::ObserverInterface bool texelFetchStaticUse, bool samplerExternal2DY2YEXT) const; - angle::Result getBufferView(vk::Context *context, + angle::Result getBufferView(vk::ErrorContext *context, const vk::Format *imageUniformFormat, const gl::SamplerBinding *samplerBinding, bool isImage, @@ -247,7 +247,7 @@ class TextureVk : public TextureImpl, public angle::ObserverInterface // A special view used for texture copies that shouldn't perform swizzle. const vk::ImageView &getCopyImageView() const; - angle::Result getStorageImageView(vk::Context *context, + angle::Result getStorageImageView(vk::ErrorContext *context, const gl::ImageUnit &binding, const vk::ImageView **imageViewOut); @@ -324,7 +324,7 @@ class TextureVk : public TextureImpl, public angle::ObserverInterface { return mState.getBuffer(); } - vk::BufferHelper *getPossiblyEmulatedTextureBuffer(vk::Context *context) const; + vk::BufferHelper *getPossiblyEmulatedTextureBuffer(vk::ErrorContext *context) const; bool isSRGBOverrideEnabled() const { @@ -557,7 +557,7 @@ class TextureVk : public TextureImpl, public angle::ObserverInterface gl::LevelIndex level, GLuint layerIndex, GLuint layerCount); - angle::Result getLevelLayerImageView(vk::Context *context, + angle::Result getLevelLayerImageView(vk::ErrorContext *context, gl::LevelIndex levelGL, size_t layer, const vk::ImageView **imageViewOut); diff --git a/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp b/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp index e10ce3d9f04..d8238a0f728 100644 --- a/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp +++ b/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp @@ -47,7 +47,7 @@ void TransformFeedbackVk::onDestroy(const gl::Context *context) releaseCounterBuffers(contextVk); } -void TransformFeedbackVk::releaseCounterBuffers(vk::Context *context) +void TransformFeedbackVk::releaseCounterBuffers(vk::ErrorContext *context) { for (vk::BufferHelper &bufferHelper : mCounterBufferHelpers) { @@ -255,7 +255,7 @@ void TransformFeedbackVk::onSubjectStateChange(angle::SubjectIndex index, } void TransformFeedbackVk::updateTransformFeedbackDescriptorDesc( - const vk::Context *context, + const vk::ErrorContext *context, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, const vk::WriteDescriptorDescs &writeDescriptorDescs, diff --git a/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h b/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h index c05c94c38d2..a7af0f93d7f 100644 --- a/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h +++ b/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h @@ -88,7 +88,7 @@ class TransformFeedbackVk : public TransformFeedbackImpl, public angle::Observer } void updateTransformFeedbackDescriptorDesc( - const vk::Context *context, + const vk::ErrorContext *context, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, const vk::WriteDescriptorDescs &writeDescriptorDescs, @@ -109,7 +109,7 @@ class TransformFeedbackVk : public TransformFeedbackImpl, public angle::Observer private: void initializeXFBVariables(ContextVk *contextVk, uint32_t xfbBufferCount); - void releaseCounterBuffers(vk::Context *context); + void releaseCounterBuffers(vk::ErrorContext *context); // This member variable is set when glBindTransformFeedbackBuffers/glBeginTransformFeedback // is called and unset in dirty bit handler for transform feedback state change. If this diff --git a/src/libANGLE/renderer/vulkan/UtilsVk.cpp b/src/libANGLE/renderer/vulkan/UtilsVk.cpp index 8db9e450096..6392e494af7 100644 --- a/src/libANGLE/renderer/vulkan/UtilsVk.cpp +++ b/src/libANGLE/renderer/vulkan/UtilsVk.cpp @@ -1141,7 +1141,7 @@ angle::spirv::Blob MakeFragShader( } // namespace unresolve angle::Result GetUnresolveFrag( - vk::Context *context, + vk::ErrorContext *context, uint32_t colorAttachmentCount, gl::DrawBuffersArray &colorAttachmentTypes, bool unresolveDepth, diff --git a/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.cpp b/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.cpp index 0c230b6d783..359e0acb29a 100644 --- a/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.cpp +++ b/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.cpp @@ -17,7 +17,7 @@ namespace rx { namespace vk { -angle::Result VulkanSecondaryCommandBuffer::InitializeCommandPool(Context *context, +angle::Result VulkanSecondaryCommandBuffer::InitializeCommandPool(ErrorContext *context, SecondaryCommandPool *pool, uint32_t queueFamilyIndex, ProtectionType protectionType) @@ -55,7 +55,7 @@ angle::Result VulkanSecondaryCommandBuffer::InitializeRenderPassInheritanceInfo( return angle::Result::Continue; } -angle::Result VulkanSecondaryCommandBuffer::initialize(Context *context, +angle::Result VulkanSecondaryCommandBuffer::initialize(ErrorContext *context, SecondaryCommandPool *pool, bool isRenderPassCommandBuffer, SecondaryCommandMemoryAllocator *allocator) @@ -88,7 +88,7 @@ void VulkanSecondaryCommandBuffer::destroy() } angle::Result VulkanSecondaryCommandBuffer::begin( - Context *context, + ErrorContext *context, const VkCommandBufferInheritanceInfo &inheritanceInfo) { ASSERT(!mAnyCommand); @@ -109,7 +109,7 @@ angle::Result VulkanSecondaryCommandBuffer::begin( return angle::Result::Continue; } -angle::Result VulkanSecondaryCommandBuffer::end(Context *context) +angle::Result VulkanSecondaryCommandBuffer::end(ErrorContext *context) { ANGLE_VK_TRY(context, CommandBuffer::end()); return angle::Result::Continue; diff --git a/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.h b/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.h index 99aaaae96c6..0d2a16ed019 100644 --- a/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.h +++ b/src/libANGLE/renderer/vulkan/VulkanSecondaryCommandBuffer.h @@ -32,7 +32,7 @@ class ContextVk; namespace vk { -class Context; +class ErrorContext; class RenderPassDesc; class SecondaryCommandPool; @@ -41,7 +41,7 @@ class VulkanSecondaryCommandBuffer : public priv::CommandBuffer public: VulkanSecondaryCommandBuffer() = default; - static angle::Result InitializeCommandPool(Context *context, + static angle::Result InitializeCommandPool(ErrorContext *context, SecondaryCommandPool *pool, uint32_t queueFamilyIndex, ProtectionType protectionType); @@ -53,7 +53,7 @@ class VulkanSecondaryCommandBuffer : public priv::CommandBuffer VkCommandBufferInheritanceRenderingInfo *renderingInfoOut, gl::DrawBuffersArray *colorFormatStorageOut); - angle::Result initialize(Context *context, + angle::Result initialize(ErrorContext *context, SecondaryCommandPool *pool, bool isRenderPassCommandBuffer, SecondaryCommandMemoryAllocator *allocator); @@ -64,8 +64,9 @@ class VulkanSecondaryCommandBuffer : public priv::CommandBuffer void detachAllocator(SecondaryCommandMemoryAllocator *destination) {} - angle::Result begin(Context *context, const VkCommandBufferInheritanceInfo &inheritanceInfo); - angle::Result end(Context *context); + angle::Result begin(ErrorContext *context, + const VkCommandBufferInheritanceInfo &inheritanceInfo); + angle::Result end(ErrorContext *context); VkResult reset(); void executeCommands(PrimaryCommandBuffer *primary) { primary->executeCommands(1, this); } diff --git a/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.cpp b/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.cpp index a47126bffc2..61fe2023a9a 100644 --- a/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.cpp +++ b/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.cpp @@ -21,7 +21,8 @@ WindowSurfaceVkAndroid::WindowSurfaceVkAndroid(const egl::SurfaceState &surfaceS : WindowSurfaceVk(surfaceState, window) {} -angle::Result WindowSurfaceVkAndroid::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkAndroid::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { VkAndroidSurfaceCreateInfoKHR createInfo = {}; @@ -34,7 +35,7 @@ angle::Result WindowSurfaceVkAndroid::createSurfaceVk(vk::Context *context, gl:: return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkAndroid::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkAndroid::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { vk::Renderer *renderer = context->getRenderer(); diff --git a/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.h b/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.h index 9186c859b17..69157e2fde8 100644 --- a/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.h +++ b/src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.h @@ -21,8 +21,8 @@ class WindowSurfaceVkAndroid : public WindowSurfaceVk WindowSurfaceVkAndroid(const egl::SurfaceState &surfaceState, EGLNativeWindowType window); private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; }; } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/android/vk_android_utils.cpp b/src/libANGLE/renderer/vulkan/android/vk_android_utils.cpp index 1ac90c5a4df..3ca8576b109 100644 --- a/src/libANGLE/renderer/vulkan/android/vk_android_utils.cpp +++ b/src/libANGLE/renderer/vulkan/android/vk_android_utils.cpp @@ -34,7 +34,7 @@ DisplayVkAndroid *GetDisplayVkAndroid(Renderer *renderer) #endif } // anonymous namespace -angle::Result GetClientBufferMemoryRequirements(Context *context, +angle::Result GetClientBufferMemoryRequirements(ErrorContext *context, const AHardwareBuffer *hardwareBuffer, VkMemoryRequirements &memRequirements) { @@ -72,7 +72,7 @@ angle::Result GetClientBufferMemoryRequirements(Context *context, #endif } -angle::Result InitAndroidExternalMemory(Context *context, +angle::Result InitAndroidExternalMemory(ErrorContext *context, EGLClientBuffer clientBuffer, VkMemoryPropertyFlags memoryProperties, Buffer *buffer, diff --git a/src/libANGLE/renderer/vulkan/android/vk_android_utils.h b/src/libANGLE/renderer/vulkan/android/vk_android_utils.h index a7b44438ce8..583f3c8a915 100644 --- a/src/libANGLE/renderer/vulkan/android/vk_android_utils.h +++ b/src/libANGLE/renderer/vulkan/android/vk_android_utils.h @@ -19,12 +19,12 @@ class DeviceMemory; namespace rx { -class Context; +class ErrorContext; namespace vk { class Renderer; -angle::Result InitAndroidExternalMemory(Context *context, +angle::Result InitAndroidExternalMemory(ErrorContext *context, EGLClientBuffer clientBuffer, VkMemoryPropertyFlags memoryProperties, Buffer *buffer, diff --git a/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.cpp b/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.cpp index c9e23b0162d..534ec10a411 100644 --- a/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.cpp +++ b/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.cpp @@ -34,7 +34,8 @@ bool WindowSurfaceVkFuchsia::isValidNativeWindow(EGLNativeWindowType window) return fuchsia_egl_window_get_width(egl_window) >= 0; } -angle::Result WindowSurfaceVkFuchsia::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkFuchsia::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { #if !defined(ANGLE_SHARED_LIBVULKAN) InitImagePipeSurfaceFUCHSIAFunctions(context->getRenderer()->getInstance()); @@ -50,7 +51,7 @@ angle::Result WindowSurfaceVkFuchsia::createSurfaceVk(vk::Context *context, gl:: return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkFuchsia::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkFuchsia::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { fuchsia_egl_window *egl_window = reinterpret_cast(mNativeWindowType); diff --git a/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.h b/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.h index 0c461c2ee5a..b6aaac77d10 100644 --- a/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.h +++ b/src/libANGLE/renderer/vulkan/fuchsia/WindowSurfaceVkFuchsia.h @@ -24,8 +24,8 @@ class WindowSurfaceVkFuchsia : public WindowSurfaceVk static bool isValidNativeWindow(EGLNativeWindowType window); private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; }; } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py b/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py index 9a8f8de0082..eb78ed066d4 100644 --- a/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py +++ b/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py @@ -59,7 +59,7 @@ {shader_tables_cpp} -angle::Result GetShader(Context *context, +angle::Result GetShader(ErrorContext *context, ShaderModulePtr shaders[], const CompressedShaderBlob *compressedShaderBlobs, size_t shadersCount, @@ -650,7 +650,7 @@ def get_get_function_h(shader_and_variation): function_name = get_var_name(os.path.basename(shader_file), 'get') definition = 'angle::Result %s' % function_name - definition += '(Context *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut);' + definition += '(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut);' return definition @@ -665,7 +665,7 @@ def get_get_function_cpp(shader_and_variation): constant_table_name = get_variation_table_name(shader_file) definition = 'angle::Result ShaderLibrary::%s' % function_name - definition += '(Context *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut)\n{\n' + definition += '(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut)\n{\n' definition += 'return GetShader(context, %s, %s, ArraySize(%s), shaderFlags, shaderOut);\n}\n' % ( member_table_name, constant_table_name, constant_table_name) diff --git a/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.cpp b/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.cpp index 6c1bf9773d9..6e1cb8a9310 100644 --- a/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.cpp +++ b/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.cpp @@ -27,7 +27,8 @@ WindowSurfaceVkGGP::WindowSurfaceVkGGP(const egl::SurfaceState &surfaceState, : WindowSurfaceVk(surfaceState, window) {} -angle::Result WindowSurfaceVkGGP::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkGGP::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { vk::Renderer *renderer = context->getRenderer(); @@ -45,7 +46,7 @@ angle::Result WindowSurfaceVkGGP::createSurfaceVk(vk::Context *context, gl::Exte return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkGGP::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkGGP::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { vk::Renderer *renderer = context->getRenderer(); diff --git a/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h b/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h index 6581d6febed..5bfe8651917 100644 --- a/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h +++ b/src/libANGLE/renderer/vulkan/ggp/WindowSurfaceVkGGP.h @@ -23,8 +23,8 @@ class WindowSurfaceVkGGP : public WindowSurfaceVk private: egl::Error swapWithFrameToken(const gl::Context *context, EGLFrameTokenANGLE frameToken) override; - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; }; } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.cpp b/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.cpp index f7d8a57c12f..16e1ae63cec 100644 --- a/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.cpp +++ b/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.cpp @@ -20,7 +20,8 @@ WindowSurfaceVkSimple::WindowSurfaceVkSimple(const egl::SurfaceState &surfaceSta WindowSurfaceVkSimple::~WindowSurfaceVkSimple() {} -angle::Result WindowSurfaceVkSimple::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkSimple::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { vk::Renderer *renderer = context->getRenderer(); ASSERT(renderer != nullptr); @@ -65,7 +66,7 @@ angle::Result WindowSurfaceVkSimple::createSurfaceVk(vk::Context *context, gl::E return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkSimple::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkSimple::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { vk::Renderer *renderer = context->getRenderer(); diff --git a/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.h b/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.h index b43a962c4da..2a03b1ce5e9 100644 --- a/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.h +++ b/src/libANGLE/renderer/vulkan/linux/display/WindowSurfaceVkSimple.h @@ -22,8 +22,8 @@ class WindowSurfaceVkSimple final : public WindowSurfaceVk ~WindowSurfaceVkSimple() final; private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; }; } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.cpp b/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.cpp index 4879b1e2264..7c9a155106f 100644 --- a/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.cpp +++ b/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.cpp @@ -20,7 +20,7 @@ WindowSurfaceVkHeadless::WindowSurfaceVkHeadless(const egl::SurfaceState &surfac WindowSurfaceVkHeadless::~WindowSurfaceVkHeadless() {} -angle::Result WindowSurfaceVkHeadless::createSurfaceVk(vk::Context *context, +angle::Result WindowSurfaceVkHeadless::createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) { vk::Renderer *renderer = context->getRenderer(); @@ -35,7 +35,7 @@ angle::Result WindowSurfaceVkHeadless::createSurfaceVk(vk::Context *context, return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkHeadless::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkHeadless::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { const VkPhysicalDevice &physicalDevice = context->getRenderer()->getPhysicalDevice(); diff --git a/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.h b/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.h index e78b1d37f1a..081d3ec7e78 100644 --- a/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.h +++ b/src/libANGLE/renderer/vulkan/linux/headless/WindowSurfaceVkHeadless.h @@ -22,8 +22,8 @@ class WindowSurfaceVkHeadless final : public WindowSurfaceVk ~WindowSurfaceVkHeadless() final; private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; }; } // namespace rx diff --git a/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.cpp b/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.cpp index 9ef7fbcdc9f..5e26456811b 100644 --- a/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.cpp +++ b/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.cpp @@ -47,7 +47,8 @@ WindowSurfaceVkWayland::WindowSurfaceVkWayland(const egl::SurfaceState &surfaceS mExtents = gl::Extents(eglWindow->width, eglWindow->height, 1); } -angle::Result WindowSurfaceVkWayland::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkWayland::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { ANGLE_VK_CHECK(context, vkGetPhysicalDeviceWaylandPresentationSupportKHR( @@ -69,7 +70,7 @@ angle::Result WindowSurfaceVkWayland::createSurfaceVk(vk::Context *context, gl:: return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkWayland::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkWayland::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { *extentsOut = mExtents; diff --git a/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.h b/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.h index 5d8b6c74985..cd10dd959ef 100644 --- a/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.h +++ b/src/libANGLE/renderer/vulkan/linux/wayland/WindowSurfaceVkWayland.h @@ -42,8 +42,8 @@ class WindowSurfaceVkWayland : public WindowSurfaceVk FramebufferAttachmentRenderTarget **rtOut) override; private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; wl_display *mWaylandDisplay; gl::Extents mExtents; diff --git a/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.cpp b/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.cpp index 930ef018076..303ba1273b6 100644 --- a/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.cpp +++ b/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.cpp @@ -20,7 +20,8 @@ WindowSurfaceVkXcb::WindowSurfaceVkXcb(const egl::SurfaceState &surfaceState, : WindowSurfaceVk(surfaceState, window), mXcbConnection(conn) {} -angle::Result WindowSurfaceVkXcb::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkXcb::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { VkXcbSurfaceCreateInfoKHR createInfo = {}; @@ -34,7 +35,7 @@ angle::Result WindowSurfaceVkXcb::createSurfaceVk(vk::Context *context, gl::Exte return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkXcb::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkXcb::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { xcb_get_geometry_cookie_t cookie = diff --git a/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.h b/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.h index d056629deee..725d21e9268 100644 --- a/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.h +++ b/src/libANGLE/renderer/vulkan/linux/xcb/WindowSurfaceVkXcb.h @@ -25,8 +25,8 @@ class WindowSurfaceVkXcb : public WindowSurfaceVk xcb_connection_t *conn); private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; xcb_connection_t *mXcbConnection; }; diff --git a/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.h b/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.h index ba4bb18828a..bb3e4d592f0 100644 --- a/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.h +++ b/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.h @@ -24,8 +24,8 @@ class WindowSurfaceVkMac : public WindowSurfaceVk ~WindowSurfaceVkMac() override; private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; CAMetalLayer *mMetalLayer; id mMetalDevice; diff --git a/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.mm b/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.mm index a829a2df660..07e87533569 100644 --- a/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.mm +++ b/src/libANGLE/renderer/vulkan/mac/WindowSurfaceVkMac.mm @@ -29,7 +29,8 @@ [mMetalLayer release]; } -angle::Result WindowSurfaceVkMac::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkMac::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) API_AVAILABLE(macosx(10.11)) { mMetalDevice = MTLCreateSystemDefaultDevice(); @@ -59,7 +60,7 @@ return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkMac::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkMac::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) API_AVAILABLE(macosx(10.11)) { diff --git a/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp b/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp index 6dd90280b79..627cb295986 100644 --- a/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp +++ b/src/libANGLE/renderer/vulkan/vk_cache_utils.cpp @@ -540,7 +540,7 @@ void DeriveRenderingInfo(Renderer *renderer, } } -void AttachPipelineRenderingInfo(Context *context, +void AttachPipelineRenderingInfo(ErrorContext *context, const RenderPassDesc &desc, const DynamicRenderingInfo &renderingInfo, GraphicsPipelineSubset subset, @@ -677,7 +677,7 @@ void UnpackColorResolveAttachmentDesc(Renderer *renderer, desc->finalLayout = ConvertImageLayoutToVkImageLayout(renderer, finalLayout); } -void UnpackDepthStencilResolveAttachmentDesc(vk::Context *context, +void UnpackDepthStencilResolveAttachmentDesc(vk::ErrorContext *context, VkAttachmentDescription2 *desc, angle::FormatID formatID, const AttachmentInfo &depthInfo, @@ -1119,7 +1119,7 @@ void InitializeUnresolveSubpassDependencies(const SubpassVector *subpassDependencies) @@ -1166,7 +1166,7 @@ void InitializeDefaultSubpassSelfDependencies( } } -void InitializeMSRTSS(Context *context, +void InitializeMSRTSS(ErrorContext *context, uint8_t renderToTextureSamples, VkSubpassDescription2 *subpass, VkSubpassDescriptionDepthStencilResolve *msrtssResolve, @@ -1192,7 +1192,7 @@ void InitializeMSRTSS(Context *context, AppendToPNextChain(subpass, msrtss); } -void SetRenderPassViewMask(Context *context, +void SetRenderPassViewMask(ErrorContext *context, const uint32_t *viewMask, VkRenderPassCreateInfo2 *createInfo, SubpassVector *subpassDesc) @@ -1292,7 +1292,7 @@ void ToRenderPassMultiviewCreateInfo(const VkRenderPassCreateInfo2 &createInfo, AddToPNextChain(createInfo1, multiviewInfo); } -angle::Result CreateRenderPass1(Context *context, +angle::Result CreateRenderPass1(ErrorContext *context, const VkRenderPassCreateInfo2 &createInfo, uint8_t viewCount, RenderPass *renderPass) @@ -2440,7 +2440,7 @@ PipelineState GetPipelineState(size_t stateIndex, bool *isRangedOut, size_t *sub out << "\\n"; } -[[maybe_unused]] void OutputAllPipelineState(Context *context, +[[maybe_unused]] void OutputAllPipelineState(ErrorContext *context, std::ostream &out, const UnpackedPipelineState &pipeline, GraphicsPipelineSubset subset, @@ -2556,7 +2556,7 @@ PipelineState GetPipelineState(size_t stateIndex, bool *isRangedOut, size_t *sub template void DumpPipelineCacheGraph( - Context *context, + ErrorContext *context, const std::unordered_mapgetRenderer()->isPipelineCacheGraphDumpEnabled(); } @@ -3008,7 +3008,7 @@ void RenderPassDesc::setLegacyDither(bool enabled) } void RenderPassDesc::beginRenderPass( - Context *context, + ErrorContext *context, PrimaryCommandBuffer *primary, const RenderPass &renderPass, VkFramebuffer framebuffer, @@ -3033,7 +3033,7 @@ void RenderPassDesc::beginRenderPass( } void RenderPassDesc::beginRendering( - Context *context, + ErrorContext *context, PrimaryCommandBuffer *primary, const gl::Rectangle &renderArea, VkSubpassContents subpassContents, @@ -3095,7 +3095,7 @@ void RenderPassDesc::populateRenderingInheritanceInfo( } void RenderPassDesc::updatePerfCounters( - Context *context, + ErrorContext *context, const FramebufferAttachmentsVector &attachmentViews, const AttachmentOpsArray &ops, angle::VulkanPerfCounters *countersOut) @@ -3320,7 +3320,7 @@ bool GraphicsPipelineDesc::keyEqual(const GraphicsPipelineDesc &other, // effect, or the context is robust. For VK_EXT_graphics_pipeline_library, such state that affects // multiple subsets of the pipeline is duplicated in each subset (for example, there are two // copies of isRobustContext, one for vertex input and one for shader stages). -void GraphicsPipelineDesc::initDefaults(const Context *context, +void GraphicsPipelineDesc::initDefaults(const ErrorContext *context, GraphicsPipelineSubset subset, PipelineRobustness pipelineRobustness, PipelineProtectedAccess pipelineProtectedAccess) @@ -3428,7 +3428,7 @@ void GraphicsPipelineDesc::initDefaults(const Context *context, pipelineProtectedAccess == PipelineProtectedAccess::Protected; } -VkResult GraphicsPipelineDesc::initializePipeline(Context *context, +VkResult GraphicsPipelineDesc::initializePipeline(ErrorContext *context, PipelineCacheAccess *pipelineCache, GraphicsPipelineSubset subset, const RenderPass &compatibleRenderPass, @@ -3673,7 +3673,7 @@ angle::FormatID patchVertexAttribComponentType(angle::FormatID format, } VkFormat GraphicsPipelineDesc::getPipelineVertexInputStateFormat( - Context *context, + ErrorContext *context, angle::FormatID formatID, bool compressed, const gl::ComponentType programAttribType, @@ -3723,7 +3723,7 @@ VkFormat GraphicsPipelineDesc::getPipelineVertexInputStateFormat( } void GraphicsPipelineDesc::initializePipelineVertexInputState( - Context *context, + ErrorContext *context, GraphicsPipelineVertexInputVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const { @@ -3818,7 +3818,7 @@ void GraphicsPipelineDesc::initializePipelineVertexInputState( } void GraphicsPipelineDesc::initializePipelineShadersState( - Context *context, + ErrorContext *context, const ShaderModuleMap &shaders, const SpecializationConstants &specConsts, GraphicsPipelineShadersVulkanStructs *stateOut, @@ -4055,7 +4055,7 @@ void GraphicsPipelineDesc::initializePipelineShadersState( } void GraphicsPipelineDesc::initializePipelineSharedNonVertexInputState( - Context *context, + ErrorContext *context, GraphicsPipelineSharedNonVertexInputVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const { @@ -4081,7 +4081,7 @@ void GraphicsPipelineDesc::initializePipelineSharedNonVertexInputState( } void GraphicsPipelineDesc::initializePipelineFragmentOutputState( - Context *context, + ErrorContext *context, GraphicsPipelineFragmentOutputVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const { @@ -5054,7 +5054,7 @@ CreateMonolithicPipelineTask::CreateMonolithicPipelineTask( const ShaderModuleMap &shaders, const SpecializationConstants &specConsts, const GraphicsPipelineDesc &desc) - : Context(renderer), + : ErrorContext(renderer), mPipelineCache(pipelineCache), mCompatibleRenderPass(nullptr), mPipelineLayout(pipelineLayout), @@ -5132,7 +5132,7 @@ void PipelineHelper::destroy(VkDevice device) reset(); } -void PipelineHelper::release(Context *context) +void PipelineHelper::release(ErrorContext *context) { Renderer *renderer = context->getRenderer(); @@ -5243,7 +5243,8 @@ FramebufferHelper &FramebufferHelper::operator=(FramebufferHelper &&other) return *this; } -angle::Result FramebufferHelper::init(Context *context, const VkFramebufferCreateInfo &createInfo) +angle::Result FramebufferHelper::init(ErrorContext *context, + const VkFramebufferCreateInfo &createInfo) { ANGLE_VK_TRY(context, mFramebuffer.init(context->getDevice(), createInfo)); return angle::Result::Continue; @@ -5520,7 +5521,7 @@ void YcbcrConversionDesc::updateConversionModel(VkSamplerYcbcrModelConversion co SetBitField(mConversionModel, conversionModel); } -angle::Result YcbcrConversionDesc::init(Context *context, +angle::Result YcbcrConversionDesc::init(ErrorContext *context, SamplerYcbcrConversion *conversionOut) const { // Create the VkSamplerYcbcrConversion @@ -5567,7 +5568,7 @@ SamplerDesc::SamplerDesc(const SamplerDesc &other) = default; SamplerDesc &SamplerDesc::operator=(const SamplerDesc &rhs) = default; -SamplerDesc::SamplerDesc(Context *context, +SamplerDesc::SamplerDesc(ErrorContext *context, const gl::SamplerState &samplerState, bool stencilMode, const YcbcrConversionDesc *ycbcrConversionDesc, @@ -5810,7 +5811,7 @@ SamplerHelper &SamplerHelper::operator=(SamplerHelper &&rhs) return *this; } -angle::Result SamplerHelper::init(Context *context, const VkSamplerCreateInfo &createInfo) +angle::Result SamplerHelper::init(ErrorContext *context, const VkSamplerCreateInfo &createInfo) { mSamplerSerial = context->getRenderer()->getResourceSerialFactory().generateSamplerSerial(); ANGLE_VK_TRY(context, mSampler.init(context->getDevice(), createInfo)); @@ -6273,7 +6274,7 @@ void DescriptorSetDescBuilder::updateUniformBuffer(uint32_t bindingIndex, } void DescriptorSetDescBuilder::updateTransformFeedbackBuffer( - const Context *context, + const ErrorContext *context, const ShaderInterfaceVariableInfoMap &variableInfoMap, const WriteDescriptorDescs &writeDescriptorDescs, uint32_t xfbBufferIndex, @@ -6301,7 +6302,7 @@ void DescriptorSetDescBuilder::updateTransformFeedbackBuffer( } void DescriptorSetDescBuilder::updateUniformsAndXfb( - Context *context, + ErrorContext *context, const gl::ProgramExecutable &executable, const WriteDescriptorDescs &writeDescriptorDescs, const BufferHelper *currentUniformBuffer, @@ -6339,7 +6340,7 @@ void DescriptorSetDescBuilder::updateUniformsAndXfb( } void DescriptorSetDescBuilder::updatePreCacheActiveTextures( - Context *context, + ErrorContext *context, const gl::ProgramExecutable &executable, const gl::ActiveTextureArray &textures, const gl::SamplerBindingVector &samplers) @@ -6439,7 +6440,7 @@ void DescriptorSetDescBuilder::setEmptyBuffer(uint32_t infoDescIndex, template void DescriptorSetDescBuilder::updateOneShaderBuffer( - Context *context, + ErrorContext *context, CommandBufferT *commandBufferHelper, const ShaderInterfaceVariableInfoMap &variableInfoMap, const gl::BufferVector &buffers, @@ -6547,7 +6548,7 @@ void DescriptorSetDescBuilder::updateOneShaderBuffer( template void DescriptorSetDescBuilder::updateShaderBuffers( - Context *context, + ErrorContext *context, CommandBufferT *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -6576,7 +6577,7 @@ void DescriptorSetDescBuilder::updateShaderBuffers( template void DescriptorSetDescBuilder::updateAtomicCounters( - Context *context, + ErrorContext *context, CommandBufferT *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -6649,7 +6650,7 @@ void DescriptorSetDescBuilder::updateAtomicCounters( // Explicit instantiation template void DescriptorSetDescBuilder::updateOneShaderBuffer( - Context *context, + ErrorContext *context, RenderPassCommandBufferHelper *commandBufferHelper, const ShaderInterfaceVariableInfoMap &variableInfoMap, const gl::BufferVector &buffers, @@ -6662,7 +6663,7 @@ template void DescriptorSetDescBuilder::updateOneShaderBuffer( - Context *context, + ErrorContext *context, OutsideRenderPassCommandBufferHelper *commandBufferHelper, const ShaderInterfaceVariableInfoMap &variableInfoMap, const gl::BufferVector &buffers, @@ -6675,7 +6676,7 @@ template void DescriptorSetDescBuilder::updateOneShaderBuffer( - Context *context, + ErrorContext *context, OutsideRenderPassCommandBufferHelper *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -6688,7 +6689,7 @@ template void DescriptorSetDescBuilder::updateShaderBuffers( - Context *context, + ErrorContext *context, RenderPassCommandBufferHelper *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -6701,7 +6702,7 @@ template void DescriptorSetDescBuilder::updateShaderBuffers( - Context *context, + ErrorContext *context, OutsideRenderPassCommandBufferHelper *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -6712,7 +6713,7 @@ template void DescriptorSetDescBuilder::updateAtomicCounters( - Context *context, + ErrorContext *context, RenderPassCommandBufferHelper *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -6723,7 +6724,7 @@ template void DescriptorSetDescBuilder::updateAtomicCounters &activeImages, @@ -6824,7 +6825,7 @@ angle::Result DescriptorSetDescBuilder::updateImages( } angle::Result DescriptorSetDescBuilder::updateInputAttachments( - vk::Context *context, + vk::ErrorContext *context, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, FramebufferVk *framebufferVk, @@ -6916,7 +6917,7 @@ angle::Result DescriptorSetDescBuilder::updateInputAttachments( } void DescriptorSetDescBuilder::updateInputAttachment( - Context *context, + ErrorContext *context, uint32_t binding, ImageLayout layout, const vk::ImageView *imageView, @@ -7114,7 +7115,7 @@ std::unique_lock PipelineCacheAccess::getLock() return std::unique_lock(*mMutex); } -VkResult PipelineCacheAccess::createGraphicsPipeline(vk::Context *context, +VkResult PipelineCacheAccess::createGraphicsPipeline(vk::ErrorContext *context, const VkGraphicsPipelineCreateInfo &createInfo, vk::Pipeline *pipelineOut) { @@ -7123,7 +7124,7 @@ VkResult PipelineCacheAccess::createGraphicsPipeline(vk::Context *context, return pipelineOut->initGraphics(context->getDevice(), createInfo, *mPipelineCache); } -VkResult PipelineCacheAccess::createComputePipeline(vk::Context *context, +VkResult PipelineCacheAccess::createComputePipeline(vk::ErrorContext *context, const VkComputePipelineCreateInfo &createInfo, vk::Pipeline *pipelineOut) { @@ -7132,7 +7133,9 @@ VkResult PipelineCacheAccess::createComputePipeline(vk::Context *context, return pipelineOut->initCompute(context->getDevice(), createInfo, *mPipelineCache); } -VkResult PipelineCacheAccess::getCacheData(vk::Context *context, size_t *cacheSize, void *cacheData) +VkResult PipelineCacheAccess::getCacheData(vk::ErrorContext *context, + size_t *cacheSize, + void *cacheData) { std::unique_lock lock = getLock(); return mPipelineCache->getCacheData(context->getDevice(), cacheSize, cacheData); @@ -7445,7 +7448,7 @@ angle::Result RenderPassCache::getRenderPassWithOpsImpl(ContextVk *contextVk, } // static -angle::Result RenderPassCache::MakeRenderPass(vk::Context *context, +angle::Result RenderPassCache::MakeRenderPass(vk::ErrorContext *context, const vk::RenderPassDesc &desc, const vk::AttachmentOpsArray &ops, vk::RenderPass *renderPass, @@ -7912,7 +7915,7 @@ angle::Result RenderPassCache::MakeRenderPass(vk::Context *context, // GraphicsPipelineCache implementation. template -void GraphicsPipelineCache::destroy(vk::Context *context) +void GraphicsPipelineCache::destroy(vk::ErrorContext *context) { if (vk::ShouldDumpPipelineCacheGraph(context) && !mPayload.empty()) { @@ -7933,7 +7936,7 @@ void GraphicsPipelineCache::destroy(vk::Context *context) } template -void GraphicsPipelineCache::release(vk::Context *context) +void GraphicsPipelineCache::release(vk::ErrorContext *context) { if (vk::ShouldDumpPipelineCacheGraph(context) && !mPayload.empty()) { @@ -7951,7 +7954,7 @@ void GraphicsPipelineCache::release(vk::Context *context) template angle::Result GraphicsPipelineCache::createPipeline( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::RenderPass &compatibleRenderPass, const vk::PipelineLayout &pipelineLayout, @@ -7993,7 +7996,7 @@ angle::Result GraphicsPipelineCache::createPipeline( template angle::Result GraphicsPipelineCache::linkLibraries( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::GraphicsPipelineDesc &desc, const vk::PipelineLayout &pipelineLayout, @@ -8083,11 +8086,11 @@ void GraphicsPipelineCache::populate(const vk::GraphicsPipelineDesc &desc, // Instantiate the pipeline cache functions template void GraphicsPipelineCache::destroy( - vk::Context *context); + vk::ErrorContext *context); template void GraphicsPipelineCache::release( - vk::Context *context); + vk::ErrorContext *context); template angle::Result GraphicsPipelineCache::createPipeline( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::RenderPass &compatibleRenderPass, const vk::PipelineLayout &pipelineLayout, @@ -8098,7 +8101,7 @@ template angle::Result GraphicsPipelineCache:: const vk::GraphicsPipelineDesc **descPtrOut, vk::PipelineHelper **pipelineOut); template angle::Result GraphicsPipelineCache::linkLibraries( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::GraphicsPipelineDesc &desc, const vk::PipelineLayout &pipelineLayout, @@ -8113,11 +8116,11 @@ template void GraphicsPipelineCache::populate( vk::PipelineHelper **pipelineHelperOut); template void GraphicsPipelineCache::destroy( - vk::Context *context); + vk::ErrorContext *context); template void GraphicsPipelineCache::release( - vk::Context *context); + vk::ErrorContext *context); template angle::Result GraphicsPipelineCache::createPipeline( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::RenderPass &compatibleRenderPass, const vk::PipelineLayout &pipelineLayout, @@ -8132,10 +8135,12 @@ template void GraphicsPipelineCache::popula vk::Pipeline &&pipeline, vk::PipelineHelper **pipelineHelperOut); -template void GraphicsPipelineCache::destroy(vk::Context *context); -template void GraphicsPipelineCache::release(vk::Context *context); +template void GraphicsPipelineCache::destroy( + vk::ErrorContext *context); +template void GraphicsPipelineCache::release( + vk::ErrorContext *context); template angle::Result GraphicsPipelineCache::createPipeline( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::RenderPass &compatibleRenderPass, const vk::PipelineLayout &pipelineLayout, @@ -8151,12 +8156,12 @@ template void GraphicsPipelineCache::populate( vk::PipelineHelper **pipelineHelperOut); template void GraphicsPipelineCache::destroy( - vk::Context *context); + vk::ErrorContext *context); template void GraphicsPipelineCache::release( - vk::Context *context); + vk::ErrorContext *context); template angle::Result GraphicsPipelineCache::createPipeline( - vk::Context *context, + vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCache, const vk::RenderPass &compatibleRenderPass, const vk::PipelineLayout &pipelineLayout, @@ -8187,7 +8192,7 @@ void DescriptorSetLayoutCache::destroy(vk::Renderer *renderer) } angle::Result DescriptorSetLayoutCache::getDescriptorSetLayout( - vk::Context *context, + vk::ErrorContext *context, const vk::DescriptorSetLayoutDesc &desc, vk::DescriptorSetLayoutPtr *descriptorSetLayoutOut) { @@ -8246,7 +8251,7 @@ void PipelineLayoutCache::destroy(vk::Renderer *renderer) } angle::Result PipelineLayoutCache::getPipelineLayout( - vk::Context *context, + vk::ErrorContext *context, const vk::PipelineLayoutDesc &desc, const vk::DescriptorSetLayoutPointerArray &descriptorSetLayouts, vk::PipelineLayoutPtr *pipelineLayoutOut) @@ -8337,7 +8342,7 @@ void SamplerYcbcrConversionCache::destroy(vk::Renderer *renderer) } angle::Result SamplerYcbcrConversionCache::getSamplerYcbcrConversion( - vk::Context *context, + vk::ErrorContext *context, const vk::YcbcrConversionDesc &ycbcrConversionDesc, VkSamplerYcbcrConversion *vkSamplerYcbcrConversionOut) { diff --git a/src/libANGLE/renderer/vulkan/vk_cache_utils.h b/src/libANGLE/renderer/vulkan/vk_cache_utils.h index 4f51870057e..be4fa079b62 100644 --- a/src/libANGLE/renderer/vulkan/vk_cache_utils.h +++ b/src/libANGLE/renderer/vulkan/vk_cache_utils.h @@ -297,7 +297,7 @@ class alignas(4) RenderPassDesc final } // Start a render pass with a render pass object. - void beginRenderPass(Context *context, + void beginRenderPass(ErrorContext *context, PrimaryCommandBuffer *primary, const RenderPass &renderPass, VkFramebuffer framebuffer, @@ -307,7 +307,7 @@ class alignas(4) RenderPassDesc final const VkRenderPassAttachmentBeginInfo *attachmentBeginInfo) const; // Start a render pass with dynamic rendering. - void beginRendering(Context *context, + void beginRendering(ErrorContext *context, PrimaryCommandBuffer *primary, const gl::Rectangle &renderArea, VkSubpassContents subpassContents, @@ -324,7 +324,7 @@ class alignas(4) RenderPassDesc final // Calculate perf counters for a dynamic rendering render pass instance. For render pass // objects, the perf counters are updated when creating the render pass, where access to // ContextVk is available. - void updatePerfCounters(Context *context, + void updatePerfCounters(ErrorContext *context, const FramebufferAttachmentsVector &attachmentViews, const AttachmentOpsArray &ops, angle::VulkanPerfCounters *countersOut); @@ -829,7 +829,7 @@ class GraphicsPipelineDesc final size_t hash(GraphicsPipelineSubset subset) const; bool keyEqual(const GraphicsPipelineDesc &other, GraphicsPipelineSubset subset) const; - void initDefaults(const Context *context, + void initDefaults(const ErrorContext *context, GraphicsPipelineSubset subset, PipelineRobustness contextRobustness, PipelineProtectedAccess contextProtectedAccess); @@ -841,7 +841,7 @@ class GraphicsPipelineDesc final return reinterpret_cast(this); } - VkResult initializePipeline(Context *context, + VkResult initializePipeline(ErrorContext *context, PipelineCacheAccess *pipelineCache, GraphicsPipelineSubset subset, const RenderPass &compatibleRenderPass, @@ -1024,7 +1024,7 @@ class GraphicsPipelineDesc final mShaders.shaders.bits.nonZeroStencilWriteMaskWorkaround = false; } - static VkFormat getPipelineVertexInputStateFormat(Context *context, + static VkFormat getPipelineVertexInputStateFormat(ErrorContext *context, angle::FormatID formatID, bool compressed, const gl::ComponentType programAttribType, @@ -1048,24 +1048,24 @@ class GraphicsPipelineDesc final const void *getPipelineSubsetMemory(GraphicsPipelineSubset subset, size_t *sizeOut) const; void initializePipelineVertexInputState( - Context *context, + ErrorContext *context, GraphicsPipelineVertexInputVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const; void initializePipelineShadersState( - Context *context, + ErrorContext *context, const ShaderModuleMap &shaders, const SpecializationConstants &specConsts, GraphicsPipelineShadersVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const; void initializePipelineSharedNonVertexInputState( - Context *context, + ErrorContext *context, GraphicsPipelineSharedNonVertexInputVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const; void initializePipelineFragmentOutputState( - Context *context, + ErrorContext *context, GraphicsPipelineFragmentOutputVulkanStructs *stateOut, GraphicsPipelineDynamicStateList *dynamicStateListOut) const; @@ -1237,7 +1237,7 @@ class YcbcrConversionDesc final void updateConversionModel(VkSamplerYcbcrModelConversion conversionModel); uint64_t getExternalFormat() const { return mIsExternalFormat ? mExternalOrVkFormat : 0; } - angle::Result init(Context *context, SamplerYcbcrConversion *conversionOut) const; + angle::Result init(ErrorContext *context, SamplerYcbcrConversion *conversionOut) const; private: // If the sampler needs to convert the image content (e.g. from YUV to RGB) then @@ -1279,7 +1279,7 @@ class SamplerDesc final { public: SamplerDesc(); - SamplerDesc(Context *context, + SamplerDesc(ErrorContext *context, const gl::SamplerState &samplerState, bool stencilMode, const YcbcrConversionDesc *ycbcrConversionDesc, @@ -1414,14 +1414,14 @@ class PipelineCacheAccess mMutex = mutex; } - VkResult createGraphicsPipeline(vk::Context *context, + VkResult createGraphicsPipeline(vk::ErrorContext *context, const VkGraphicsPipelineCreateInfo &createInfo, vk::Pipeline *pipelineOut); - VkResult createComputePipeline(vk::Context *context, + VkResult createComputePipeline(vk::ErrorContext *context, const VkComputePipelineCreateInfo &createInfo, vk::Pipeline *pipelineOut); - VkResult getCacheData(vk::Context *context, size_t *cacheSize, void *cacheData); + VkResult getCacheData(vk::ErrorContext *context, size_t *cacheSize, void *cacheData); void merge(Renderer *renderer, const vk::PipelineCache &pipelineCache); @@ -1437,7 +1437,7 @@ class PipelineCacheAccess // Monolithic pipeline creation tasks are created as soon as a pipeline is created out of libraries. // However, they are not immediately posted to the worker queue to allow pacing. On each use of a // pipeline, an attempt is made to post the task. -class CreateMonolithicPipelineTask : public Context, public angle::Closure +class CreateMonolithicPipelineTask : public ErrorContext, public angle::Closure { public: CreateMonolithicPipelineTask(Renderer *renderer, @@ -1523,7 +1523,7 @@ class PipelineHelper final : public Resource PipelineHelper &operator=(PipelineHelper &&other); void destroy(VkDevice device); - void release(Context *context); + void release(ErrorContext *context); bool valid() const { return mPipeline.valid(); } const Pipeline &getPipeline() const { return mPipeline; } @@ -1611,7 +1611,7 @@ class FramebufferHelper : public Resource FramebufferHelper(FramebufferHelper &&other); FramebufferHelper &operator=(FramebufferHelper &&other); - angle::Result init(Context *context, const VkFramebufferCreateInfo &createInfo); + angle::Result init(ErrorContext *context, const VkFramebufferCreateInfo &createInfo); void destroy(Renderer *renderer); void release(ContextVk *contextVk); @@ -1932,7 +1932,7 @@ class DescriptorSetDescBuilder final const BufferHelper &bufferHelper, VkDeviceSize bufferRange); - void updateTransformFeedbackBuffer(const Context *context, + void updateTransformFeedbackBuffer(const ErrorContext *context, const ShaderInterfaceVariableInfoMap &variableInfoMap, const WriteDescriptorDescs &writeDescriptorDescs, uint32_t xfbBufferIndex, @@ -1940,7 +1940,7 @@ class DescriptorSetDescBuilder final VkDeviceSize bufferOffset, VkDeviceSize bufferRange); - void updateUniformsAndXfb(Context *context, + void updateUniformsAndXfb(ErrorContext *context, const gl::ProgramExecutable &executable, const WriteDescriptorDescs &writeDescriptorDescs, const BufferHelper *currentUniformBuffer, @@ -1950,7 +1950,7 @@ class DescriptorSetDescBuilder final // Specific helpers for shader resource descriptors. template - void updateOneShaderBuffer(Context *context, + void updateOneShaderBuffer(ErrorContext *context, CommandBufferT *commandBufferHelper, const ShaderInterfaceVariableInfoMap &variableInfoMap, const gl::BufferVector &buffers, @@ -1962,7 +1962,7 @@ class DescriptorSetDescBuilder final const WriteDescriptorDescs &writeDescriptorDescs, const GLbitfield memoryBarrierBits); template - void updateShaderBuffers(Context *context, + void updateShaderBuffers(ErrorContext *context, CommandBufferT *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -1974,7 +1974,7 @@ class DescriptorSetDescBuilder final const WriteDescriptorDescs &writeDescriptorDescs, const GLbitfield memoryBarrierBits); template - void updateAtomicCounters(Context *context, + void updateAtomicCounters(ErrorContext *context, CommandBufferT *commandBufferHelper, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, @@ -1983,20 +1983,20 @@ class DescriptorSetDescBuilder final const VkDeviceSize requiredOffsetAlignment, const BufferHelper &emptyBuffer, const WriteDescriptorDescs &writeDescriptorDescs); - angle::Result updateImages(Context *context, + angle::Result updateImages(ErrorContext *context, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, const gl::ActiveTextureArray &activeImages, const std::vector &imageUnits, const WriteDescriptorDescs &writeDescriptorDescs); - angle::Result updateInputAttachments(vk::Context *context, + angle::Result updateInputAttachments(vk::ErrorContext *context, const gl::ProgramExecutable &executable, const ShaderInterfaceVariableInfoMap &variableInfoMap, FramebufferVk *framebufferVk, const WriteDescriptorDescs &writeDescriptorDescs); // Specialized update for textures. - void updatePreCacheActiveTextures(Context *context, + void updatePreCacheActiveTextures(ErrorContext *context, const gl::ProgramExecutable &executable, const gl::ActiveTextureArray &textures, const gl::SamplerBindingVector &samplers); @@ -2010,7 +2010,7 @@ class DescriptorSetDescBuilder final size_t getDynamicOffsetsSize() const { return mDynamicOffsets.size(); } private: - void updateInputAttachment(Context *context, + void updateInputAttachment(ErrorContext *context, uint32_t binding, ImageLayout layout, const vk::ImageView *imageView, @@ -2162,7 +2162,7 @@ class SamplerHelper final : angle::NonCopyable explicit SamplerHelper(SamplerHelper &&samplerHelper); SamplerHelper &operator=(SamplerHelper &&rhs); - angle::Result init(Context *context, const VkSamplerCreateInfo &createInfo); + angle::Result init(ErrorContext *context, const VkSamplerCreateInfo &createInfo); angle::Result init(ContextVk *contextVk, const SamplerDesc &desc); void destroy(VkDevice device) { mSampler.destroy(device); } void destroy() { ASSERT(!valid()); } @@ -2498,7 +2498,7 @@ class RenderPassCache final : angle::NonCopyable static void InitializeOpsForCompatibleRenderPass(const vk::RenderPassDesc &desc, vk::AttachmentOpsArray *opsOut); - static angle::Result MakeRenderPass(vk::Context *context, + static angle::Result MakeRenderPass(vk::ErrorContext *context, const vk::RenderPassDesc &desc, const vk::AttachmentOpsArray &ops, vk::RenderPass *renderPass, @@ -2636,8 +2636,8 @@ class GraphicsPipelineCache final : public HasCacheStatsgetActualFormatID(), dstTilingMode); } -void ReleaseBufferListToRenderer(Context *context, BufferHelperQueue *buffers) +void ReleaseBufferListToRenderer(ErrorContext *context, BufferHelperQueue *buffers) { for (std::unique_ptr &toFree : *buffers) { @@ -1131,7 +1131,7 @@ bool IsClearOfAllChannels(UpdateSource updateSource) updateSource == UpdateSource::ClearAfterInvalidate; } -angle::Result InitDynamicDescriptorPool(Context *context, +angle::Result InitDynamicDescriptorPool(ErrorContext *context, const DescriptorSetLayoutDesc &descriptorSetLayoutDesc, const DescriptorSetLayout &descriptorSetLayout, uint32_t descriptorCountMultiplier, @@ -1279,7 +1279,7 @@ VkPipelineStageFlags ConvertShaderBitSetToVkPipelineStageFlags( uint32_t DynamicDescriptorPool::mMaxSetsPerPool = 16; uint32_t DynamicDescriptorPool::mMaxSetsPerPoolMultiplier = 2; -ImageLayout GetImageLayoutFromGLImageLayout(Context *context, GLenum layout) +ImageLayout GetImageLayoutFromGLImageLayout(ErrorContext *context, GLenum layout) { const bool supportsMixedReadWriteDepthStencilLayouts = context->getFeatures().supportsMixedReadWriteDepthStencilLayouts.enabled; @@ -1545,7 +1545,7 @@ void RenderPassAttachment::onRenderAreaGrowth(ContextVk *contextVk, mInvalidatedCmdCount = kInfiniteCmdCount; } -void RenderPassAttachment::finalizeLoadStore(Context *context, +void RenderPassAttachment::finalizeLoadStore(ErrorContext *context, uint32_t currentCmdCount, bool hasUnresolveAttachment, bool hasResolveAttachment, @@ -1731,7 +1731,7 @@ void CommandBufferHelperCommon::initializeImpl() mCommandAllocator.init(); } -void CommandBufferHelperCommon::resetImpl(Context *context) +void CommandBufferHelperCommon::resetImpl(ErrorContext *context) { ASSERT(!mAcquireNextImageSemaphore.valid()); mCommandAllocator.resetAllocator(); @@ -1742,7 +1742,7 @@ void CommandBufferHelperCommon::resetImpl(Context *context) } template -angle::Result CommandBufferHelperCommon::attachCommandPoolImpl(Context *context, +angle::Result CommandBufferHelperCommon::attachCommandPoolImpl(ErrorContext *context, SecondaryCommandPool *commandPool) { if constexpr (!DerivedT::ExecutesInline()) @@ -1761,7 +1761,7 @@ angle::Result CommandBufferHelperCommon::attachCommandPoolImpl(Context *context, template angle::Result CommandBufferHelperCommon::detachCommandPoolImpl( - Context *context, + ErrorContext *context, SecondaryCommandPool **commandPoolOut) { if constexpr (!DerivedT::ExecutesInline()) @@ -1838,7 +1838,7 @@ void CommandBufferHelperCommon::assertCanBeRecycledImpl() ASSERT(!DerivedT::ExecutesInline() || derived->getCommandBuffer().empty()); } -void CommandBufferHelperCommon::bufferWrite(Context *context, +void CommandBufferHelperCommon::bufferWrite(ErrorContext *context, VkAccessFlags writeAccessType, PipelineStage writeStage, BufferHelper *buffer) @@ -1847,7 +1847,7 @@ void CommandBufferHelperCommon::bufferWrite(Context *context, bufferWriteImpl(context, writeAccessType, writePipelineStageFlags, writeStage, buffer); } -void CommandBufferHelperCommon::bufferWrite(Context *context, +void CommandBufferHelperCommon::bufferWrite(ErrorContext *context, VkAccessFlags writeAccessType, const gl::ShaderBitSet &writeShaderStages, BufferHelper *buffer) @@ -1858,7 +1858,7 @@ void CommandBufferHelperCommon::bufferWrite(Context *context, bufferWriteImpl(context, writeAccessType, writePipelineStageFlags, firstWriteStage, buffer); } -void CommandBufferHelperCommon::bufferRead(Context *context, +void CommandBufferHelperCommon::bufferRead(ErrorContext *context, VkAccessFlags readAccessType, PipelineStage readStage, BufferHelper *buffer) @@ -1867,7 +1867,7 @@ void CommandBufferHelperCommon::bufferRead(Context *context, bufferReadImpl(context, readAccessType, readPipelineStageFlags, readStage, buffer); } -void CommandBufferHelperCommon::bufferRead(Context *context, +void CommandBufferHelperCommon::bufferRead(ErrorContext *context, VkAccessFlags readAccessType, const gl::ShaderBitSet &readShaderStages, BufferHelper *buffer) @@ -1878,7 +1878,7 @@ void CommandBufferHelperCommon::bufferRead(Context *context, bufferReadImpl(context, readAccessType, readPipelineStageFlags, firstReadStage, buffer); } -void CommandBufferHelperCommon::bufferWriteImpl(Context *context, +void CommandBufferHelperCommon::bufferWriteImpl(ErrorContext *context, VkAccessFlags writeAccessType, VkPipelineStageFlags writePipelineStageFlags, PipelineStage writeStage, @@ -1898,7 +1898,7 @@ void CommandBufferHelperCommon::bufferWriteImpl(Context *context, buffer->setWriteQueueSerial(mQueueSerial); } -void CommandBufferHelperCommon::bufferReadImpl(Context *context, +void CommandBufferHelperCommon::bufferReadImpl(ErrorContext *context, VkAccessFlags readAccessType, VkPipelineStageFlags readPipelineStageFlags, PipelineStage readStage, @@ -1923,7 +1923,7 @@ void CommandBufferHelperCommon::bufferReadImpl(Context *context, } } -void CommandBufferHelperCommon::imageReadImpl(Context *context, +void CommandBufferHelperCommon::imageReadImpl(ErrorContext *context, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, BarrierType barrierType, @@ -1935,7 +1935,7 @@ void CommandBufferHelperCommon::imageReadImpl(Context *context, } } -void CommandBufferHelperCommon::imageWriteImpl(Context *context, +void CommandBufferHelperCommon::imageWriteImpl(ErrorContext *context, gl::LevelIndex level, uint32_t layerStart, uint32_t layerCount, @@ -1951,7 +1951,7 @@ void CommandBufferHelperCommon::imageWriteImpl(Context *context, } } -void CommandBufferHelperCommon::updateImageLayoutAndBarrier(Context *context, +void CommandBufferHelperCommon::updateImageLayoutAndBarrier(ErrorContext *context, ImageHelper *image, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, @@ -1970,7 +1970,7 @@ void CommandBufferHelperCommon::updateImageLayoutAndBarrier(Context *context, } } -void CommandBufferHelperCommon::retainImageWithEvent(Context *context, ImageHelper *image) +void CommandBufferHelperCommon::retainImageWithEvent(ErrorContext *context, ImageHelper *image) { image->setQueueSerial(mQueueSerial); image->updatePipelineStageAccessHistory(); @@ -1982,7 +1982,8 @@ void CommandBufferHelperCommon::retainImageWithEvent(Context *context, ImageHelp } template -void CommandBufferHelperCommon::flushSetEventsImpl(Context *context, CommandBufferT *commandBuffer) +void CommandBufferHelperCommon::flushSetEventsImpl(ErrorContext *context, + CommandBufferT *commandBuffer) { if (mRefCountedEvents.mask.none()) { @@ -2004,10 +2005,10 @@ void CommandBufferHelperCommon::flushSetEventsImpl(Context *context, CommandBuff } template void CommandBufferHelperCommon::flushSetEventsImpl( - Context *context, + ErrorContext *context, priv::SecondaryCommandBuffer *commandBuffer); template void CommandBufferHelperCommon::flushSetEventsImpl( - Context *context, + ErrorContext *context, VulkanSecondaryCommandBuffer *commandBuffer); void CommandBufferHelperCommon::executeBarriers(Renderer *renderer, CommandsState *commandsState) @@ -2034,12 +2035,12 @@ OutsideRenderPassCommandBufferHelper::OutsideRenderPassCommandBufferHelper() {} OutsideRenderPassCommandBufferHelper::~OutsideRenderPassCommandBufferHelper() {} -angle::Result OutsideRenderPassCommandBufferHelper::initialize(Context *context) +angle::Result OutsideRenderPassCommandBufferHelper::initialize(ErrorContext *context) { initializeImpl(); return initializeCommandBuffer(context); } -angle::Result OutsideRenderPassCommandBufferHelper::initializeCommandBuffer(Context *context) +angle::Result OutsideRenderPassCommandBufferHelper::initializeCommandBuffer(ErrorContext *context) { // Skip initialization in the Pool-detached state. if (!ExecutesInline() && mCommandPool == nullptr) @@ -2051,7 +2052,7 @@ angle::Result OutsideRenderPassCommandBufferHelper::initializeCommandBuffer(Cont } angle::Result OutsideRenderPassCommandBufferHelper::reset( - Context *context, + ErrorContext *context, SecondaryCommandBufferCollector *commandBufferCollector) { resetImpl(context); @@ -2066,7 +2067,7 @@ angle::Result OutsideRenderPassCommandBufferHelper::reset( return initializeCommandBuffer(context); } -void OutsideRenderPassCommandBufferHelper::imageRead(Context *context, +void OutsideRenderPassCommandBufferHelper::imageRead(ErrorContext *context, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, ImageHelper *image) @@ -2088,7 +2089,7 @@ void OutsideRenderPassCommandBufferHelper::imageRead(Context *context, } } -void OutsideRenderPassCommandBufferHelper::imageWrite(Context *context, +void OutsideRenderPassCommandBufferHelper::imageWrite(ErrorContext *context, gl::LevelIndex level, uint32_t layerStart, uint32_t layerCount, @@ -2109,7 +2110,8 @@ void OutsideRenderPassCommandBufferHelper::retainImage(ImageHelper *image) image->updatePipelineStageAccessHistory(); } -void OutsideRenderPassCommandBufferHelper::trackImageWithEvent(Context *context, ImageHelper *image) +void OutsideRenderPassCommandBufferHelper::trackImageWithEvent(ErrorContext *context, + ImageHelper *image) { image->setCurrentRefCountedEvent(context, mRefCountedEvents); flushSetEventsImpl(context, &mCommandBuffer); @@ -2125,7 +2127,7 @@ void OutsideRenderPassCommandBufferHelper::collectRefCountedEventsGarbage( } } -angle::Result OutsideRenderPassCommandBufferHelper::flushToPrimary(Context *context, +angle::Result OutsideRenderPassCommandBufferHelper::flushToPrimary(ErrorContext *context, CommandsState *commandsState) { ANGLE_TRACE_EVENT0("gpu.angle", "OutsideRenderPassCommandBufferHelper::flushToPrimary"); @@ -2151,7 +2153,7 @@ angle::Result OutsideRenderPassCommandBufferHelper::flushToPrimary(Context *cont return reset(context, &commandsState->secondaryCommands); } -angle::Result OutsideRenderPassCommandBufferHelper::endCommandBuffer(Context *context) +angle::Result OutsideRenderPassCommandBufferHelper::endCommandBuffer(ErrorContext *context) { ASSERT(ExecutesInline() || mCommandPool != nullptr); ASSERT(mCommandBuffer.valid()); @@ -2164,14 +2166,14 @@ angle::Result OutsideRenderPassCommandBufferHelper::endCommandBuffer(Context *co } angle::Result OutsideRenderPassCommandBufferHelper::attachCommandPool( - Context *context, + ErrorContext *context, SecondaryCommandPool *commandPool) { return attachCommandPoolImpl(context, commandPool); } angle::Result OutsideRenderPassCommandBufferHelper::detachCommandPool( - Context *context, + ErrorContext *context, SecondaryCommandPool **commandPoolOut) { return detachCommandPoolImpl(context, @@ -2233,7 +2235,7 @@ void RenderPassFramebuffer::addResolveAttachment(size_t viewIndex, VkImageView v } angle::Result RenderPassFramebuffer::packResolveViewsAndCreateFramebuffer( - Context *context, + ErrorContext *context, const RenderPass &renderPass, Framebuffer *framebufferOut) { @@ -2310,12 +2312,12 @@ RenderPassCommandBufferHelper::RenderPassCommandBufferHelper() RenderPassCommandBufferHelper::~RenderPassCommandBufferHelper() {} -angle::Result RenderPassCommandBufferHelper::initialize(Context *context) +angle::Result RenderPassCommandBufferHelper::initialize(ErrorContext *context) { initializeImpl(); return initializeCommandBuffer(context); } -angle::Result RenderPassCommandBufferHelper::initializeCommandBuffer(Context *context) +angle::Result RenderPassCommandBufferHelper::initializeCommandBuffer(ErrorContext *context) { // Skip initialization in the Pool-detached state. if (!ExecutesInline() && mCommandPool == nullptr) @@ -2327,7 +2329,7 @@ angle::Result RenderPassCommandBufferHelper::initializeCommandBuffer(Context *co } angle::Result RenderPassCommandBufferHelper::reset( - Context *context, + ErrorContext *context, SecondaryCommandBufferCollector *commandBufferCollector) { resetImpl(context); @@ -2559,7 +2561,7 @@ void RenderPassCommandBufferHelper::updateStartedRenderPassWithDepthStencilMode( } void RenderPassCommandBufferHelper::finalizeColorImageLayout( - Context *context, + ErrorContext *context, ImageHelper *image, PackedAttachmentIndex packedAttachmentIndex, bool isResolveImage) @@ -2651,7 +2653,7 @@ void RenderPassCommandBufferHelper::finalizeColorImageLayout( } void RenderPassCommandBufferHelper::finalizeColorImageLoadStore( - Context *context, + ErrorContext *context, PackedAttachmentIndex packedAttachmentIndex) { PackedAttachmentOpsDesc &ops = mAttachmentOps[packedAttachmentIndex]; @@ -2690,7 +2692,7 @@ void RenderPassCommandBufferHelper::finalizeColorImageLoadStore( SetBitField(ops.storeOp, storeOp); } -void RenderPassCommandBufferHelper::finalizeDepthStencilImageLayout(Context *context) +void RenderPassCommandBufferHelper::finalizeDepthStencilImageLayout(ErrorContext *context) { ASSERT(mDepthAttachment.getImage() != nullptr); ASSERT(mDepthAttachment.getImage() == mStencilAttachment.getImage()); @@ -2771,7 +2773,7 @@ void RenderPassCommandBufferHelper::finalizeDepthStencilImageLayout(Context *con } } -void RenderPassCommandBufferHelper::finalizeDepthStencilResolveImageLayout(Context *context) +void RenderPassCommandBufferHelper::finalizeDepthStencilResolveImageLayout(ErrorContext *context) { ASSERT(mDepthResolveAttachment.getImage() != nullptr); ASSERT(mDepthResolveAttachment.getImage() == mStencilResolveAttachment.getImage()); @@ -2810,7 +2812,7 @@ void RenderPassCommandBufferHelper::finalizeDepthStencilResolveImageLayout(Conte depthStencilResolveImage->resetRenderPassUsageFlags(); } -void RenderPassCommandBufferHelper::finalizeFragmentShadingRateImageLayout(Context *context) +void RenderPassCommandBufferHelper::finalizeFragmentShadingRateImageLayout(ErrorContext *context) { ImageHelper *image = mFragmentShadingRateAtachment.getImage(); ImageLayout imageLayout = ImageLayout::FragmentShadingRateAttachmentReadOnly; @@ -2823,7 +2825,7 @@ void RenderPassCommandBufferHelper::finalizeFragmentShadingRateImageLayout(Conte image->resetRenderPassUsageFlags(); } -void RenderPassCommandBufferHelper::finalizeImageLayout(Context *context, +void RenderPassCommandBufferHelper::finalizeImageLayout(ErrorContext *context, const ImageHelper *image, UniqueSerial imageSiblingSerial) { @@ -2867,7 +2869,7 @@ void RenderPassCommandBufferHelper::finalizeImageLayout(Context *context, } } -void RenderPassCommandBufferHelper::finalizeDepthStencilLoadStore(Context *context) +void RenderPassCommandBufferHelper::finalizeDepthStencilLoadStore(ErrorContext *context) { ASSERT(mDepthStencilAttachmentIndex != kAttachmentIndexInvalid); @@ -2962,7 +2964,7 @@ void RenderPassCommandBufferHelper::finalizeDepthStencilLoadStore(Context *conte } void RenderPassCommandBufferHelper::finalizeColorImageLayoutAndLoadStore( - Context *context, + ErrorContext *context, PackedAttachmentIndex packedAttachmentIndex) { finalizeColorImageLayout(context, mColorAttachments[packedAttachmentIndex].getImage(), @@ -2972,7 +2974,8 @@ void RenderPassCommandBufferHelper::finalizeColorImageLayoutAndLoadStore( mColorAttachments[packedAttachmentIndex].getImage()->resetRenderPassUsageFlags(); } -void RenderPassCommandBufferHelper::finalizeDepthStencilImageLayoutAndLoadStore(Context *context) +void RenderPassCommandBufferHelper::finalizeDepthStencilImageLayoutAndLoadStore( + ErrorContext *context) { finalizeDepthStencilImageLayout(context); finalizeDepthStencilLoadStore(context); @@ -2981,7 +2984,7 @@ void RenderPassCommandBufferHelper::finalizeDepthStencilImageLayoutAndLoadStore( mDepthAttachment.getImage()->resetRenderPassUsageFlags(); } -void RenderPassCommandBufferHelper::executeSetEvents(Context *context, +void RenderPassCommandBufferHelper::executeSetEvents(ErrorContext *context, PrimaryCommandBuffer *primary) { Renderer *renderer = context->getRenderer(); @@ -3021,7 +3024,7 @@ void RenderPassCommandBufferHelper::collectRefCountedEventsGarbage( } void RenderPassCommandBufferHelper::updatePerfCountersForDynamicRenderingInstance( - Context *context, + ErrorContext *context, angle::VulkanPerfCounters *countersOut) { mRenderPassDesc.updatePerfCounters(context, mFramebuffer.getUnpackedImageViews(), @@ -3220,7 +3223,7 @@ void RenderPassCommandBufferHelper::invalidateRenderPassStencilAttachment( getRenderPassWriteCommandCount()); } -angle::Result RenderPassCommandBufferHelper::flushToPrimary(Context *context, +angle::Result RenderPassCommandBufferHelper::flushToPrimary(ErrorContext *context, CommandsState *commandsState, const RenderPass &renderPass, VkFramebuffer framebufferOverride) @@ -3426,7 +3429,7 @@ void RenderPassCommandBufferHelper::growRenderArea(ContextVk *contextVk, mStencilAttachment.onRenderAreaGrowth(contextVk, mRenderArea); } -angle::Result RenderPassCommandBufferHelper::attachCommandPool(Context *context, +angle::Result RenderPassCommandBufferHelper::attachCommandPool(ErrorContext *context, SecondaryCommandPool *commandPool) { ASSERT(!mRenderPassStarted); @@ -3548,7 +3551,7 @@ template void CommandBufferRecycler::onDestroy(); template angle::Result CommandBufferRecycler::getCommandBufferHelper( - Context *context, + ErrorContext *context, SecondaryCommandPool *commandPool, SecondaryCommandMemoryAllocator *commandsAllocator, CommandBufferHelperT **commandBufferHelperOut) @@ -3577,12 +3580,12 @@ angle::Result CommandBufferRecycler::getCommandBufferHelpe template angle::Result CommandBufferRecycler::getCommandBufferHelper( - Context *, + ErrorContext *, SecondaryCommandPool *, SecondaryCommandMemoryAllocator *, OutsideRenderPassCommandBufferHelper **); template angle::Result CommandBufferRecycler::getCommandBufferHelper( - Context *, + ErrorContext *, SecondaryCommandPool *, SecondaryCommandMemoryAllocator *, RenderPassCommandBufferHelper **); @@ -3700,7 +3703,7 @@ DynamicBuffer::~DynamicBuffer() ASSERT(mBufferFreeList.empty()); } -angle::Result DynamicBuffer::allocateNewBuffer(Context *context) +angle::Result DynamicBuffer::allocateNewBuffer(ErrorContext *context) { context->getPerfCounters().dynamicBufferAllocations++; @@ -3745,7 +3748,7 @@ bool DynamicBuffer::allocateFromCurrentBuffer(size_t sizeInBytes, BufferHelper * return true; } -angle::Result DynamicBuffer::allocate(Context *context, +angle::Result DynamicBuffer::allocate(ErrorContext *context, size_t sizeInBytes, BufferHelper **bufferHelperOut, bool *newBufferAllocatedOut) @@ -3815,7 +3818,7 @@ angle::Result DynamicBuffer::allocate(Context *context, return angle::Result::Continue; } -void DynamicBuffer::release(Context *context) +void DynamicBuffer::release(ErrorContext *context) { reset(); @@ -4038,7 +4041,7 @@ void BufferPool::pruneEmptyBuffers(Renderer *renderer) mNumberOfNewBuffersNeededSinceLastPrune = 0; } -VkResult BufferPool::allocateNewBuffer(Context *context, VkDeviceSize sizeInBytes) +VkResult BufferPool::allocateNewBuffer(ErrorContext *context, VkDeviceSize sizeInBytes) { Renderer *renderer = context->getRenderer(); const Allocator &allocator = renderer->getAllocator(); @@ -4101,7 +4104,7 @@ VkResult BufferPool::allocateNewBuffer(Context *context, VkDeviceSize sizeInByte return VK_SUCCESS; } -VkResult BufferPool::allocateBuffer(Context *context, +VkResult BufferPool::allocateBuffer(ErrorContext *context, VkDeviceSize sizeInBytes, VkDeviceSize alignment, BufferSuballocation *suballocation) @@ -4303,7 +4306,7 @@ DescriptorPoolHelper::~DescriptorPoolHelper() ASSERT(mFinishedGarbageList.empty()); } -angle::Result DescriptorPoolHelper::init(Context *context, +angle::Result DescriptorPoolHelper::init(ErrorContext *context, const std::vector &poolSizesIn, uint32_t maxSets) { @@ -4351,7 +4354,7 @@ void DescriptorPoolHelper::destroy(VkDevice device) mDescriptorPool.destroy(device); } -bool DescriptorPoolHelper::allocateVkDescriptorSet(Context *context, +bool DescriptorPoolHelper::allocateVkDescriptorSet(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, VkDescriptorSet *descriptorSetOut) { @@ -4410,7 +4413,7 @@ bool DescriptorPoolHelper::recycleFromGarbage(Renderer *renderer, return false; } -bool DescriptorPoolHelper::allocateDescriptorSet(Context *context, +bool DescriptorPoolHelper::allocateDescriptorSet(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, const DescriptorPoolPointer &pool, DescriptorSetPointer *descriptorSetOut) @@ -4473,7 +4476,7 @@ DynamicDescriptorPool &DynamicDescriptorPool::operator=(DynamicDescriptorPool && return *this; } -angle::Result DynamicDescriptorPool::init(Context *context, +angle::Result DynamicDescriptorPool::init(ErrorContext *context, const VkDescriptorPoolSize *setSizes, size_t setSizeCount, const DescriptorSetLayout &descriptorSetLayout) @@ -4518,7 +4521,7 @@ void DynamicDescriptorPool::destroy(VkDevice device) mCachedDescriptorSetLayout = VK_NULL_HANDLE; } -bool DynamicDescriptorPool::allocateFromExistingPool(Context *context, +bool DynamicDescriptorPool::allocateFromExistingPool(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, DescriptorSetPointer *descriptorSetOut) { @@ -4613,7 +4616,7 @@ bool DynamicDescriptorPool::evictStaleDescriptorSets(Renderer *renderer, } angle::Result DynamicDescriptorPool::allocateDescriptorSet( - Context *context, + ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, DescriptorSetPointer *descriptorSetOut) { @@ -4640,7 +4643,7 @@ angle::Result DynamicDescriptorPool::allocateDescriptorSet( } angle::Result DynamicDescriptorPool::getOrAllocateDescriptorSet( - Context *context, + ErrorContext *context, uint32_t currentFrame, const DescriptorSetDesc &desc, const DescriptorSetLayout &descriptorSetLayout, @@ -4708,7 +4711,7 @@ angle::Result DynamicDescriptorPool::getOrAllocateDescriptorSet( return angle::Result::Continue; } -angle::Result DynamicDescriptorPool::allocateNewPool(Context *context) +angle::Result DynamicDescriptorPool::allocateNewPool(ErrorContext *context) { static constexpr size_t kMaxPools = 99999; ANGLE_VK_CHECK(context, mDescriptorPools.size() < kMaxPools, VK_ERROR_TOO_MANY_OBJECTS); @@ -4859,7 +4862,8 @@ template DynamicallyGrowingPool::~DynamicallyGrowingPool() = default; template -angle::Result DynamicallyGrowingPool::initEntryPool(Context *contextVk, uint32_t poolSize) +angle::Result DynamicallyGrowingPool::initEntryPool(ErrorContext *contextVk, + uint32_t poolSize) { ASSERT(mPools.empty()); mPoolSize = poolSize; @@ -5445,7 +5449,7 @@ BufferHelper &BufferHelper::operator=(BufferHelper &&other) return *this; } -angle::Result BufferHelper::init(Context *context, +angle::Result BufferHelper::init(ErrorContext *context, const VkBufferCreateInfo &requestedCreateInfo, VkMemoryPropertyFlags memoryPropertyFlags) { @@ -5516,7 +5520,7 @@ angle::Result BufferHelper::init(Context *context, return angle::Result::Continue; } -angle::Result BufferHelper::initExternal(Context *context, +angle::Result BufferHelper::initExternal(ErrorContext *context, VkMemoryPropertyFlags memoryProperties, const VkBufferCreateInfo &requestedCreateInfo, GLeglClientBufferEXT clientBuffer) @@ -5558,7 +5562,7 @@ angle::Result BufferHelper::initExternal(Context *context, return angle::Result::Continue; } -VkResult BufferHelper::initSuballocation(Context *context, +VkResult BufferHelper::initSuballocation(ErrorContext *context, uint32_t memoryTypeIndex, size_t size, size_t alignment, @@ -5586,7 +5590,7 @@ VkResult BufferHelper::initSuballocation(Context *context, return VK_SUCCESS; } -void BufferHelper::initializeBarrierTracker(Context *context) +void BufferHelper::initializeBarrierTracker(ErrorContext *context) { Renderer *renderer = context->getRenderer(); mCurrentDeviceQueueIndex = context->getDeviceQueueIndex(); @@ -5598,7 +5602,7 @@ void BufferHelper::initializeBarrierTracker(Context *context) mCurrentReadStages = 0; } -angle::Result BufferHelper::initializeNonZeroMemory(Context *context, +angle::Result BufferHelper::initializeNonZeroMemory(ErrorContext *context, VkBufferUsageFlags usage, VkDeviceSize size) { @@ -5733,7 +5737,7 @@ void BufferHelper::release(Renderer *renderer) releaseImpl(renderer); } -void BufferHelper::release(Context *context) +void BufferHelper::release(ErrorContext *context) { releaseImpl(context->getRenderer()); } @@ -5765,7 +5769,7 @@ void BufferHelper::releaseImpl(Renderer *renderer) } } -void BufferHelper::releaseBufferAndDescriptorSetCache(Context *context) +void BufferHelper::releaseBufferAndDescriptorSetCache(ErrorContext *context) { Renderer *renderer = context->getRenderer(); if (renderer->hasResourceUseFinished(getResourceUse())) @@ -5780,7 +5784,7 @@ void BufferHelper::releaseBufferAndDescriptorSetCache(Context *context) release(context); } -angle::Result BufferHelper::map(Context *context, uint8_t **ptrOut) +angle::Result BufferHelper::map(ErrorContext *context, uint8_t **ptrOut) { if (!mSuballocation.isMapped()) { @@ -5790,7 +5794,7 @@ angle::Result BufferHelper::map(Context *context, uint8_t **ptrOut) return angle::Result::Continue; } -angle::Result BufferHelper::mapWithOffset(Context *context, uint8_t **ptrOut, size_t offset) +angle::Result BufferHelper::mapWithOffset(ErrorContext *context, uint8_t **ptrOut, size_t offset) { uint8_t *mapBufPointer; ANGLE_TRY(map(context, &mapBufPointer)); @@ -5863,7 +5867,7 @@ bool BufferHelper::isReleasedToExternal() const return mIsReleasedToExternal; } -void BufferHelper::recordReadBarrier(Context *context, +void BufferHelper::recordReadBarrier(ErrorContext *context, VkAccessFlags readAccessType, VkPipelineStageFlags readStage, PipelineStage stageIndex, @@ -5883,7 +5887,7 @@ void BufferHelper::recordReadBarrier(Context *context, mCurrentReadStages |= readStage; } -void BufferHelper::recordWriteBarrier(Context *context, +void BufferHelper::recordWriteBarrier(ErrorContext *context, VkAccessFlags writeAccessType, VkPipelineStageFlags writeStage, PipelineStage stageIndex, @@ -5976,7 +5980,7 @@ void BufferHelper::fillWithPattern(const void *pattern, } // Used for ImageHelper non-zero memory allocation when useVmaForImageSuballocation is disabled. -angle::Result InitMappableDeviceMemory(Context *context, +angle::Result InitMappableDeviceMemory(ErrorContext *context, DeviceMemory *deviceMemory, VkDeviceSize size, int value, @@ -6130,7 +6134,7 @@ const ImageHelper::LevelContentDefinedMask &ImageHelper::getLevelStencilContentD return mStencilContentDefined[level.get()]; } -YcbcrConversionDesc ImageHelper::deriveConversionDesc(Context *context, +YcbcrConversionDesc ImageHelper::deriveConversionDesc(ErrorContext *context, angle::FormatID actualFormatID, angle::FormatID intendedFormatID) { @@ -6182,7 +6186,7 @@ YcbcrConversionDesc ImageHelper::deriveConversionDesc(Context *context, return conversionDesc; } -angle::Result ImageHelper::init(Context *context, +angle::Result ImageHelper::init(ErrorContext *context, gl::TextureType textureType, const VkExtent3D &extents, const Format &format, @@ -6203,7 +6207,7 @@ angle::Result ImageHelper::init(Context *context, nullptr); } -angle::Result ImageHelper::initFromCreateInfo(Context *context, +angle::Result ImageHelper::initFromCreateInfo(ErrorContext *context, const VkImageCreateInfo &requestedCreateInfo, VkMemoryPropertyFlags memoryPropertyFlags) { @@ -6240,7 +6244,7 @@ angle::Result ImageHelper::initFromCreateInfo(Context *context, return angle::Result::Continue; } -angle::Result ImageHelper::copyToBufferOneOff(Context *context, +angle::Result ImageHelper::copyToBufferOneOff(ErrorContext *context, BufferHelper *stagingBuffer, VkBufferImageCopy copyRegion) { @@ -6267,7 +6271,7 @@ angle::Result ImageHelper::copyToBufferOneOff(Context *context, return renderer->finishQueueSerial(context, submitQueueSerial); } -angle::Result ImageHelper::initMSAASwapchain(Context *context, +angle::Result ImageHelper::initMSAASwapchain(ErrorContext *context, gl::TextureType textureType, const VkExtent3D &extents, bool rotatedAspectRatio, @@ -6293,7 +6297,7 @@ angle::Result ImageHelper::initMSAASwapchain(Context *context, return angle::Result::Continue; } -angle::Result ImageHelper::initExternal(Context *context, +angle::Result ImageHelper::initExternal(ErrorContext *context, gl::TextureType textureType, const VkExtent3D &extents, angle::FormatID intendedFormatID, @@ -6436,7 +6440,7 @@ angle::Result ImageHelper::initExternal(Context *context, // static const void *ImageHelper::DeriveCreateInfoPNext( - Context *context, + ErrorContext *context, angle::FormatID actualFormatID, const void *pNext, VkImageFormatListCreateInfoKHR *imageFormatListInfoStorage, @@ -6635,7 +6639,7 @@ void ImageHelper::resetImageWeakReference() ASSERT(!mAcquireNextImageSemaphore.valid()); } -angle::Result ImageHelper::initializeNonZeroMemory(Context *context, +angle::Result ImageHelper::initializeNonZeroMemory(ErrorContext *context, bool hasProtectedContent, VkMemoryPropertyFlags flags, VkDeviceSize size) @@ -6781,7 +6785,7 @@ angle::Result ImageHelper::initializeNonZeroMemory(Context *context, return angle::Result::Continue; } -VkResult ImageHelper::initMemory(Context *context, +VkResult ImageHelper::initMemory(ErrorContext *context, const MemoryProperties &memoryProperties, VkMemoryPropertyFlags flags, VkMemoryPropertyFlags excludedFlags, @@ -6822,7 +6826,7 @@ VkResult ImageHelper::initMemory(Context *context, } angle::Result ImageHelper::initMemoryAndNonZeroFillIfNeeded( - Context *context, + ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, VkMemoryPropertyFlags flags, @@ -6854,7 +6858,7 @@ angle::Result ImageHelper::initMemoryAndNonZeroFillIfNeeded( return angle::Result::Continue; } -angle::Result ImageHelper::initExternalMemory(Context *context, +angle::Result ImageHelper::initExternalMemory(ErrorContext *context, const MemoryProperties &memoryProperties, const VkMemoryRequirements &memoryRequirements, uint32_t extraAllocationInfoCount, @@ -6896,7 +6900,7 @@ angle::Result ImageHelper::initExternalMemory(Context *context, return angle::Result::Continue; } -angle::Result ImageHelper::initLayerImageView(Context *context, +angle::Result ImageHelper::initLayerImageView(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -6912,7 +6916,7 @@ angle::Result ImageHelper::initLayerImageView(Context *context, kDefaultImageViewUsageFlags, gl::YuvSamplingMode::Default); } -angle::Result ImageHelper::initLayerImageViewWithUsage(Context *context, +angle::Result ImageHelper::initLayerImageViewWithUsage(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -6930,7 +6934,7 @@ angle::Result ImageHelper::initLayerImageViewWithUsage(Context *context, } angle::Result ImageHelper::initLayerImageViewWithYuvModeOverride( - Context *context, + ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -6948,7 +6952,7 @@ angle::Result ImageHelper::initLayerImageViewWithYuvModeOverride( imageUsageFlags, yuvSamplingMode); } -angle::Result ImageHelper::initLayerImageViewImpl(Context *context, +angle::Result ImageHelper::initLayerImageViewImpl(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -7022,7 +7026,7 @@ angle::Result ImageHelper::initLayerImageViewImpl(Context *context, return angle::Result::Continue; } -angle::Result ImageHelper::initReinterpretedLayerImageView(Context *context, +angle::Result ImageHelper::initReinterpretedLayerImageView(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -7075,7 +7079,7 @@ void ImageHelper::destroy(Renderer *renderer) setEntireContentUndefined(); } -void ImageHelper::init2DWeakReference(Context *context, +void ImageHelper::init2DWeakReference(ErrorContext *context, VkImage handle, const gl::Extents &glExtents, bool rotatedAspectRatio, @@ -7116,7 +7120,7 @@ void ImageHelper::init2DWeakReference(Context *context, stageClearIfEmulatedFormat(isRobustResourceInitEnabled, false); } -angle::Result ImageHelper::init2DStaging(Context *context, +angle::Result ImageHelper::init2DStaging(ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, const gl::Extents &glExtents, @@ -7131,7 +7135,7 @@ angle::Result ImageHelper::init2DStaging(Context *context, intendedFormatID, actualFormatID, 1, usage, 1, layerCount); } -angle::Result ImageHelper::initStaging(Context *context, +angle::Result ImageHelper::initStaging(ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, VkImageType imageType, @@ -7202,7 +7206,7 @@ angle::Result ImageHelper::initStaging(Context *context, } angle::Result ImageHelper::initImplicitMultisampledRenderToTexture( - Context *context, + ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, gl::TextureType textureType, @@ -7456,7 +7460,7 @@ bool ImageHelper::isWriteBarrierNecessary(ImageLayout newLayout, return false; } -void ImageHelper::changeLayoutAndQueue(Context *context, +void ImageHelper::changeLayoutAndQueue(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, DeviceQueueIndex newDeviceQueueIndex, @@ -7471,7 +7475,7 @@ void ImageHelper::changeLayoutAndQueue(Context *context, ASSERT(acquireNextImageSemaphore == VK_NULL_HANDLE); } -void ImageHelper::acquireFromExternal(Context *context, +void ImageHelper::acquireFromExternal(ErrorContext *context, DeviceQueueIndex externalQueueIndex, DeviceQueueIndex newDeviceQueueIndex, ImageLayout currentLayout, @@ -7507,7 +7511,7 @@ void ImageHelper::acquireFromExternal(Context *context, } } -void ImageHelper::releaseToExternal(Context *context, +void ImageHelper::releaseToExternal(ErrorContext *context, DeviceQueueIndex externalQueueIndex, ImageLayout desiredLayout, OutsideRenderPassCommandBuffer *commandBuffer) @@ -7574,7 +7578,7 @@ ANGLE_INLINE void ImageHelper::initImageMemoryBarrierStruct( // Generalized to accept both "primary" and "secondary" command buffers. template -void ImageHelper::barrierImpl(Context *context, +void ImageHelper::barrierImpl(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, DeviceQueueIndex newDeviceQueueIndex, @@ -7672,7 +7676,7 @@ void ImageHelper::barrierImpl(Context *context, } template void ImageHelper::barrierImpl( - Context *context, + ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, DeviceQueueIndex newDeviceQueueIndex, @@ -7708,7 +7712,7 @@ void ImageHelper::resetSubresourcesWrittenSinceBarrier() } } -void ImageHelper::recordWriteBarrier(Context *context, +void ImageHelper::recordWriteBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, gl::LevelIndex levelStart, @@ -7734,7 +7738,7 @@ void ImageHelper::recordWriteBarrier(Context *context, setSubresourcesWrittenSinceBarrier(levelStart, levelCount, layerStart, layerCount); } -void ImageHelper::recordReadSubresourceBarrier(Context *context, +void ImageHelper::recordReadSubresourceBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, gl::LevelIndex levelStart, @@ -7764,7 +7768,7 @@ void ImageHelper::recordReadSubresourceBarrier(Context *context, setSubresourcesWrittenSinceBarrier(levelStart, levelCount, layerStart, layerCount); } -void ImageHelper::recordReadBarrier(Context *context, +void ImageHelper::recordReadBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, OutsideRenderPassCommandBufferHelper *commands) @@ -7786,7 +7790,7 @@ void ImageHelper::recordReadBarrier(Context *context, } } -void ImageHelper::updateLayoutAndBarrier(Context *context, +void ImageHelper::updateLayoutAndBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, BarrierType barrierType, @@ -8014,7 +8018,7 @@ void ImageHelper::updateLayoutAndBarrier(Context *context, ASSERT(!mCurrentEvent.valid()); } -void ImageHelper::setCurrentRefCountedEvent(Context *context, EventMaps &eventMaps) +void ImageHelper::setCurrentRefCountedEvent(ErrorContext *context, EventMaps &eventMaps) { ASSERT(context->getFeatures().useVkEventForImageBarrier.enabled); @@ -8511,7 +8515,7 @@ void ImageHelper::removeSingleStagedClearAfterInvalidate(gl::LevelIndex levelInd } } -void ImageHelper::removeStagedUpdates(Context *context, +void ImageHelper::removeStagedUpdates(ErrorContext *context, gl::LevelIndex levelGLStart, gl::LevelIndex levelGLEnd) { @@ -8835,7 +8839,7 @@ angle::Result ImageHelper::stageSubresourceUpdateImpl(ContextVk *contextVk, return angle::Result::Continue; } -angle::Result ImageHelper::updateSubresourceOnHost(Context *context, +angle::Result ImageHelper::updateSubresourceOnHost(ErrorContext *context, ApplyImageUpdate applyUpdate, const gl::ImageIndex &index, const gl::Extents &glExtents, @@ -12472,7 +12476,7 @@ angle::Result ImageViewHelper::initLinearAndSrgbReadViewsImpl(ContextVk *context return angle::Result::Continue; } -angle::Result ImageViewHelper::getLevelStorageImageView(Context *context, +angle::Result ImageViewHelper::getLevelStorageImageView(ErrorContext *context, gl::TextureType viewType, const ImageHelper &image, LevelIndex levelVk, @@ -12498,7 +12502,7 @@ angle::Result ImageViewHelper::getLevelStorageImageView(Context *context, image.getLayerCount(), imageUsageFlags, formatID); } -angle::Result ImageViewHelper::getLevelLayerStorageImageView(Context *contextVk, +angle::Result ImageViewHelper::getLevelLayerStorageImageView(ErrorContext *contextVk, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12527,7 +12531,7 @@ angle::Result ImageViewHelper::getLevelLayerStorageImageView(Context *contextVk, 1, imageUsageFlags, formatID); } -angle::Result ImageViewHelper::getLevelLayerDrawImageViewImpl(Context *context, +angle::Result ImageViewHelper::getLevelLayerDrawImageViewImpl(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12559,7 +12563,7 @@ angle::Result ImageViewHelper::getLevelLayerDrawImageViewImpl(Context *context, vk::ImageHelper::kDefaultImageViewUsageFlags, actualFormat); } -angle::Result ImageViewHelper::getLevelDrawImageView(Context *context, +angle::Result ImageViewHelper::getLevelDrawImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12593,7 +12597,7 @@ angle::Result ImageViewHelper::getLevelDrawImageView(Context *context, return getLevelLayerDrawImageViewImpl(context, image, levelVk, layer, layerCount, view.get()); } -angle::Result ImageViewHelper::getLevelLayerDrawImageView(Context *context, +angle::Result ImageViewHelper::getLevelLayerDrawImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12626,7 +12630,7 @@ angle::Result ImageViewHelper::getLevelLayerDrawImageView(Context *context, return getLevelLayerDrawImageViewImpl(context, image, levelVk, layer, 1, imageView); } -angle::Result ImageViewHelper::getLevelDepthOrStencilImageView(Context *context, +angle::Result ImageViewHelper::getLevelDepthOrStencilImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12660,7 +12664,7 @@ angle::Result ImageViewHelper::getLevelDepthOrStencilImageView(Context *context, aspect, view.get()); } -angle::Result ImageViewHelper::getLevelLayerDepthOrStencilImageView(Context *context, +angle::Result ImageViewHelper::getLevelLayerDepthOrStencilImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12690,7 +12694,7 @@ angle::Result ImageViewHelper::getLevelLayerDepthOrStencilImageView(Context *con } angle::Result ImageViewHelper::getLevelLayerDepthOrStencilImageViewImpl( - Context *context, + ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -12927,7 +12931,7 @@ void BufferViewHelper::destroy(VkDevice device) mViewSerial = kInvalidImageOrBufferViewSerial; } -angle::Result BufferViewHelper::getView(Context *context, +angle::Result BufferViewHelper::getView(ErrorContext *context, const BufferHelper &buffer, VkDeviceSize bufferOffset, const Format &format, @@ -13013,7 +13017,7 @@ void ShaderProgramHelper::setShader(gl::ShaderType shaderType, const ShaderModul } void ShaderProgramHelper::createMonolithicPipelineCreationTask( - vk::Context *context, + vk::ErrorContext *context, PipelineCacheAccess *pipelineCache, const GraphicsPipelineDesc &desc, const PipelineLayout &pipelineLayout, @@ -13028,7 +13032,7 @@ void ShaderProgramHelper::createMonolithicPipelineCreationTask( } angle::Result ShaderProgramHelper::getOrCreateComputePipeline( - vk::Context *context, + vk::ErrorContext *context, ComputePipelineCache *computePipelines, PipelineCacheAccess *pipelineCache, const PipelineLayout &pipelineLayout, @@ -13219,7 +13223,7 @@ void MetaDescriptorPool::destroy(Renderer *renderer) } angle::Result MetaDescriptorPool::bindCachedDescriptorPool( - Context *context, + ErrorContext *context, const DescriptorSetLayoutDesc &descriptorSetLayoutDesc, uint32_t descriptorCountMultiplier, DescriptorSetLayoutCache *descriptorSetLayoutCache, diff --git a/src/libANGLE/renderer/vulkan/vk_helpers.h b/src/libANGLE/renderer/vulkan/vk_helpers.h index c321e5fd34d..c99d1cde4ce 100644 --- a/src/libANGLE/renderer/vulkan/vk_helpers.h +++ b/src/libANGLE/renderer/vulkan/vk_helpers.h @@ -171,7 +171,7 @@ enum class ImageLayout VkImageCreateFlags GetImageCreateFlags(gl::TextureType textureType); -ImageLayout GetImageLayoutFromGLImageLayout(Context *context, GLenum layout); +ImageLayout GetImageLayoutFromGLImageLayout(ErrorContext *context, GLenum layout); GLenum ConvertImageLayoutToGLImageLayout(ImageLayout imageLayout); @@ -213,13 +213,13 @@ class DynamicBuffer : angle::NonCopyable // internally may trigger a new buffer to be created (which is returned in the optional // parameter `newBufferAllocatedOut`). The new region will be in the returned buffer at given // offset. - angle::Result allocate(Context *context, + angle::Result allocate(ErrorContext *context, size_t sizeInBytes, BufferHelper **bufferHelperOut, bool *newBufferAllocatedOut); // This releases resources when they might currently be in use. - void release(Context *context); + void release(ErrorContext *context); // This adds in-flight buffers to the mResourceUseList in the share group and then releases // them. @@ -250,7 +250,7 @@ class DynamicBuffer : angle::NonCopyable private: void reset(); - angle::Result allocateNewBuffer(Context *context); + angle::Result allocateNewBuffer(ErrorContext *context); VkBufferUsageFlags mUsage; bool mHostVisible; @@ -338,12 +338,12 @@ class DescriptorPoolHelper final : angle::NonCopyable bool valid() { return mDescriptorPool.valid(); } - angle::Result init(Context *context, + angle::Result init(ErrorContext *context, const std::vector &poolSizesIn, uint32_t maxSets); void destroy(VkDevice device); - bool allocateDescriptorSet(Context *context, + bool allocateDescriptorSet(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, const DescriptorPoolPointer &pool, DescriptorSetPointer *descriptorSetOut); @@ -368,7 +368,7 @@ class DescriptorPoolHelper final : angle::NonCopyable bool canDestroy() const { return mValidDescriptorSets == 0 && mPendingGarbageList.empty(); } private: - bool allocateVkDescriptorSet(Context *context, + bool allocateVkDescriptorSet(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, VkDescriptorSet *descriptorSetOut); @@ -405,7 +405,7 @@ class DynamicDescriptorPool final : angle::NonCopyable // The DynamicDescriptorPool only handles one pool size at this time. // Note that setSizes[i].descriptorCount is expected to be the number of descriptors in // an individual set. The pool size will be calculated accordingly. - angle::Result init(Context *context, + angle::Result init(ErrorContext *context, const VkDescriptorPoolSize *setSizes, size_t setSizeCount, const DescriptorSetLayout &descriptorSetLayout); @@ -416,11 +416,11 @@ class DynamicDescriptorPool final : angle::NonCopyable // We use the descriptor type to help count the number of free sets. // By convention, sets are indexed according to the constants in vk_cache_utils.h. - angle::Result allocateDescriptorSet(Context *context, + angle::Result allocateDescriptorSet(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, DescriptorSetPointer *descriptorSetOut); - angle::Result getOrAllocateDescriptorSet(Context *context, + angle::Result getOrAllocateDescriptorSet(ErrorContext *context, uint32_t currentFrame, const DescriptorSetDesc &desc, const DescriptorSetLayout &descriptorSetLayout, @@ -452,8 +452,8 @@ class DynamicDescriptorPool final : angle::NonCopyable static void SetMaxSetsPerPoolMultiplierForTesting(uint32_t maxSetsPerPool); private: - angle::Result allocateNewPool(Context *context); - bool allocateFromExistingPool(Context *context, + angle::Result allocateNewPool(ErrorContext *context); + bool allocateFromExistingPool(ErrorContext *context, const DescriptorSetLayout &descriptorSetLayout, DescriptorSetPointer *descriptorSetOut); bool recycleFromGarbage(Renderer *renderer, DescriptorSetPointer *descriptorSetOut); @@ -499,7 +499,7 @@ class MetaDescriptorPool final : angle::NonCopyable void destroy(Renderer *renderer); - angle::Result bindCachedDescriptorPool(Context *context, + angle::Result bindCachedDescriptorPool(ErrorContext *context, const DescriptorSetLayoutDesc &descriptorSetLayoutDesc, uint32_t descriptorCountMultiplier, DescriptorSetLayoutCache *descriptorSetLayoutCache, @@ -551,7 +551,7 @@ class DynamicallyGrowingPool : angle::NonCopyable bool isValid() { return mPoolSize > 0; } protected: - angle::Result initEntryPool(Context *contextVk, uint32_t poolSize); + angle::Result initEntryPool(ErrorContext *contextVk, uint32_t poolSize); virtual void destroyPoolImpl(VkDevice device, Pool &poolToDestroy) = 0; void destroyEntryPool(VkDevice device); @@ -1008,14 +1008,14 @@ class BufferHelper : public ReadWriteResource BufferHelper(BufferHelper &&other); BufferHelper &operator=(BufferHelper &&other); - angle::Result init(Context *context, + angle::Result init(ErrorContext *context, const VkBufferCreateInfo &createInfo, VkMemoryPropertyFlags memoryPropertyFlags); - angle::Result initExternal(Context *context, + angle::Result initExternal(ErrorContext *context, VkMemoryPropertyFlags memoryProperties, const VkBufferCreateInfo &requestedCreateInfo, GLeglClientBufferEXT clientBuffer); - VkResult initSuballocation(Context *context, + VkResult initSuballocation(ErrorContext *context, uint32_t memoryTypeIndex, size_t size, size_t alignment, @@ -1024,8 +1024,8 @@ class BufferHelper : public ReadWriteResource void destroy(Renderer *renderer); void release(Renderer *renderer); - void release(Context *context); - void releaseBufferAndDescriptorSetCache(Context *context); + void release(ErrorContext *context); + void releaseBufferAndDescriptorSetCache(ErrorContext *context); BufferSerial getBufferSerial() const { return mSerial; } BufferSerial getBlockSerial() const @@ -1055,8 +1055,8 @@ class BufferHelper : public ReadWriteResource bool isCached() const { return mSuballocation.isCached(); } bool isMapped() const { return mSuballocation.isMapped(); } - angle::Result map(Context *context, uint8_t **ptrOut); - angle::Result mapWithOffset(Context *context, uint8_t **ptrOut, size_t offset); + angle::Result map(ErrorContext *context, uint8_t **ptrOut); + angle::Result mapWithOffset(ErrorContext *context, uint8_t **ptrOut, size_t offset); void unmap(Renderer *renderer) {} // After a sequence of writes, call flush to ensure the data is visible to the device. angle::Result flush(Renderer *renderer); @@ -1081,13 +1081,13 @@ class BufferHelper : public ReadWriteResource // Returns true if the image is owned by an external API or instance. bool isReleasedToExternal() const; - void recordReadBarrier(Context *context, + void recordReadBarrier(ErrorContext *context, VkAccessFlags readAccessType, VkPipelineStageFlags readStage, PipelineStage stageIndex, PipelineBarrierArray *pipelineBarriers); - void recordWriteBarrier(Context *context, + void recordWriteBarrier(ErrorContext *context, VkAccessFlags writeAccessType, VkPipelineStageFlags writeStage, PipelineStage stageIndex, @@ -1110,7 +1110,7 @@ class BufferHelper : public ReadWriteResource mDescriptorSetCacheManager.addKey(sharedCacheKey); } - angle::Result initializeNonZeroMemory(Context *context, + angle::Result initializeNonZeroMemory(ErrorContext *context, VkBufferUsageFlags usage, VkDeviceSize size); @@ -1121,7 +1121,7 @@ class BufferHelper : public ReadWriteResource // Returns true if mBufferWithUserSize is released. bool onBufferUserSizeChange(Renderer *renderer); - void initializeBarrierTracker(Context *context); + void initializeBarrierTracker(ErrorContext *context); // Returns the current VkAccessFlags bits VkAccessFlags getCurrentWriteAccess() const { return mCurrentWriteAccess; } @@ -1176,7 +1176,7 @@ class BufferPool : angle::NonCopyable uint32_t memoryTypeIndex, VkMemoryPropertyFlags memoryProperty); - VkResult allocateBuffer(Context *context, + VkResult allocateBuffer(ErrorContext *context, VkDeviceSize sizeInBytes, VkDeviceSize alignment, BufferSuballocation *suballocation); @@ -1194,7 +1194,7 @@ class BufferPool : angle::NonCopyable VkDeviceSize getMemorySize() const { return mTotalMemorySize; } private: - VkResult allocateNewBuffer(Context *context, VkDeviceSize sizeInBytes); + VkResult allocateNewBuffer(ErrorContext *context, VkDeviceSize sizeInBytes); VkDeviceSize getTotalEmptyMemorySize() const; vma::VirtualBlockCreateFlags mVirtualBlockCreateFlags; @@ -1262,7 +1262,7 @@ class RenderPassAttachment final bool isAttachmentEnabled, uint32_t currentCmdCount); void onRenderAreaGrowth(ContextVk *contextVk, const gl::Rectangle &newRenderArea); - void finalizeLoadStore(Context *context, + void finalizeLoadStore(ErrorContext *context, uint32_t currentCmdCount, bool hasUnresolveAttachment, bool hasResolveAttachment, @@ -1399,22 +1399,22 @@ constexpr uint32_t kInfiniteCmdCount = 0xFFFFFFFF; class CommandBufferHelperCommon : angle::NonCopyable { public: - void bufferWrite(Context *context, + void bufferWrite(ErrorContext *context, VkAccessFlags writeAccessType, PipelineStage writeStage, BufferHelper *buffer); - void bufferWrite(Context *context, + void bufferWrite(ErrorContext *context, VkAccessFlags writeAccessType, const gl::ShaderBitSet &writeShaderStages, BufferHelper *buffer); - void bufferRead(Context *context, + void bufferRead(ErrorContext *context, VkAccessFlags readAccessType, PipelineStage readStage, BufferHelper *buffer); - void bufferRead(Context *context, + void bufferRead(ErrorContext *context, VkAccessFlags readAccessType, const gl::ShaderBitSet &readShaderStages, BufferHelper *buffer); @@ -1460,7 +1460,7 @@ class CommandBufferHelperCommon : angle::NonCopyable // Update image with this command buffer's queueSerial. If VkEvent is enabled, image's current // event is also updated with this command's event. - void retainImageWithEvent(Context *context, ImageHelper *image); + void retainImageWithEvent(ErrorContext *context, ImageHelper *image); // Returns true if event already existed in this command buffer. bool hasSetEventPendingFlush(const RefCountedEvent &event) const @@ -1471,7 +1471,7 @@ class CommandBufferHelperCommon : angle::NonCopyable // Issue VkCmdSetEvent call for events in this command buffer. template - void flushSetEventsImpl(Context *context, CommandBufferT *commandBuffer); + void flushSetEventsImpl(ErrorContext *context, CommandBufferT *commandBuffer); const QueueSerial &getQueueSerial() const { return mQueueSerial; } @@ -1488,12 +1488,13 @@ class CommandBufferHelperCommon : angle::NonCopyable void initializeImpl(); - void resetImpl(Context *context); + void resetImpl(ErrorContext *context); template - angle::Result attachCommandPoolImpl(Context *context, SecondaryCommandPool *commandPool); + angle::Result attachCommandPoolImpl(ErrorContext *context, SecondaryCommandPool *commandPool); template - angle::Result detachCommandPoolImpl(Context *context, SecondaryCommandPool **commandPoolOut); + angle::Result detachCommandPoolImpl(ErrorContext *context, + SecondaryCommandPool **commandPoolOut); template void releaseCommandPoolImpl(); @@ -1505,25 +1506,25 @@ class CommandBufferHelperCommon : angle::NonCopyable template void assertCanBeRecycledImpl(); - void bufferWriteImpl(Context *context, + void bufferWriteImpl(ErrorContext *context, VkAccessFlags writeAccessType, VkPipelineStageFlags writePipelineStageFlags, PipelineStage writeStage, BufferHelper *buffer); - void bufferReadImpl(Context *context, + void bufferReadImpl(ErrorContext *context, VkAccessFlags readAccessType, VkPipelineStageFlags readPipelineStageFlags, PipelineStage readStage, BufferHelper *buffer); - void imageReadImpl(Context *context, + void imageReadImpl(ErrorContext *context, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, BarrierType barrierType, ImageHelper *image); - void imageWriteImpl(Context *context, + void imageWriteImpl(ErrorContext *context, gl::LevelIndex level, uint32_t layerStart, uint32_t layerCount, @@ -1532,7 +1533,7 @@ class CommandBufferHelperCommon : angle::NonCopyable BarrierType barrierType, ImageHelper *image); - void updateImageLayoutAndBarrier(Context *context, + void updateImageLayoutAndBarrier(ErrorContext *context, ImageHelper *image, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, @@ -1583,9 +1584,10 @@ class OutsideRenderPassCommandBufferHelper final : public CommandBufferHelperCom OutsideRenderPassCommandBufferHelper(); ~OutsideRenderPassCommandBufferHelper(); - angle::Result initialize(Context *context); + angle::Result initialize(ErrorContext *context); - angle::Result reset(Context *context, SecondaryCommandBufferCollector *commandBufferCollector); + angle::Result reset(ErrorContext *context, + SecondaryCommandBufferCollector *commandBufferCollector); static constexpr bool ExecutesInline() { @@ -1596,8 +1598,8 @@ class OutsideRenderPassCommandBufferHelper final : public CommandBufferHelperCom bool empty() const { return mCommandBuffer.empty(); } - angle::Result attachCommandPool(Context *context, SecondaryCommandPool *commandPool); - angle::Result detachCommandPool(Context *context, SecondaryCommandPool **commandPoolOut); + angle::Result attachCommandPool(ErrorContext *context, SecondaryCommandPool *commandPool); + angle::Result detachCommandPool(ErrorContext *context, SecondaryCommandPool **commandPoolOut); void releaseCommandPool(); void attachAllocator(SecondaryCommandMemoryAllocator *allocator); @@ -1610,12 +1612,12 @@ class OutsideRenderPassCommandBufferHelper final : public CommandBufferHelperCom void markClosed() { mCommandBuffer.close(); } #endif - void imageRead(Context *context, + void imageRead(ErrorContext *context, VkImageAspectFlags aspectFlags, ImageLayout imageLayout, ImageHelper *image); - void imageWrite(Context *context, + void imageWrite(ErrorContext *context, gl::LevelIndex level, uint32_t layerStart, uint32_t layerCount, @@ -1627,17 +1629,17 @@ class OutsideRenderPassCommandBufferHelper final : public CommandBufferHelperCom void retainImage(ImageHelper *image); // Call SetEvent and have image's current event pointing to it. - void trackImageWithEvent(Context *context, ImageHelper *image); + void trackImageWithEvent(ErrorContext *context, ImageHelper *image); // Issues SetEvent calls to the command buffer. - void flushSetEvents(Context *context) { flushSetEventsImpl(context, &mCommandBuffer); } + void flushSetEvents(ErrorContext *context) { flushSetEventsImpl(context, &mCommandBuffer); } // Clean up event garbage. Note that ImageHelper object may still holding reference count to it, // so the event itself will not gets destroyed until the last refCount goes away. void collectRefCountedEventsGarbage(RefCountedEventsGarbageRecycler *garbageRecycler); RefCountedEventCollector *getRefCountedEventCollector() { return &mRefCountedEventCollector; } - angle::Result flushToPrimary(Context *context, CommandsState *commandsState); + angle::Result flushToPrimary(ErrorContext *context, CommandsState *commandsState); void setGLMemoryBarrierIssued() { @@ -1655,8 +1657,8 @@ class OutsideRenderPassCommandBufferHelper final : public CommandBufferHelperCom } private: - angle::Result initializeCommandBuffer(Context *context); - angle::Result endCommandBuffer(Context *context); + angle::Result initializeCommandBuffer(ErrorContext *context); + angle::Result endCommandBuffer(ErrorContext *context); OutsideRenderPassCommandBuffer mCommandBuffer; bool mIsCommandBufferEnded = false; @@ -1703,7 +1705,7 @@ class RenderPassFramebuffer : angle::NonCopyable void reset(); - void setFramebuffer(Context *context, + void setFramebuffer(ErrorContext *context, Framebuffer &&initialFramebuffer, FramebufferAttachmentsVector &&imageViews, uint32_t width, @@ -1754,7 +1756,7 @@ class RenderPassFramebuffer : angle::NonCopyable // Prepare for rendering by creating a new framebuffer because the initial framebuffer is not // valid (due to added resolve attachments). This is called when the render pass is finalized. - angle::Result packResolveViewsAndCreateFramebuffer(Context *context, + angle::Result packResolveViewsAndCreateFramebuffer(ErrorContext *context, const RenderPass &renderPass, Framebuffer *framebufferOut); @@ -1818,9 +1820,10 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon RenderPassCommandBufferHelper(); ~RenderPassCommandBufferHelper(); - angle::Result initialize(Context *context); + angle::Result initialize(ErrorContext *context); - angle::Result reset(Context *context, SecondaryCommandBufferCollector *commandBufferCollector); + angle::Result reset(ErrorContext *context, + SecondaryCommandBufferCollector *commandBufferCollector); static constexpr bool ExecutesInline() { return RenderPassCommandBuffer::ExecutesInline(); } @@ -1831,7 +1834,7 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon bool empty() const { return mCommandBuffers[0].empty(); } - angle::Result attachCommandPool(Context *context, SecondaryCommandPool *commandPool); + angle::Result attachCommandPool(ErrorContext *context, SecondaryCommandPool *commandPool); void detachCommandPool(SecondaryCommandPool **commandPoolOut); void releaseCommandPool(); @@ -1876,7 +1879,7 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon bool usesImage(const ImageHelper &image) const; bool startedAndUsesImageWithBarrier(const ImageHelper &image) const; - angle::Result flushToPrimary(Context *context, + angle::Result flushToPrimary(ErrorContext *context, CommandsState *commandsState, const RenderPass &renderPass, VkFramebuffer framebufferOverride); @@ -1884,7 +1887,7 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon bool started() const { return mRenderPassStarted; } // Finalize the layout if image has any deferred layout transition. - void finalizeImageLayout(Context *context, + void finalizeImageLayout(ErrorContext *context, const ImageHelper *image, UniqueSerial imageSiblingSerial); @@ -2013,7 +2016,7 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon void collectRefCountedEventsGarbage(RefCountedEventsGarbageRecycler *garbageRecycler); - void updatePerfCountersForDynamicRenderingInstance(Context *context, + void updatePerfCountersForDynamicRenderingInstance(ErrorContext *context, angle::VulkanPerfCounters *countersOut); bool isDefault() const { return mFramebuffer.isDefault(); } @@ -2021,7 +2024,7 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon private: uint32_t getSubpassCommandBufferCount() const { return mCurrentSubpassCommandBufferIndex + 1; } - angle::Result initializeCommandBuffer(Context *context); + angle::Result initializeCommandBuffer(ErrorContext *context); angle::Result beginRenderPassCommandBuffer(ContextVk *contextVk); angle::Result endRenderPassCommandBuffer(ContextVk *contextVk); @@ -2040,21 +2043,22 @@ class RenderPassCommandBufferHelper final : public CommandBufferHelperCommon // We can't determine the image layout at the renderpass start time since their full usage // aren't known until later time. We finalize the layout when either ImageHelper object is // released or when renderpass ends. - void finalizeColorImageLayout(Context *context, + void finalizeColorImageLayout(ErrorContext *context, ImageHelper *image, PackedAttachmentIndex packedAttachmentIndex, bool isResolveImage); - void finalizeColorImageLoadStore(Context *context, PackedAttachmentIndex packedAttachmentIndex); - void finalizeDepthStencilImageLayout(Context *context); - void finalizeDepthStencilResolveImageLayout(Context *context); - void finalizeDepthStencilLoadStore(Context *context); + void finalizeColorImageLoadStore(ErrorContext *context, + PackedAttachmentIndex packedAttachmentIndex); + void finalizeDepthStencilImageLayout(ErrorContext *context); + void finalizeDepthStencilResolveImageLayout(ErrorContext *context); + void finalizeDepthStencilLoadStore(ErrorContext *context); - void finalizeColorImageLayoutAndLoadStore(Context *context, + void finalizeColorImageLayoutAndLoadStore(ErrorContext *context, PackedAttachmentIndex packedAttachmentIndex); - void finalizeDepthStencilImageLayoutAndLoadStore(Context *context); - void finalizeFragmentShadingRateImageLayout(Context *context); + void finalizeDepthStencilImageLayoutAndLoadStore(ErrorContext *context); + void finalizeFragmentShadingRateImageLayout(ErrorContext *context); - void executeSetEvents(Context *context, PrimaryCommandBuffer *primary); + void executeSetEvents(ErrorContext *context, PrimaryCommandBuffer *primary); // When using Vulkan secondary command buffers, each subpass must be recorded in a separate // command buffer. Currently ANGLE produces render passes with at most 2 subpasses. @@ -2119,7 +2123,7 @@ class CommandBufferRecycler void onDestroy(); - angle::Result getCommandBufferHelper(Context *context, + angle::Result getCommandBufferHelper(ErrorContext *context, SecondaryCommandPool *commandPool, SecondaryCommandMemoryAllocator *commandsAllocator, CommandBufferHelperT **commandBufferHelperOut); @@ -2182,7 +2186,7 @@ class ImageHelper final : public Resource, public angle::Subject ImageHelper(); ~ImageHelper() override; - angle::Result init(Context *context, + angle::Result init(ErrorContext *context, gl::TextureType textureType, const VkExtent3D &extents, const Format &format, @@ -2193,13 +2197,13 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerCount, bool isRobustResourceInitEnabled, bool hasProtectedContent); - angle::Result initFromCreateInfo(Context *context, + angle::Result initFromCreateInfo(ErrorContext *context, const VkImageCreateInfo &requestedCreateInfo, VkMemoryPropertyFlags memoryPropertyFlags); - angle::Result copyToBufferOneOff(Context *context, + angle::Result copyToBufferOneOff(ErrorContext *context, BufferHelper *stagingBuffer, VkBufferImageCopy copyRegion); - angle::Result initMSAASwapchain(Context *context, + angle::Result initMSAASwapchain(ErrorContext *context, gl::TextureType textureType, const VkExtent3D &extents, bool rotatedAspectRatio, @@ -2211,7 +2215,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerCount, bool isRobustResourceInitEnabled, bool hasProtectedContent); - angle::Result initExternal(Context *context, + angle::Result initExternal(ErrorContext *context, gl::TextureType textureType, const VkExtent3D &extents, angle::FormatID intendedFormatID, @@ -2228,7 +2232,7 @@ class ImageHelper final : public Resource, public angle::Subject bool hasProtectedContent, YcbcrConversionDesc conversionDesc, const void *compressionControl); - VkResult initMemory(Context *context, + VkResult initMemory(ErrorContext *context, const MemoryProperties &memoryProperties, VkMemoryPropertyFlags flags, VkMemoryPropertyFlags excludedFlags, @@ -2237,12 +2241,12 @@ class ImageHelper final : public Resource, public angle::Subject MemoryAllocationType allocationType, VkMemoryPropertyFlags *flagsOut, VkDeviceSize *sizeOut); - angle::Result initMemoryAndNonZeroFillIfNeeded(Context *context, + angle::Result initMemoryAndNonZeroFillIfNeeded(ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, VkMemoryPropertyFlags flags, MemoryAllocationType allocationType); - angle::Result initExternalMemory(Context *context, + angle::Result initExternalMemory(ErrorContext *context, const MemoryProperties &memoryProperties, const VkMemoryRequirements &memoryRequirements, uint32_t extraAllocationInfoCount, @@ -2251,7 +2255,7 @@ class ImageHelper final : public Resource, public angle::Subject VkMemoryPropertyFlags flags); static constexpr VkImageUsageFlags kDefaultImageViewUsageFlags = 0; - angle::Result initLayerImageView(Context *context, + angle::Result initLayerImageView(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -2260,7 +2264,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t levelCount, uint32_t baseArrayLayer, uint32_t layerCount) const; - angle::Result initLayerImageViewWithUsage(Context *context, + angle::Result initLayerImageViewWithUsage(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -2270,7 +2274,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t baseArrayLayer, uint32_t layerCount, VkImageUsageFlags imageUsageFlags) const; - angle::Result initLayerImageViewWithYuvModeOverride(Context *context, + angle::Result initLayerImageViewWithYuvModeOverride(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -2281,7 +2285,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerCount, gl::YuvSamplingMode yuvSamplingMode, VkImageUsageFlags imageUsageFlags) const; - angle::Result initReinterpretedLayerImageView(Context *context, + angle::Result initReinterpretedLayerImageView(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -2297,7 +2301,7 @@ class ImageHelper final : public Resource, public angle::Subject // - TextureVk::copySubImageImplWithDraw // - FramebufferVk::readPixelsImpl // - angle::Result init2DStaging(Context *context, + angle::Result init2DStaging(ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, const gl::Extents &glExtents, @@ -2309,7 +2313,7 @@ class ImageHelper final : public Resource, public angle::Subject // // - TextureVk::copyAndStageImageData // - angle::Result initStaging(Context *context, + angle::Result initStaging(ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, VkImageType imageType, @@ -2322,7 +2326,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerCount); // Create a multisampled image for use as the implicit image in multisampled render to texture // rendering. If LAZILY_ALLOCATED memory is available, it will prefer that. - angle::Result initImplicitMultisampledRenderToTexture(Context *context, + angle::Result initImplicitMultisampledRenderToTexture(ErrorContext *context, bool hasProtectedContent, const MemoryProperties &memoryProperties, gl::TextureType textureType, @@ -2338,7 +2342,7 @@ class ImageHelper final : public Resource, public angle::Subject static constexpr uint32_t kImageListFormatCount = 2; using ImageListFormats = std::array; static const void *DeriveCreateInfoPNext( - Context *context, + ErrorContext *context, angle::FormatID actualFormatID, const void *pNext, VkImageFormatListCreateInfoKHR *imageFormatListInfoStorage, @@ -2392,7 +2396,7 @@ class ImageHelper final : public Resource, public angle::Subject void destroy(Renderer *renderer); void release(Renderer *renderer) { releaseImage(renderer); } - void init2DWeakReference(Context *context, + void init2DWeakReference(ErrorContext *context, VkImage handle, const gl::Extents &glExtents, bool rotatedAspectRatio, @@ -2530,7 +2534,7 @@ class ImageHelper final : public Resource, public angle::Subject void removeSingleStagedClearAfterInvalidate(gl::LevelIndex levelIndexGL, uint32_t layerIndex, uint32_t layerCount); - void removeStagedUpdates(Context *context, + void removeStagedUpdates(ErrorContext *context, gl::LevelIndex levelGLStart, gl::LevelIndex levelGLEnd); @@ -2668,7 +2672,7 @@ class ImageHelper final : public Resource, public angle::Subject bool removeStagedClearUpdatesAndReturnColor(gl::LevelIndex levelGL, const VkClearColorValue **color); - void recordWriteBarrier(Context *context, + void recordWriteBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, gl::LevelIndex levelStart, @@ -2677,7 +2681,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerCount, OutsideRenderPassCommandBufferHelper *commands); - void recordReadSubresourceBarrier(Context *context, + void recordReadSubresourceBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, gl::LevelIndex levelStart, @@ -2686,7 +2690,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerCount, OutsideRenderPassCommandBufferHelper *commands); - void recordWriteBarrierOneOff(Context *context, + void recordWriteBarrierOneOff(ErrorContext *context, ImageLayout newLayout, PrimaryCommandBuffer *commandBuffer, VkSemaphore *acquireNextImageSemaphoreOut) @@ -2713,7 +2717,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t layerStart, uint32_t layerCount) const; - void recordReadBarrier(Context *context, + void recordReadBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, OutsideRenderPassCommandBufferHelper *commands); @@ -2723,14 +2727,14 @@ class ImageHelper final : public Resource, public angle::Subject return mCurrentDeviceQueueIndex.familyIndex() != newDeviceQueueIndex.familyIndex(); } - void changeLayoutAndQueue(Context *context, + void changeLayoutAndQueue(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, DeviceQueueIndex newDeviceQueueIndex, OutsideRenderPassCommandBuffer *commandBuffer); // Returns true if barrier has been generated - void updateLayoutAndBarrier(Context *context, + void updateLayoutAndBarrier(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, BarrierType barrierType, @@ -2741,14 +2745,14 @@ class ImageHelper final : public Resource, public angle::Subject VkSemaphore *semaphoreOut); // Performs an ownership transfer from an external instance or API. - void acquireFromExternal(Context *context, + void acquireFromExternal(ErrorContext *context, DeviceQueueIndex externalQueueIndex, DeviceQueueIndex newDeviceQueueIndex, ImageLayout currentLayout, OutsideRenderPassCommandBuffer *commandBuffer); // Performs an ownership transfer to an external instance or API. - void releaseToExternal(Context *context, + void releaseToExternal(ErrorContext *context, DeviceQueueIndex externalQueueIndex, ImageLayout desiredLayout, OutsideRenderPassCommandBuffer *commandBuffer); @@ -2865,7 +2869,7 @@ class ImageHelper final : public Resource, public angle::Subject return y2yDesc; } - static YcbcrConversionDesc deriveConversionDesc(Context *context, + static YcbcrConversionDesc deriveConversionDesc(ErrorContext *context, angle::FormatID actualFormatID, angle::FormatID intendedFormatID); @@ -2911,7 +2915,7 @@ class ImageHelper final : public Resource, public angle::Subject return mMemoryAllocationType == MemoryAllocationType::ImageExternal; } - angle::Result initializeNonZeroMemory(Context *context, + angle::Result initializeNonZeroMemory(ErrorContext *context, bool hasProtectedContent, VkMemoryPropertyFlags flags, VkDeviceSize size); @@ -2919,8 +2923,8 @@ class ImageHelper final : public Resource, public angle::Subject size_t getLevelUpdateCount(gl::LevelIndex level) const; // Create event if needed and record the event in ImageHelper::mCurrentEvent. - void setCurrentRefCountedEvent(Context *context, EventMaps &eventMaps); - void releaseCurrentRefCountedEvent(Context *context) + void setCurrentRefCountedEvent(ErrorContext *context, EventMaps &eventMaps); + void releaseCurrentRefCountedEvent(ErrorContext *context) { // This will also force next barrier use pipelineBarrier mCurrentEvent.release(context); @@ -3068,7 +3072,7 @@ class ImageHelper final : public Resource, public angle::Subject // Generalized to accept both "primary" and "secondary" command buffers. template - void barrierImpl(Context *context, + void barrierImpl(ErrorContext *context, VkImageAspectFlags aspectMask, ImageLayout newLayout, DeviceQueueIndex newDeviceQueueIndex, @@ -3127,7 +3131,7 @@ class ImageHelper final : public Resource, public angle::Subject uint32_t baseArrayLayer, uint32_t layerCount); - angle::Result updateSubresourceOnHost(Context *context, + angle::Result updateSubresourceOnHost(ErrorContext *context, ApplyImageUpdate applyUpdate, const gl::ImageIndex &index, const gl::Extents &glExtents, @@ -3210,7 +3214,7 @@ class ImageHelper final : public Resource, public angle::Subject const LevelContentDefinedMask &getLevelContentDefined(LevelIndex level) const; const LevelContentDefinedMask &getLevelStencilContentDefined(LevelIndex level) const; - angle::Result initLayerImageViewImpl(Context *context, + angle::Result initLayerImageViewImpl(ErrorContext *context, gl::TextureType textureType, VkImageAspectFlags aspectMask, const gl::SwizzleState &swizzleMap, @@ -3515,7 +3519,7 @@ class ImageViewHelper final : angle::NonCopyable VkImageUsageFlags imageUsageFlags); // Creates a storage view with all layers of the level. - angle::Result getLevelStorageImageView(Context *context, + angle::Result getLevelStorageImageView(ErrorContext *context, gl::TextureType viewType, const ImageHelper &image, LevelIndex levelVk, @@ -3525,7 +3529,7 @@ class ImageViewHelper final : angle::NonCopyable const ImageView **imageViewOut); // Creates a storage view with a single layer of the level. - angle::Result getLevelLayerStorageImageView(Context *context, + angle::Result getLevelLayerStorageImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -3534,7 +3538,7 @@ class ImageViewHelper final : angle::NonCopyable const ImageView **imageViewOut); // Creates a draw view with a range of layers of the level. - angle::Result getLevelDrawImageView(Context *context, + angle::Result getLevelDrawImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -3542,14 +3546,14 @@ class ImageViewHelper final : angle::NonCopyable const ImageView **imageViewOut); // Creates a draw view with a single layer of the level. - angle::Result getLevelLayerDrawImageView(Context *context, + angle::Result getLevelLayerDrawImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, const ImageView **imageViewOut); // Creates a depth-xor-stencil view with a range of layers of the level. - angle::Result getLevelDepthOrStencilImageView(Context *context, + angle::Result getLevelDepthOrStencilImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -3558,7 +3562,7 @@ class ImageViewHelper final : angle::NonCopyable const ImageView **imageViewOut); // Creates a depth-xor-stencil view with a single layer of the level. - angle::Result getLevelLayerDepthOrStencilImageView(Context *context, + angle::Result getLevelLayerDepthOrStencilImageView(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -3700,13 +3704,13 @@ class ImageViewHelper final : angle::NonCopyable return imageViewVector[mCurrentBaseMaxLevelHash]; } - angle::Result getLevelLayerDrawImageViewImpl(Context *context, + angle::Result getLevelLayerDrawImageViewImpl(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, uint32_t layerCount, ImageView *imageViewOut); - angle::Result getLevelLayerDepthOrStencilImageViewImpl(Context *context, + angle::Result getLevelLayerDepthOrStencilImageViewImpl(ErrorContext *context, const ImageHelper &image, LevelIndex levelVk, uint32_t layer, @@ -3799,7 +3803,7 @@ class BufferViewHelper final : public Resource void release(Renderer *renderer); void destroy(VkDevice device); - angle::Result getView(Context *context, + angle::Result getView(ErrorContext *context, const BufferHelper &buffer, VkDeviceSize bufferOffset, const Format &format, @@ -3866,7 +3870,7 @@ class ShaderProgramHelper : angle::NonCopyable // exists in cache. template ANGLE_INLINE angle::Result createGraphicsPipeline( - vk::Context *context, + vk::ErrorContext *context, GraphicsPipelineCache *graphicsPipelines, PipelineCacheAccess *pipelineCache, const RenderPass &compatibleRenderPass, @@ -3882,14 +3886,14 @@ class ShaderProgramHelper : angle::NonCopyable pipelineDesc, descPtrOut, pipelineOut); } - void createMonolithicPipelineCreationTask(vk::Context *context, + void createMonolithicPipelineCreationTask(vk::ErrorContext *context, PipelineCacheAccess *pipelineCache, const GraphicsPipelineDesc &desc, const PipelineLayout &pipelineLayout, const SpecializationConstants &specConsts, PipelineHelper *pipeline) const; - angle::Result getOrCreateComputePipeline(vk::Context *context, + angle::Result getOrCreateComputePipeline(vk::ErrorContext *context, ComputePipelineCache *computePipelines, PipelineCacheAccess *pipelineCache, const PipelineLayout &pipelineLayout, diff --git a/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp b/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp index faac90aaaf5..ad106ebb178 100644 --- a/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp +++ b/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.cpp @@ -370,7 +370,7 @@ constexpr CompressedShaderBlob kOverlayDraw_vert_shaders[] = { {kOverlayDraw_vert_00000000, sizeof(kOverlayDraw_vert_00000000)}, }; -angle::Result GetShader(Context *context, +angle::Result GetShader(ErrorContext *context, ShaderModulePtr shaders[], const CompressedShaderBlob *compressedShaderBlobs, size_t shadersCount, @@ -423,7 +423,7 @@ void ShaderLibrary::destroy(VkDevice device) { } -angle::Result ShaderLibrary::getBlit3DSrc_frag(Context *context, +angle::Result ShaderLibrary::getBlit3DSrc_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -431,7 +431,7 @@ angle::Result ShaderLibrary::getBlit3DSrc_frag(Context *context, ArraySize(kBlit3DSrc_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getBlitResolve_frag(Context *context, +angle::Result ShaderLibrary::getBlitResolve_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -439,7 +439,7 @@ angle::Result ShaderLibrary::getBlitResolve_frag(Context *context, ArraySize(kBlitResolve_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getBlitResolveStencilNoExport_comp(Context *context, +angle::Result ShaderLibrary::getBlitResolveStencilNoExport_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -448,7 +448,7 @@ angle::Result ShaderLibrary::getBlitResolveStencilNoExport_comp(Context *context ArraySize(kBlitResolveStencilNoExport_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getConvertIndex_comp(Context *context, +angle::Result ShaderLibrary::getConvertIndex_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -456,7 +456,7 @@ angle::Result ShaderLibrary::getConvertIndex_comp(Context *context, ArraySize(kConvertIndex_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getConvertIndexIndirectLineLoop_comp(Context *context, +angle::Result ShaderLibrary::getConvertIndexIndirectLineLoop_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -465,7 +465,7 @@ angle::Result ShaderLibrary::getConvertIndexIndirectLineLoop_comp(Context *conte ArraySize(kConvertIndexIndirectLineLoop_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getConvertIndirectLineLoop_comp(Context *context, +angle::Result ShaderLibrary::getConvertIndirectLineLoop_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -474,7 +474,7 @@ angle::Result ShaderLibrary::getConvertIndirectLineLoop_comp(Context *context, ArraySize(kConvertIndirectLineLoop_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getConvertVertex_comp(Context *context, +angle::Result ShaderLibrary::getConvertVertex_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -482,7 +482,7 @@ angle::Result ShaderLibrary::getConvertVertex_comp(Context *context, ArraySize(kConvertVertex_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getCopyImageToBuffer_comp(Context *context, +angle::Result ShaderLibrary::getCopyImageToBuffer_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -490,7 +490,7 @@ angle::Result ShaderLibrary::getCopyImageToBuffer_comp(Context *context, ArraySize(kCopyImageToBuffer_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getEtcToBc_comp(Context *context, +angle::Result ShaderLibrary::getEtcToBc_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -498,7 +498,7 @@ angle::Result ShaderLibrary::getEtcToBc_comp(Context *context, ArraySize(kEtcToBc_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getExportStencil_frag(Context *context, +angle::Result ShaderLibrary::getExportStencil_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -506,7 +506,7 @@ angle::Result ShaderLibrary::getExportStencil_frag(Context *context, ArraySize(kExportStencil_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getFullScreenTri_vert(Context *context, +angle::Result ShaderLibrary::getFullScreenTri_vert(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -514,7 +514,7 @@ angle::Result ShaderLibrary::getFullScreenTri_vert(Context *context, ArraySize(kFullScreenTri_vert_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getGenerateFragmentShadingRate_comp(Context *context, +angle::Result ShaderLibrary::getGenerateFragmentShadingRate_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -523,7 +523,7 @@ angle::Result ShaderLibrary::getGenerateFragmentShadingRate_comp(Context *contex ArraySize(kGenerateFragmentShadingRate_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getGenerateMipmap_comp(Context *context, +angle::Result ShaderLibrary::getGenerateMipmap_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -531,7 +531,7 @@ angle::Result ShaderLibrary::getGenerateMipmap_comp(Context *context, ArraySize(kGenerateMipmap_comp_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getImageClear_frag(Context *context, +angle::Result ShaderLibrary::getImageClear_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -539,7 +539,7 @@ angle::Result ShaderLibrary::getImageClear_frag(Context *context, ArraySize(kImageClear_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getImageCopy_frag(Context *context, +angle::Result ShaderLibrary::getImageCopy_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -547,7 +547,7 @@ angle::Result ShaderLibrary::getImageCopy_frag(Context *context, ArraySize(kImageCopy_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getImageCopyFloat_frag(Context *context, +angle::Result ShaderLibrary::getImageCopyFloat_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -555,7 +555,7 @@ angle::Result ShaderLibrary::getImageCopyFloat_frag(Context *context, ArraySize(kImageCopyFloat_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getOverlayDraw_frag(Context *context, +angle::Result ShaderLibrary::getOverlayDraw_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { @@ -563,7 +563,7 @@ angle::Result ShaderLibrary::getOverlayDraw_frag(Context *context, ArraySize(kOverlayDraw_frag_shaders), shaderFlags, shaderOut); } -angle::Result ShaderLibrary::getOverlayDraw_vert(Context *context, +angle::Result ShaderLibrary::getOverlayDraw_vert(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut) { diff --git a/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h b/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h index 6053cf07da4..0db110cb2d7 100644 --- a/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h +++ b/src/libANGLE/renderer/vulkan/vk_internal_shaders_autogen.h @@ -237,58 +237,58 @@ class ShaderLibrary final : angle::NonCopyable void destroy(VkDevice device); - angle::Result getBlit3DSrc_frag(Context *context, + angle::Result getBlit3DSrc_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getBlitResolve_frag(Context *context, + angle::Result getBlitResolve_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getBlitResolveStencilNoExport_comp(Context *context, + angle::Result getBlitResolveStencilNoExport_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getConvertIndex_comp(Context *context, + angle::Result getConvertIndex_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getConvertIndexIndirectLineLoop_comp(Context *context, + angle::Result getConvertIndexIndirectLineLoop_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getConvertIndirectLineLoop_comp(Context *context, + angle::Result getConvertIndirectLineLoop_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getConvertVertex_comp(Context *context, + angle::Result getConvertVertex_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getCopyImageToBuffer_comp(Context *context, + angle::Result getCopyImageToBuffer_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getEtcToBc_comp(Context *context, + angle::Result getEtcToBc_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getExportStencil_frag(Context *context, + angle::Result getExportStencil_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getFullScreenTri_vert(Context *context, + angle::Result getFullScreenTri_vert(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getGenerateFragmentShadingRate_comp(Context *context, + angle::Result getGenerateFragmentShadingRate_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getGenerateMipmap_comp(Context *context, + angle::Result getGenerateMipmap_comp(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getImageClear_frag(Context *context, + angle::Result getImageClear_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getImageCopy_frag(Context *context, + angle::Result getImageCopy_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getImageCopyFloat_frag(Context *context, + angle::Result getImageCopyFloat_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getOverlayDraw_frag(Context *context, + angle::Result getOverlayDraw_frag(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); - angle::Result getOverlayDraw_vert(Context *context, + angle::Result getOverlayDraw_vert(ErrorContext *context, uint32_t shaderFlags, ShaderModulePtr *shaderOut); diff --git a/src/libANGLE/renderer/vulkan/vk_ref_counted_event.cpp b/src/libANGLE/renderer/vulkan/vk_ref_counted_event.cpp index 23c189bcdaf..37affbd358c 100644 --- a/src/libANGLE/renderer/vulkan/vk_ref_counted_event.cpp +++ b/src/libANGLE/renderer/vulkan/vk_ref_counted_event.cpp @@ -65,7 +65,7 @@ void InitializeEventAndPipelineStagesMap( } } -bool RefCountedEvent::init(Context *context, EventStage eventStage) +bool RefCountedEvent::init(ErrorContext *context, EventStage eventStage) { ASSERT(mHandle == nullptr); ASSERT(eventStage != EventStage::InvalidEnum); @@ -112,7 +112,7 @@ bool RefCountedEvent::init(Context *context, EventStage eventStage) return true; } -void RefCountedEvent::release(Context *context) +void RefCountedEvent::release(ErrorContext *context) { if (mHandle != nullptr) { @@ -219,7 +219,7 @@ void RefCountedEventRecycler::destroy(VkDevice device) } } -void RefCountedEventRecycler::resetEvents(Context *context, +void RefCountedEventRecycler::resetEvents(ErrorContext *context, const QueueSerial queueSerial, PrimaryCommandBuffer *commandbuffer) { diff --git a/src/libANGLE/renderer/vulkan/vk_ref_counted_event.h b/src/libANGLE/renderer/vulkan/vk_ref_counted_event.h index 26b1a5da23a..b76757c2999 100644 --- a/src/libANGLE/renderer/vulkan/vk_ref_counted_event.h +++ b/src/libANGLE/renderer/vulkan/vk_ref_counted_event.h @@ -194,7 +194,7 @@ class RefCountedEvent final // Create VkEvent and associated it with given layout. Returns true if success and false if // failed. - bool init(Context *context, EventStage eventStage); + bool init(ErrorContext *context, EventStage eventStage); // Release one reference count to the underline Event object and destroy or recycle the handle // to renderer's recycler if this is the very last reference. @@ -202,7 +202,7 @@ class RefCountedEvent final // Release one reference count to the underline Event object and destroy or recycle the handle // to the context share group's recycler if this is the very last reference. - void release(Context *context); + void release(ErrorContext *context); // Destroy the event and mHandle. Caller must ensure there is no outstanding reference to the // mHandle. @@ -340,7 +340,7 @@ class RefCountedEventRecycler final } // Reset all events in the toReset list and move them to the toReuse list - void resetEvents(Context *context, + void resetEvents(ErrorContext *context, const QueueSerial queueSerial, PrimaryCommandBuffer *commandbuffer); diff --git a/src/libANGLE/renderer/vulkan/vk_renderer.cpp b/src/libANGLE/renderer/vulkan/vk_renderer.cpp index 21744dc2713..aca6fc8c6ce 100644 --- a/src/libANGLE/renderer/vulkan/vk_renderer.cpp +++ b/src/libANGLE/renderer/vulkan/vk_renderer.cpp @@ -1347,7 +1347,7 @@ class CompressAndStorePipelineCacheTask : public angle::Closure size_t mMaxTotalSize; }; -angle::Result GetAndDecompressPipelineCacheVk(vk::Context *context, +angle::Result GetAndDecompressPipelineCacheVk(vk::ErrorContext *context, vk::GlobalOps *globalOps, angle::MemoryBuffer *uncompressedData, bool *success) @@ -1671,7 +1671,7 @@ void OneOffCommandPool::destroy(VkDevice device) mProtectionType = vk::ProtectionType::InvalidEnum; } -angle::Result OneOffCommandPool::getCommandBuffer(vk::Context *context, +angle::Result OneOffCommandPool::getCommandBuffer(vk::ErrorContext *context, vk::ScopedPrimaryCommandBuffer *commandBufferOut) { std::unique_lock lock(mMutex); @@ -1797,7 +1797,7 @@ bool Renderer::hasSharedGarbage() return !mSharedGarbageList.empty() || !mSuballocationGarbageList.empty(); } -void Renderer::onDestroy(vk::Context *context) +void Renderer::onDestroy(vk::ErrorContext *context) { if (isDeviceLost()) { @@ -1898,7 +1898,7 @@ bool Renderer::isDeviceLost() const return mDeviceLost; } -angle::Result Renderer::enableInstanceExtensions(vk::Context *context, +angle::Result Renderer::enableInstanceExtensions(vk::ErrorContext *context, const VulkanLayerVector &enabledInstanceLayerNames, const char *wsiExtension, UseVulkanSwapchain useVulkanSwapchain, @@ -2055,7 +2055,7 @@ angle::Result Renderer::enableInstanceExtensions(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::initialize(vk::Context *context, +angle::Result Renderer::initialize(vk::ErrorContext *context, vk::GlobalOps *globalOps, angle::vk::ICD desiredICD, uint32_t preferredVendorId, @@ -2382,7 +2382,7 @@ angle::Result Renderer::initialize(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::initializeMemoryAllocator(vk::Context *context) +angle::Result Renderer::initializeMemoryAllocator(vk::ErrorContext *context) { // This number matches Chromium and was picked by looking at memory usage of // Android apps. The allocator will start making blocks at 1/8 the max size @@ -3748,7 +3748,7 @@ void Renderer::enableDeviceExtensionsPromotedTo13(const vk::ExtensionNameList &d } } -angle::Result Renderer::enableDeviceExtensions(vk::Context *context, +angle::Result Renderer::enableDeviceExtensions(vk::ErrorContext *context, const angle::FeatureOverrides &featureOverrides, UseVulkanSwapchain useVulkanSwapchain, angle::NativeWindowSystem nativeWindowSystem) @@ -3920,7 +3920,7 @@ void Renderer::initDeviceExtensionEntryPoints() initializeDeviceExtensionEntryPointsFromCore(); } -angle::Result Renderer::setupDevice(vk::Context *context, +angle::Result Renderer::setupDevice(vk::ErrorContext *context, const angle::FeatureOverrides &featureOverrides, const char *wsiLayer, UseVulkanSwapchain useVulkanSwapchain, @@ -4026,7 +4026,7 @@ angle::Result Renderer::setupDevice(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::createDeviceAndQueue(vk::Context *context, uint32_t queueFamilyIndex) +angle::Result Renderer::createDeviceAndQueue(vk::ErrorContext *context, uint32_t queueFamilyIndex) { mCurrentQueueFamilyIndex = queueFamilyIndex; @@ -4270,7 +4270,7 @@ void Renderer::initializeValidationMessageSuppressions() } } -angle::Result Renderer::checkQueueForSurfacePresent(vk::Context *context, +angle::Result Renderer::checkQueueForSurfacePresent(vk::ErrorContext *context, VkSurfaceKHR surface, bool *supportedOut) { @@ -5886,7 +5886,7 @@ void Renderer::initFeatures(const vk::ExtensionNameList &deviceExtensionNames, void Renderer::appBasedFeatureOverrides(const vk::ExtensionNameList &extensions) {} -angle::Result Renderer::initPipelineCache(vk::Context *context, +angle::Result Renderer::initPipelineCache(vk::ErrorContext *context, vk::PipelineCache *pipelineCache, bool *success) { @@ -5908,7 +5908,7 @@ angle::Result Renderer::initPipelineCache(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::ensurePipelineCacheInitialized(vk::Context *context) +angle::Result Renderer::ensurePipelineCacheInitialized(vk::ErrorContext *context) { // If it is initialized already, there is nothing to do if (mPipelineCacheInitialized) @@ -5958,7 +5958,7 @@ size_t Renderer::updatePipelineCacheChunkCount(size_t chunkCount) return previousChunkCount; } -angle::Result Renderer::getPipelineCache(vk::Context *context, +angle::Result Renderer::getPipelineCache(vk::ErrorContext *context, vk::PipelineCacheAccess *pipelineCacheOut) { ANGLE_TRY(ensurePipelineCacheInitialized(context)); @@ -5973,7 +5973,7 @@ angle::Result Renderer::getPipelineCache(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::mergeIntoPipelineCache(vk::Context *context, +angle::Result Renderer::mergeIntoPipelineCache(vk::ErrorContext *context, const vk::PipelineCache &pipelineCache) { // It is an error to call into this method when the feature is disabled. @@ -6042,7 +6042,7 @@ void Renderer::initializeFrontendFeatures(angle::FrontendFeatures *features) con ANGLE_FEATURE_CONDITION(features, alwaysRunLinkSubJobsThreaded, true); } -angle::Result Renderer::getLockedPipelineCacheDataIfNew(vk::Context *context, +angle::Result Renderer::getLockedPipelineCacheDataIfNew(vk::ErrorContext *context, size_t *pipelineCacheSizeOut, size_t lastSyncSize, std::vector *pipelineCacheDataOut) @@ -6090,7 +6090,7 @@ angle::Result Renderer::getLockedPipelineCacheDataIfNew(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::syncPipelineCacheVk(vk::Context *context, +angle::Result Renderer::syncPipelineCacheVk(vk::ErrorContext *context, vk::GlobalOps *globalOps, const gl::Context *contextGL) { @@ -6204,7 +6204,7 @@ void Renderer::outputVmaStatString() mAllocator.freeStatsString(statsString); } -angle::Result Renderer::queueSubmitOneOff(vk::Context *context, +angle::Result Renderer::queueSubmitOneOff(vk::ErrorContext *context, vk::ScopedPrimaryCommandBuffer &&scopedCommandBuffer, vk::ProtectionType protectionType, egl::ContextPriority priority, @@ -6238,7 +6238,7 @@ angle::Result Renderer::queueSubmitOneOff(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::queueSubmitWaitSemaphore(vk::Context *context, +angle::Result Renderer::queueSubmitWaitSemaphore(vk::ErrorContext *context, egl::ContextPriority priority, const vk::Semaphore &waitSemaphore, VkPipelineStageFlags waitSemaphoreStageMasks, @@ -6464,7 +6464,7 @@ void Renderer::initializeDeviceExtensionEntryPointsFromCore() const } } -angle::Result Renderer::submitCommands(vk::Context *context, +angle::Result Renderer::submitCommands(vk::ErrorContext *context, vk::ProtectionType protectionType, egl::ContextPriority contextPriority, const vk::Semaphore *signalSemaphore, @@ -6490,7 +6490,7 @@ angle::Result Renderer::submitCommands(vk::Context *context, return angle::Result::Continue; } -angle::Result Renderer::submitPriorityDependency(vk::Context *context, +angle::Result Renderer::submitPriorityDependency(vk::ErrorContext *context, vk::ProtectionTypes protectionTypes, egl::ContextPriority srcContextPriority, egl::ContextPriority dstContextPriority, @@ -6536,18 +6536,18 @@ void Renderer::handleDeviceLost() mCommandQueue.handleDeviceLost(this); } -angle::Result Renderer::finishResourceUse(vk::Context *context, const vk::ResourceUse &use) +angle::Result Renderer::finishResourceUse(vk::ErrorContext *context, const vk::ResourceUse &use) { return mCommandQueue.finishResourceUse(context, use, getMaxFenceWaitTimeNs()); } -angle::Result Renderer::finishQueueSerial(vk::Context *context, const QueueSerial &queueSerial) +angle::Result Renderer::finishQueueSerial(vk::ErrorContext *context, const QueueSerial &queueSerial) { ASSERT(queueSerial.valid()); return mCommandQueue.finishQueueSerial(context, queueSerial, getMaxFenceWaitTimeNs()); } -angle::Result Renderer::waitForResourceUseToFinishWithUserTimeout(vk::Context *context, +angle::Result Renderer::waitForResourceUseToFinishWithUserTimeout(vk::ErrorContext *context, const vk::ResourceUse &use, uint64_t timeout, VkResult *result) @@ -6570,7 +6570,7 @@ angle::Result Renderer::flushWaitSemaphores( } angle::Result Renderer::flushRenderPassCommands( - vk::Context *context, + vk::ErrorContext *context, vk::ProtectionType protectionType, egl::ContextPriority priority, const vk::RenderPass &renderPass, @@ -6583,7 +6583,7 @@ angle::Result Renderer::flushRenderPassCommands( } angle::Result Renderer::flushOutsideRPCommands( - vk::Context *context, + vk::ErrorContext *context, vk::ProtectionType protectionType, egl::ContextPriority priority, vk::OutsideRenderPassCommandBufferHelper **outsideRPCommands) @@ -6593,7 +6593,7 @@ angle::Result Renderer::flushOutsideRPCommands( outsideRPCommands); } -VkResult Renderer::queuePresent(vk::Context *context, +VkResult Renderer::queuePresent(vk::ErrorContext *context, egl::ContextPriority priority, const VkPresentInfoKHR &presentInfo) { @@ -6608,7 +6608,7 @@ VkResult Renderer::queuePresent(vk::Context *context, } template -angle::Result Renderer::getCommandBufferImpl(vk::Context *context, +angle::Result Renderer::getCommandBufferImpl(vk::ErrorContext *context, vk::SecondaryCommandPool *commandPool, vk::SecondaryCommandMemoryAllocator *commandsAllocator, RecyclerT *recycler, @@ -6619,7 +6619,7 @@ angle::Result Renderer::getCommandBufferImpl(vk::Context *context, } angle::Result Renderer::getOutsideRenderPassCommandBufferHelper( - vk::Context *context, + vk::ErrorContext *context, vk::SecondaryCommandPool *commandPool, vk::SecondaryCommandMemoryAllocator *commandsAllocator, vk::OutsideRenderPassCommandBufferHelper **commandBufferHelperOut) @@ -6630,7 +6630,7 @@ angle::Result Renderer::getOutsideRenderPassCommandBufferHelper( } angle::Result Renderer::getRenderPassCommandBufferHelper( - vk::Context *context, + vk::ErrorContext *context, vk::SecondaryCommandPool *commandPool, vk::SecondaryCommandMemoryAllocator *commandsAllocator, vk::RenderPassCommandBufferHelper **commandBufferHelperOut) @@ -6671,7 +6671,7 @@ void Renderer::logCacheStats() const } } -angle::Result Renderer::getFormatDescriptorCountForVkFormat(vk::Context *context, +angle::Result Renderer::getFormatDescriptorCountForVkFormat(vk::ErrorContext *context, VkFormat format, uint32_t *descriptorCountOut) { @@ -6709,7 +6709,7 @@ angle::Result Renderer::getFormatDescriptorCountForVkFormat(vk::Context *context return angle::Result::Continue; } -angle::Result Renderer::getFormatDescriptorCountForExternalFormat(vk::Context *context, +angle::Result Renderer::getFormatDescriptorCountForExternalFormat(vk::ErrorContext *context, uint64_t format, uint32_t *descriptorCountOut) { @@ -6769,7 +6769,7 @@ void Renderer::releaseQueueSerialIndex(SerialIndex index) mQueueSerialIndexAllocator.release(index); } -angle::Result Renderer::cleanupSomeGarbage(Context *context, bool *anyGarbageCleanedOut) +angle::Result Renderer::cleanupSomeGarbage(ErrorContext *context, bool *anyGarbageCleanedOut) { return mCommandQueue.cleanupSomeGarbage(context, 0, anyGarbageCleanedOut); } @@ -6786,7 +6786,7 @@ ImageMemorySuballocator::~ImageMemorySuballocator() {} void ImageMemorySuballocator::destroy(Renderer *renderer) {} VkResult ImageMemorySuballocator::allocateAndBindMemory( - Context *context, + ErrorContext *context, Image *image, const VkImageCreateInfo *imageCreateInfo, VkMemoryPropertyFlags requiredFlags, diff --git a/src/libANGLE/renderer/vulkan/vk_renderer.h b/src/libANGLE/renderer/vulkan/vk_renderer.h index 07033787fb9..2d1ca0ba441 100644 --- a/src/libANGLE/renderer/vulkan/vk_renderer.h +++ b/src/libANGLE/renderer/vulkan/vk_renderer.h @@ -70,7 +70,7 @@ class ImageMemorySuballocator : angle::NonCopyable void destroy(vk::Renderer *renderer); // Allocates memory for the image and binds it. - VkResult allocateAndBindMemory(Context *context, + VkResult allocateAndBindMemory(ErrorContext *context, Image *image, const VkImageCreateInfo *imageCreateInfo, VkMemoryPropertyFlags requiredFlags, @@ -118,7 +118,7 @@ class OneOffCommandPool : angle::NonCopyable public: OneOffCommandPool(); void init(vk::ProtectionType protectionType); - angle::Result getCommandBuffer(vk::Context *context, + angle::Result getCommandBuffer(vk::ErrorContext *context, vk::ScopedPrimaryCommandBuffer *commandBufferOut); void releaseCommandBuffer(const QueueSerial &submitQueueSerial, vk::PrimaryCommandBuffer &&primary); @@ -155,7 +155,7 @@ class Renderer : angle::NonCopyable Renderer(); ~Renderer(); - angle::Result initialize(vk::Context *context, + angle::Result initialize(vk::ErrorContext *context, vk::GlobalOps *globalOps, angle::vk::ICD desiredICD, uint32_t preferredVendorId, @@ -171,7 +171,7 @@ class Renderer : angle::NonCopyable // Reload volk vk* function ptrs if needed for an already initialized Renderer void reloadVolkIfNeeded() const; - void onDestroy(vk::Context *context); + void onDestroy(vk::ErrorContext *context); void notifyDeviceLost(); bool isDeviceLost() const; @@ -215,7 +215,7 @@ class Renderer : angle::NonCopyable const vk::Allocator &getAllocator() const { return mAllocator; } vk::ImageMemorySuballocator &getImageMemorySuballocator() { return mImageMemorySuballocator; } - angle::Result checkQueueForSurfacePresent(vk::Context *context, + angle::Result checkQueueForSurfacePresent(vk::ErrorContext *context, VkSurfaceKHR surface, bool *supportedOut); @@ -253,11 +253,11 @@ class Renderer : angle::NonCopyable // Get the pipeline cache data after retrieving the size, but only if the size is increased // since last query. This function should be called with the |mPipelineCacheMutex| lock already // held. - angle::Result getLockedPipelineCacheDataIfNew(vk::Context *context, + angle::Result getLockedPipelineCacheDataIfNew(vk::ErrorContext *context, size_t *pipelineCacheSizeOut, size_t lastSyncSize, std::vector *pipelineCacheDataOut); - angle::Result syncPipelineCacheVk(vk::Context *context, + angle::Result syncPipelineCacheVk(vk::ErrorContext *context, vk::GlobalOps *globalOps, const gl::Context *contextGL); @@ -305,7 +305,7 @@ class Renderer : angle::NonCopyable } // This command buffer should be submitted immediately via queueSubmitOneOff. - angle::Result getCommandBufferOneOff(vk::Context *context, + angle::Result getCommandBufferOneOff(vk::ErrorContext *context, vk::ProtectionType protectionType, vk::ScopedPrimaryCommandBuffer *commandBufferOut) { @@ -314,7 +314,7 @@ class Renderer : angle::NonCopyable // Fire off a single command buffer immediately with default priority. // Command buffer must be allocated with getCommandBufferOneOff and is reclaimed. - angle::Result queueSubmitOneOff(vk::Context *context, + angle::Result queueSubmitOneOff(vk::ErrorContext *context, vk::ScopedPrimaryCommandBuffer &&scopedCommandBuffer, vk::ProtectionType protectionType, egl::ContextPriority priority, @@ -322,7 +322,7 @@ class Renderer : angle::NonCopyable VkPipelineStageFlags waitSemaphoreStageMasks, QueueSerial *queueSerialOut); - angle::Result queueSubmitWaitSemaphore(vk::Context *context, + angle::Result queueSubmitWaitSemaphore(vk::ErrorContext *context, egl::ContextPriority priority, const vk::Semaphore &waitSemaphore, VkPipelineStageFlags waitSemaphoreStageMasks, @@ -363,8 +363,9 @@ class Renderer : angle::NonCopyable size_t getNextPipelineCacheBlobCacheSlotIndex(size_t *previousSlotIndexOut); size_t updatePipelineCacheChunkCount(size_t chunkCount); - angle::Result getPipelineCache(vk::Context *context, vk::PipelineCacheAccess *pipelineCacheOut); - angle::Result mergeIntoPipelineCache(vk::Context *context, + angle::Result getPipelineCache(vk::ErrorContext *context, + vk::PipelineCacheAccess *pipelineCacheOut); + angle::Result mergeIntoPipelineCache(vk::ErrorContext *context, const vk::PipelineCache &pipelineCache); void onNewValidationMessage(const std::string &message); @@ -422,58 +423,58 @@ class Renderer : angle::NonCopyable void cleanupGarbage(bool *anyGarbageCleanedOut); void cleanupPendingSubmissionGarbage(); - angle::Result submitCommands(vk::Context *context, + angle::Result submitCommands(vk::ErrorContext *context, vk::ProtectionType protectionType, egl::ContextPriority contextPriority, const vk::Semaphore *signalSemaphore, const vk::SharedExternalFence *externalFence, const QueueSerial &submitQueueSerial); - angle::Result submitPriorityDependency(vk::Context *context, + angle::Result submitPriorityDependency(vk::ErrorContext *context, vk::ProtectionTypes protectionTypes, egl::ContextPriority srcContextPriority, egl::ContextPriority dstContextPriority, SerialIndex index); void handleDeviceLost(); - angle::Result finishResourceUse(vk::Context *context, const vk::ResourceUse &use); - angle::Result finishQueueSerial(vk::Context *context, const QueueSerial &queueSerial); - angle::Result waitForResourceUseToFinishWithUserTimeout(vk::Context *context, + angle::Result finishResourceUse(vk::ErrorContext *context, const vk::ResourceUse &use); + angle::Result finishQueueSerial(vk::ErrorContext *context, const QueueSerial &queueSerial); + angle::Result waitForResourceUseToFinishWithUserTimeout(vk::ErrorContext *context, const vk::ResourceUse &use, uint64_t timeout, VkResult *result); - angle::Result checkCompletedCommands(vk::Context *context); + angle::Result checkCompletedCommands(vk::ErrorContext *context); - angle::Result checkCompletedCommandsAndCleanup(vk::Context *context); - angle::Result releaseFinishedCommands(vk::Context *context); + angle::Result checkCompletedCommandsAndCleanup(vk::ErrorContext *context); + angle::Result releaseFinishedCommands(vk::ErrorContext *context); angle::Result flushWaitSemaphores(vk::ProtectionType protectionType, egl::ContextPriority priority, std::vector &&waitSemaphores, std::vector &&waitSemaphoreStageMasks); - angle::Result flushRenderPassCommands(vk::Context *context, + angle::Result flushRenderPassCommands(vk::ErrorContext *context, vk::ProtectionType protectionType, egl::ContextPriority priority, const vk::RenderPass &renderPass, VkFramebuffer framebufferOverride, vk::RenderPassCommandBufferHelper **renderPassCommands); angle::Result flushOutsideRPCommands( - vk::Context *context, + vk::ErrorContext *context, vk::ProtectionType protectionType, egl::ContextPriority priority, vk::OutsideRenderPassCommandBufferHelper **outsideRPCommands); - VkResult queuePresent(vk::Context *context, + VkResult queuePresent(vk::ErrorContext *context, egl::ContextPriority priority, const VkPresentInfoKHR &presentInfo); angle::Result getOutsideRenderPassCommandBufferHelper( - vk::Context *context, + vk::ErrorContext *context, vk::SecondaryCommandPool *commandPool, vk::SecondaryCommandMemoryAllocator *commandsAllocator, vk::OutsideRenderPassCommandBufferHelper **commandBufferHelperOut); angle::Result getRenderPassCommandBufferHelper( - vk::Context *context, + vk::ErrorContext *context, vk::SecondaryCommandPool *commandPool, vk::SecondaryCommandMemoryAllocator *commandsAllocator, vk::RenderPassCommandBufferHelper **commandBufferHelperOut); @@ -521,11 +522,11 @@ class Renderer : angle::NonCopyable return mSupportedVulkanShaderStageMask; } - angle::Result getFormatDescriptorCountForVkFormat(vk::Context *context, + angle::Result getFormatDescriptorCountForVkFormat(vk::ErrorContext *context, VkFormat format, uint32_t *descriptorCountOut); - angle::Result getFormatDescriptorCountForExternalFormat(vk::Context *context, + angle::Result getFormatDescriptorCountForExternalFormat(vk::ErrorContext *context, uint64_t format, uint32_t *descriptorCountOut); @@ -649,11 +650,11 @@ class Renderer : angle::NonCopyable VkDeviceSize getPendingGarbageSizeLimit() const { return mPendingGarbageSizeLimit; } - void requestAsyncCommandsAndGarbageCleanup(vk::Context *context); + void requestAsyncCommandsAndGarbageCleanup(vk::ErrorContext *context); // Cleanup garbage and finish command batches from the queue if necessary in the event of an OOM // error. - angle::Result cleanupSomeGarbage(Context *context, bool *anyGarbageCleanedOut); + angle::Result cleanupSomeGarbage(ErrorContext *context, bool *anyGarbageCleanedOut); // Static function to get Vulkan object type name. static const char *GetVulkanObjectTypeName(VkObjectType type); @@ -689,12 +690,12 @@ class Renderer : angle::NonCopyable } private: - angle::Result setupDevice(vk::Context *context, + angle::Result setupDevice(vk::ErrorContext *context, const angle::FeatureOverrides &featureOverrides, const char *wsiLayer, UseVulkanSwapchain useVulkanSwapchain, angle::NativeWindowSystem nativeWindowSystem); - angle::Result createDeviceAndQueue(vk::Context *context, uint32_t queueFamilyIndex); + angle::Result createDeviceAndQueue(vk::ErrorContext *context, uint32_t queueFamilyIndex); void ensureCapsInitialized() const; void initializeValidationMessageSuppressions(); @@ -715,12 +716,12 @@ class Renderer : angle::NonCopyable VkPhysicalDeviceFeatures2KHR *deviceFeatures, VkPhysicalDeviceProperties2 *deviceProperties); - angle::Result enableInstanceExtensions(vk::Context *context, + angle::Result enableInstanceExtensions(vk::ErrorContext *context, const VulkanLayerVector &enabledInstanceLayerNames, const char *wsiExtension, UseVulkanSwapchain useVulkanSwapchain, bool canLoadDebugUtils); - angle::Result enableDeviceExtensions(vk::Context *context, + angle::Result enableDeviceExtensions(vk::ErrorContext *context, const angle::FeatureOverrides &featureOverrides, UseVulkanSwapchain useVulkanSwapchain, angle::NativeWindowSystem nativeWindowSystem); @@ -740,10 +741,10 @@ class Renderer : angle::NonCopyable UseVulkanSwapchain useVulkanSwapchain, angle::NativeWindowSystem nativeWindowSystem); void appBasedFeatureOverrides(const vk::ExtensionNameList &extensions); - angle::Result initPipelineCache(vk::Context *context, + angle::Result initPipelineCache(vk::ErrorContext *context, vk::PipelineCache *pipelineCache, bool *success); - angle::Result ensurePipelineCacheInitialized(vk::Context *context); + angle::Result ensurePipelineCacheInitialized(vk::ErrorContext *context); template VkFormatFeatureFlags getFormatFeatureBits(angle::FormatID formatID, @@ -754,7 +755,7 @@ class Renderer : angle::NonCopyable const VkFormatFeatureFlags featureBits) const; // Initialize VMA allocator and buffer suballocator related data. - angle::Result initializeMemoryAllocator(vk::Context *context); + angle::Result initializeMemoryAllocator(vk::ErrorContext *context); // Query and cache supported fragment shading rates void queryAndCacheFragmentShadingRates(); @@ -770,7 +771,7 @@ class Renderer : angle::NonCopyable void calculatePendingGarbageSizeLimit(); template - angle::Result getCommandBufferImpl(vk::Context *context, + angle::Result getCommandBufferImpl(vk::ErrorContext *context, vk::SecondaryCommandPool *commandPool, vk::SecondaryCommandMemoryAllocator *commandsAllocator, RecyclerT *recycler, @@ -1098,22 +1099,22 @@ ANGLE_INLINE bool Renderer::hasQueueSerialFinished(const QueueSerial &queueSeria return mCommandQueue.hasQueueSerialFinished(queueSerial); } -ANGLE_INLINE void Renderer::requestAsyncCommandsAndGarbageCleanup(vk::Context *context) +ANGLE_INLINE void Renderer::requestAsyncCommandsAndGarbageCleanup(vk::ErrorContext *context) { mCleanUpThread.requestCleanUp(); } -ANGLE_INLINE angle::Result Renderer::checkCompletedCommands(vk::Context *context) +ANGLE_INLINE angle::Result Renderer::checkCompletedCommands(vk::ErrorContext *context) { return mCommandQueue.checkCompletedCommands(context); } -ANGLE_INLINE angle::Result Renderer::checkCompletedCommandsAndCleanup(vk::Context *context) +ANGLE_INLINE angle::Result Renderer::checkCompletedCommandsAndCleanup(vk::ErrorContext *context) { return mCommandQueue.checkAndCleanupCompletedCommands(context); } -ANGLE_INLINE angle::Result Renderer::releaseFinishedCommands(vk::Context *context) +ANGLE_INLINE angle::Result Renderer::releaseFinishedCommands(vk::ErrorContext *context) { return mCommandQueue.releaseFinishedCommands(context); } diff --git a/src/libANGLE/renderer/vulkan/vk_utils.cpp b/src/libANGLE/renderer/vulkan/vk_utils.cpp index 8a40b1b121f..49f7f1471c8 100644 --- a/src/libANGLE/renderer/vulkan/vk_utils.cpp +++ b/src/libANGLE/renderer/vulkan/vk_utils.cpp @@ -83,7 +83,7 @@ bool FindCompatibleMemory(const VkPhysicalDeviceMemoryProperties &memoryProperti return false; } -VkResult FindAndAllocateCompatibleMemory(vk::Context *context, +VkResult FindAndAllocateCompatibleMemory(vk::ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, const vk::MemoryProperties &memoryProperties, VkMemoryPropertyFlags requestedMemoryPropertyFlags, @@ -121,7 +121,7 @@ VkResult FindAndAllocateCompatibleMemory(vk::Context *context, } template -VkResult AllocateAndBindBufferOrImageMemory(vk::Context *context, +VkResult AllocateAndBindBufferOrImageMemory(vk::ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags requestedMemoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -133,7 +133,7 @@ VkResult AllocateAndBindBufferOrImageMemory(vk::Context *context, vk::DeviceMemory *deviceMemoryOut); template <> -VkResult AllocateAndBindBufferOrImageMemory(vk::Context *context, +VkResult AllocateAndBindBufferOrImageMemory(vk::ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags requestedMemoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -171,7 +171,7 @@ VkResult AllocateAndBindBufferOrImageMemory(vk::Context *context, } template <> -VkResult AllocateAndBindBufferOrImageMemory(vk::Context *context, +VkResult AllocateAndBindBufferOrImageMemory(vk::ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags requestedMemoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -196,7 +196,7 @@ VkResult AllocateAndBindBufferOrImageMemory(vk::Context *context, } template -VkResult AllocateBufferOrImageMemory(vk::Context *context, +VkResult AllocateBufferOrImageMemory(vk::ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags requestedMemoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -369,19 +369,19 @@ VkImageAspectFlags GetFormatAspectFlags(const angle::Format &format) return dsAspect != 0 ? dsAspect : VK_IMAGE_ASPECT_COLOR_BIT; } -// Context implementation. -Context::Context(Renderer *renderer) +// ErrorContext implementation. +ErrorContext::ErrorContext(Renderer *renderer) : mRenderer(renderer), mShareGroupRefCountedEventsGarbageRecycler(nullptr), mPerfCounters{} {} -Context::~Context() {} +ErrorContext::~ErrorContext() {} -VkDevice Context::getDevice() const +VkDevice ErrorContext::getDevice() const { return mRenderer->getDevice(); } -const angle::FeaturesVk &Context::getFeatures() const +const angle::FeaturesVk &ErrorContext::getFeatures() const { return mRenderer->getFeatures(); } @@ -415,7 +415,7 @@ bool MemoryProperties::hasLazilyAllocatedMemory() const } VkResult MemoryProperties::findCompatibleMemoryIndex( - Context *context, + ErrorContext *context, const VkMemoryRequirements &memoryRequirements, VkMemoryPropertyFlags requestedMemoryPropertyFlags, bool isExternalMemory, @@ -479,7 +479,7 @@ void StagingBuffer::destroy(Renderer *renderer) mSize = 0; } -angle::Result StagingBuffer::init(Context *context, VkDeviceSize size, StagingUsage usage) +angle::Result StagingBuffer::init(ErrorContext *context, VkDeviceSize size, StagingUsage usage) { VkBufferCreateInfo createInfo = {}; createInfo.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO; @@ -531,7 +531,7 @@ void StagingBuffer::collectGarbage(Renderer *renderer, const QueueSerial &queueS renderer->collectGarbage(use, std::move(garbageObjects)); } -angle::Result InitMappableAllocation(Context *context, +angle::Result InitMappableAllocation(ErrorContext *context, const Allocator &allocator, Allocation *allocation, VkDeviceSize size, @@ -552,7 +552,7 @@ angle::Result InitMappableAllocation(Context *context, return angle::Result::Continue; } -VkResult AllocateBufferMemory(Context *context, +VkResult AllocateBufferMemory(ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags requestedMemoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -567,7 +567,7 @@ VkResult AllocateBufferMemory(Context *context, memoryTypeIndexOut, deviceMemoryOut, sizeOut); } -VkResult AllocateImageMemory(Context *context, +VkResult AllocateImageMemory(ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags memoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -582,7 +582,7 @@ VkResult AllocateImageMemory(Context *context, memoryTypeIndexOut, deviceMemoryOut, sizeOut); } -VkResult AllocateImageMemoryWithRequirements(Context *context, +VkResult AllocateImageMemoryWithRequirements(ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags memoryPropertyFlags, const VkMemoryRequirements &memoryRequirements, @@ -599,7 +599,7 @@ VkResult AllocateImageMemoryWithRequirements(Context *context, memoryTypeIndexOut, deviceMemoryOut); } -VkResult AllocateBufferMemoryWithRequirements(Context *context, +VkResult AllocateBufferMemoryWithRequirements(ErrorContext *context, MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags memoryPropertyFlags, const VkMemoryRequirements &memoryRequirements, @@ -615,7 +615,7 @@ VkResult AllocateBufferMemoryWithRequirements(Context *context, memoryTypeIndexOut, deviceMemoryOut); } -angle::Result InitShaderModule(Context *context, +angle::Result InitShaderModule(ErrorContext *context, ShaderModulePtr *shaderModulePtr, const uint32_t *shaderCode, size_t shaderCodeSize) @@ -875,7 +875,8 @@ void ClampViewport(VkViewport *viewport) } } -void ApplyPipelineCreationFeedback(Context *context, const VkPipelineCreationFeedback &feedback) +void ApplyPipelineCreationFeedback(ErrorContext *context, + const VkPipelineCreationFeedback &feedback) { const bool cacheHit = (feedback.flags & VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT) != 0; diff --git a/src/libANGLE/renderer/vulkan/vk_utils.h b/src/libANGLE/renderer/vulkan/vk_utils.h index d745457fbb8..c8644413b36 100644 --- a/src/libANGLE/renderer/vulkan/vk_utils.h +++ b/src/libANGLE/renderer/vulkan/vk_utils.h @@ -346,11 +346,11 @@ class [[nodiscard]] ScopedQueueSerialIndex final : angle::NonCopyable class RefCountedEventsGarbageRecycler; // Abstracts error handling. Implemented by ContextVk for GL, DisplayVk for EGL, worker threads, // CLContextVk etc. -class Context : angle::NonCopyable +class ErrorContext : angle::NonCopyable { public: - Context(Renderer *renderer); - virtual ~Context(); + ErrorContext(Renderer *renderer); + virtual ~ErrorContext(); virtual void handleError(VkResult result, const char *file, @@ -517,7 +517,7 @@ class MemoryProperties final : angle::NonCopyable void init(VkPhysicalDevice physicalDevice); bool hasLazilyAllocatedMemory() const; - VkResult findCompatibleMemoryIndex(Context *context, + VkResult findCompatibleMemoryIndex(ErrorContext *context, const VkMemoryRequirements &memoryRequirements, VkMemoryPropertyFlags requestedMemoryPropertyFlags, bool isExternalMemory, @@ -560,7 +560,7 @@ class StagingBuffer final : angle::NonCopyable void collectGarbage(Renderer *renderer, const QueueSerial &queueSerial); void destroy(Renderer *renderer); - angle::Result init(Context *context, VkDeviceSize size, StagingUsage usage); + angle::Result init(ErrorContext *context, VkDeviceSize size, StagingUsage usage); Buffer &getBuffer() { return mBuffer; } const Buffer &getBuffer() const { return mBuffer; } @@ -572,14 +572,14 @@ class StagingBuffer final : angle::NonCopyable size_t mSize; }; -angle::Result InitMappableAllocation(Context *context, +angle::Result InitMappableAllocation(ErrorContext *context, const Allocator &allocator, Allocation *allocation, VkDeviceSize size, int value, VkMemoryPropertyFlags memoryPropertyFlags); -VkResult AllocateBufferMemory(Context *context, +VkResult AllocateBufferMemory(ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags requestedMemoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -589,7 +589,7 @@ VkResult AllocateBufferMemory(Context *context, DeviceMemory *deviceMemoryOut, VkDeviceSize *sizeOut); -VkResult AllocateImageMemory(Context *context, +VkResult AllocateImageMemory(ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags memoryPropertyFlags, VkMemoryPropertyFlags *memoryPropertyFlagsOut, @@ -599,7 +599,7 @@ VkResult AllocateImageMemory(Context *context, DeviceMemory *deviceMemoryOut, VkDeviceSize *sizeOut); -VkResult AllocateImageMemoryWithRequirements(Context *context, +VkResult AllocateImageMemoryWithRequirements(ErrorContext *context, vk::MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags memoryPropertyFlags, const VkMemoryRequirements &memoryRequirements, @@ -609,7 +609,7 @@ VkResult AllocateImageMemoryWithRequirements(Context *context, uint32_t *memoryTypeIndexOut, DeviceMemory *deviceMemoryOut); -VkResult AllocateBufferMemoryWithRequirements(Context *context, +VkResult AllocateBufferMemoryWithRequirements(ErrorContext *context, MemoryAllocationType memoryAllocationType, VkMemoryPropertyFlags memoryPropertyFlags, const VkMemoryRequirements &memoryRequirements, @@ -1191,7 +1191,7 @@ using SpecializationConstantMap = angle::PackedEnumMap; using ShaderModuleMap = gl::ShaderMap; -angle::Result InitShaderModule(Context *context, +angle::Result InitShaderModule(ErrorContext *context, ShaderModulePtr *shaderModulePtr, const uint32_t *shaderCode, size_t shaderCodeSize); @@ -1353,7 +1353,8 @@ constexpr bool IsDynamicDescriptor(VkDescriptorType descriptorType) } } -void ApplyPipelineCreationFeedback(Context *context, const VkPipelineCreationFeedback &feedback); +void ApplyPipelineCreationFeedback(ErrorContext *context, + const VkPipelineCreationFeedback &feedback); angle::Result SetDebugUtilsObjectName(ContextVk *contextVk, VkObjectType objectType, diff --git a/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.cpp b/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.cpp index f9cb3f9ea8a..d6c509c0c6a 100644 --- a/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.cpp +++ b/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.cpp @@ -19,7 +19,8 @@ WindowSurfaceVkWin32::WindowSurfaceVkWin32(const egl::SurfaceState &surfaceState : WindowSurfaceVk(surfaceState, window) {} -angle::Result WindowSurfaceVkWin32::createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) +angle::Result WindowSurfaceVkWin32::createSurfaceVk(vk::ErrorContext *context, + gl::Extents *extentsOut) { VkWin32SurfaceCreateInfoKHR createInfo = {}; @@ -33,7 +34,7 @@ angle::Result WindowSurfaceVkWin32::createSurfaceVk(vk::Context *context, gl::Ex return getCurrentWindowSize(context, extentsOut); } -angle::Result WindowSurfaceVkWin32::getCurrentWindowSize(vk::Context *context, +angle::Result WindowSurfaceVkWin32::getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) { RECT rect; diff --git a/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.h b/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.h index 7a641ee7cc4..60cba81380c 100644 --- a/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.h +++ b/src/libANGLE/renderer/vulkan/win32/WindowSurfaceVkWin32.h @@ -21,8 +21,8 @@ class WindowSurfaceVkWin32 : public WindowSurfaceVk WindowSurfaceVkWin32(const egl::SurfaceState &surfaceState, EGLNativeWindowType window); private: - angle::Result createSurfaceVk(vk::Context *context, gl::Extents *extentsOut) override; - angle::Result getCurrentWindowSize(vk::Context *context, gl::Extents *extentsOut) override; + angle::Result createSurfaceVk(vk::ErrorContext *context, gl::Extents *extentsOut) override; + angle::Result getCurrentWindowSize(vk::ErrorContext *context, gl::Extents *extentsOut) override; }; } // namespace rx