Commit 6789018a by Jamie Madill Committed by Commit Bot

Context: init impl before creating objects.

This eliminates a potential invalid access that would turn up in the Vulkan back-end. Also init a couple uninitialized variables. Should fix an ASSERT in the Vulkan back-end when running WebGL tests. Bug: chromium:1085627 Change-Id: I153f8dd83f567345b964b68784940d11712e7804 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2212498 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com>
parent cbbfde6c
......@@ -405,6 +405,8 @@ void Context::initialize()
mState.initializeZeroTextures(this, mZeroTextures);
ANGLE_CONTEXT_TRY(mImplementation->initialize());
bindVertexArray({0});
if (getClientVersion() >= Version(3, 0))
......@@ -497,8 +499,6 @@ void Context::initialize()
mCopyImageDirtyBits.set(State::DIRTY_BIT_READ_FRAMEBUFFER_BINDING);
mCopyImageDirtyObjects.set(State::DIRTY_OBJECT_READ_FRAMEBUFFER);
ANGLE_CONTEXT_TRY(mImplementation->initialize());
// Initialize overlay after implementation is initialized.
ANGLE_CONTEXT_TRY(mOverlay.init(this));
}
......
......@@ -640,6 +640,8 @@ ContextVk::ContextVk(const gl::State &state, gl::ErrorSet *errorSet, RendererVk
mEmulateSeamfulCubeMapSampling(false),
mUseOldRewriteStructSamplers(false),
mPoolAllocator(kDefaultPoolAllocatorPageSize, 1),
mOutsideRenderPassCommands(nullptr),
mRenderPassCommands(nullptr),
mHasPrimaryCommands(false),
mGpuEventsEnabled(false),
mGpuClockSync{std::numeric_limits<double>::max(), std::numeric_limits<double>::max()},
......@@ -3683,6 +3685,7 @@ bool ContextVk::shouldFlush()
bool ContextVk::hasRecordedCommands()
{
ASSERT(mOutsideRenderPassCommands && mRenderPassCommands);
return !mOutsideRenderPassCommands->empty() || !mRenderPassCommands->empty() ||
mHasPrimaryCommands;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment