Merge gl::Context and gl::ContextState.
This reduces the number of indrections when accessing the Extensions
or Caps structures. It will provide a small speed-up to some methods.
It also cleans up the code.
Bug: angleproject:2966
Change-Id: Idddac70758c42c1c2b75c885d0cacc8a5c458685
Reviewed-on: https://chromium-review.googlesource.com/c/1392391
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Markus Tavenrath <matavenrath@nvidia.com>
diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index 5e34c76..7746c0a 100644
--- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -172,7 +172,7 @@
ASSERT(!clearDepth || depthAttachment->isAttached());
// If depth write is disabled, pretend that GL_DEPTH_BUFFER_BIT is not specified altogether.
- clearDepth = clearDepth && contextVk->getGLState().getDepthStencilState().depthMask;
+ clearDepth = clearDepth && contextVk->getState().getDepthStencilState().depthMask;
const gl::FramebufferAttachment *stencilAttachment = mState.getStencilAttachment();
bool clearStencil = (stencilAttachment && (mask & GL_STENCIL_BUFFER_BIT) != 0);
@@ -180,14 +180,13 @@
bool clearColor = IsMaskFlagSet(static_cast<int>(mask), GL_COLOR_BUFFER_BIT);
- const gl::State &glState = context->getGLState();
+ const gl::State &glState = context->getState();
VkClearDepthStencilValue clearDepthStencilValue =
contextVk->getClearDepthStencilValue().depthStencil;
// Apply the stencil mask to the clear value.
- clearDepthStencilValue.stencil &=
- contextVk->getGLState().getDepthStencilState().stencilWritemask;
+ clearDepthStencilValue.stencil &= contextVk->getState().getDepthStencilState().stencilWritemask;
// If the depth or stencil is being cleared, and the image was originally requested to have a
// single aspect, but it's emulated with a depth/stencil format, clear both aspects, setting the
@@ -378,7 +377,7 @@
flippedArea.y = fbRect.height - flippedArea.y - flippedArea.height;
}
- const gl::State &glState = context->getGLState();
+ const gl::State &glState = context->getState();
const gl::PixelPackState &packState = glState.getPackState();
const gl::InternalFormat &sizedFormatInfo = gl::GetInternalFormatInfo(format, type);
@@ -527,7 +526,7 @@
ContextVk *contextVk = vk::GetImpl(context);
RendererVk *renderer = contextVk->getRenderer();
- const gl::State &glState = context->getGLState();
+ const gl::State &glState = context->getState();
const gl::Framebuffer *sourceFramebuffer = glState.getReadFramebuffer();
bool blitColorBuffer = (mask & GL_COLOR_BUFFER_BIT) != 0;
bool blitDepthBuffer = (mask & GL_DEPTH_BUFFER_BIT) != 0;
@@ -771,7 +770,7 @@
mEmulatedAlphaAttachmentMask.set(
colorIndex, sourceFormat.alphaBits == 0 && emulatedFormat.alphaBits > 0);
- contextVk->updateColorMask(context->getGLState().getBlendState());
+ contextVk->updateColorMask(context->getState().getBlendState());
}
else
{
@@ -916,7 +915,7 @@
// When clearing, the scissor region must be clipped to the renderArea per the validation rules
// in Vulkan.
gl::Rectangle intersection;
- if (!gl::ClipRectangle(contextVk->getGLState().getScissor(),
+ if (!gl::ClipRectangle(contextVk->getState().getScissor(),
mFramebuffer.getRenderPassRenderArea(), &intersection))
{
// There is nothing to clear since the scissor is outside of the render area.