Optimize more front-end VertexArray binding.
Improves perf slightly (1-2%) in the Vulkan VBO state change test.
Bug: angleproject:3014
Change-Id: Ia8082b5b3f5e847a6b2775e896893fa8d38c1afd
Reviewed-on: https://chromium-review.googlesource.com/c/1393904
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/src/libANGLE/Framebuffer.cpp b/src/libANGLE/Framebuffer.cpp
index bcc7d76..c4e83d1 100644
--- a/src/libANGLE/Framebuffer.cpp
+++ b/src/libANGLE/Framebuffer.cpp
@@ -673,7 +673,7 @@
FramebufferAttachment::kDefaultMultiviewLayout,
FramebufferAttachment::kDefaultViewportOffsets);
}
- mState.mDrawBufferTypeMask.setIndex(getDrawbufferWriteType(0), 0);
+ SetComponentTypeMask(getDrawbufferWriteType(0), 0, &mState.mDrawBufferTypeMask);
}
Framebuffer::Framebuffer(rx::GLImplFactory *factory)
@@ -684,7 +684,7 @@
mDirtyStencilAttachmentBinding(this, DIRTY_BIT_STENCIL_ATTACHMENT)
{
mDirtyColorAttachmentBindings.emplace_back(this, DIRTY_BIT_COLOR_ATTACHMENT_0);
- mState.mDrawBufferTypeMask.setIndex(getDrawbufferWriteType(0), 0);
+ SetComponentTypeMask(getDrawbufferWriteType(0), 0, &mState.mDrawBufferTypeMask);
}
Framebuffer::~Framebuffer()
@@ -871,7 +871,7 @@
for (size_t index = 0; index < count; ++index)
{
- mState.mDrawBufferTypeMask.setIndex(getDrawbufferWriteType(index), index);
+ SetComponentTypeMask(getDrawbufferWriteType(index), index, &mState.mDrawBufferTypeMask);
if (drawStates[index] != GL_NONE && mState.mColorAttachments[index].isAttached())
{
@@ -885,23 +885,24 @@
return mState.getDrawBuffer(drawBuffer);
}
-GLenum Framebuffer::getDrawbufferWriteType(size_t drawBuffer) const
+ComponentType Framebuffer::getDrawbufferWriteType(size_t drawBuffer) const
{
const FramebufferAttachment *attachment = mState.getDrawBuffer(drawBuffer);
if (attachment == nullptr)
{
- return GL_NONE;
+ return ComponentType::NoType;
}
GLenum componentType = attachment->getFormat().info->componentType;
switch (componentType)
{
case GL_INT:
+ return ComponentType::Int;
case GL_UNSIGNED_INT:
- return componentType;
+ return ComponentType::UnsignedInt;
default:
- return GL_FLOAT;
+ return ComponentType::Float;
}
}
@@ -1761,7 +1762,8 @@
// formsRenderingFeedbackLoopWith
bool enabled = (type != GL_NONE && getDrawBufferState(colorIndex) != GL_NONE);
mState.mEnabledDrawBuffers.set(colorIndex, enabled);
- mState.mDrawBufferTypeMask.setIndex(getDrawbufferWriteType(colorIndex), colorIndex);
+ SetComponentTypeMask(getDrawbufferWriteType(colorIndex), colorIndex,
+ &mState.mDrawBufferTypeMask);
}
break;
}