Commit 6b600645 by Jamie Madill Committed by Commit Bot

D3D11: Micro-optimize StateManager11::updateState.

This inlines several accessors. Bug: angleproject:2574 Change-Id: I61d223dd2a8f08e5331ccefde02e6ce55f5a607d Reviewed-on: https://chromium-review.googlesource.com/1067118Reviewed-by: 's avatarYuly Novikov <ynovikov@chromium.org> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 4166f014
......@@ -1184,11 +1184,6 @@ Framebuffer *State::getReadFramebuffer() const
return mReadFramebuffer;
}
Framebuffer *State::getDrawFramebuffer() const
{
return mDrawFramebuffer;
}
bool State::removeReadFramebufferBinding(GLuint framebuffer)
{
if (mReadFramebuffer != nullptr && mReadFramebuffer->id() == framebuffer)
......@@ -1234,12 +1229,6 @@ GLuint State::getVertexArrayId() const
return mVertexArray->id();
}
VertexArray *State::getVertexArray() const
{
ASSERT(mVertexArray != nullptr);
return mVertexArray;
}
bool State::removeVertexArrayBinding(const Context *context, GLuint vertexArray)
{
if (mVertexArray && mVertexArray->id() == vertexArray)
......@@ -1309,11 +1298,6 @@ void State::setProgram(const Context *context, Program *newProgram)
}
}
Program *State::getProgram() const
{
return mProgram;
}
void State::setTransformFeedbackBinding(const Context *context,
TransformFeedback *transformFeedback)
{
......
......@@ -199,19 +199,25 @@ class State : public angle::ObserverInterface, angle::NonCopyable
void setDrawFramebufferBinding(Framebuffer *framebuffer);
Framebuffer *getTargetFramebuffer(GLenum target) const;
Framebuffer *getReadFramebuffer() const;
Framebuffer *getDrawFramebuffer() const;
Framebuffer *getDrawFramebuffer() const { return mDrawFramebuffer; }
bool removeReadFramebufferBinding(GLuint framebuffer);
bool removeDrawFramebufferBinding(GLuint framebuffer);
// Vertex array object binding manipulation
void setVertexArrayBinding(const Context *context, VertexArray *vertexArray);
GLuint getVertexArrayId() const;
VertexArray *getVertexArray() const;
VertexArray *getVertexArray() const
{
ASSERT(mVertexArray != nullptr);
return mVertexArray;
}
bool removeVertexArrayBinding(const Context *context, GLuint vertexArray);
// Program binding manipulation
void setProgram(const Context *context, Program *newProgram);
Program *getProgram() const;
Program *getProgram() const { return mProgram; }
// Transform feedback object (not buffer) binding manipulation
void setTransformFeedbackBinding(const Context *context, TransformFeedback *transformFeedback);
......@@ -250,7 +256,6 @@ class State : public angle::ObserverInterface, angle::NonCopyable
// Vertex attrib manipulation
void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
void setElementArrayBuffer(const Context *context, Buffer *buffer);
void setVertexAttribf(GLuint index, const GLfloat values[4]);
void setVertexAttribu(GLuint index, const GLuint values[4]);
void setVertexAttribi(GLuint index, const GLint values[4]);
......
......@@ -85,11 +85,6 @@ DrawCallParams::DrawCallParams(PrimitiveMode mode, GLenum type, const void *indi
{
}
PrimitiveMode DrawCallParams::mode() const
{
return mMode;
}
GLint DrawCallParams::firstVertex() const
{
// In some cases we can know the first vertex will be fixed at zero, if we're on the "fast
......@@ -132,11 +127,6 @@ const void *DrawCallParams::indirect() const
return mIndirect;
}
bool DrawCallParams::isDrawElements() const
{
return (mType != GL_NONE);
}
bool DrawCallParams::isDrawIndirect() const
{
// This is a bit of a hack - it's quite possible for a direct call to have a zero count, but we
......
......@@ -94,7 +94,7 @@ class DrawCallParams final : angle::NonCopyable
// Called by DrawElementsIndirect.
DrawCallParams(PrimitiveMode mode, GLenum type, const void *indirect);
PrimitiveMode mode() const;
PrimitiveMode mode() const { return mMode; }
// This value is the sum of 'baseVertex' and the first indexed vertex for DrawElements calls.
GLint firstVertex() const;
......@@ -113,7 +113,8 @@ class DrawCallParams final : angle::NonCopyable
const void *indirect() const;
Error ensureIndexRangeResolved(const Context *context) const;
bool isDrawElements() const;
bool isDrawElements() const { return (mType != GL_NONE); }
bool isDrawIndirect() const;
// ensureIndexRangeResolved must be called first.
......
......@@ -2711,11 +2711,6 @@ bool ProgramD3D::hasPixelExecutableForCachedOutputLayout()
return mCachedPixelExecutableIndex.valid();
}
bool ProgramD3D::anyShaderUniformsDirty() const
{
return mShaderUniformsDirty.any();
}
template <typename DestT>
void ProgramD3D::getUniformInternal(GLint location, DestT *dataOut) const
{
......
......@@ -288,7 +288,8 @@ class ProgramD3D : public ProgramImpl
bool hasGeometryExecutableForPrimitiveType(gl::PrimitiveMode drawMode);
bool hasPixelExecutableForCachedOutputLayout();
bool anyShaderUniformsDirty() const;
bool anyShaderUniformsDirty() const { return mShaderUniformsDirty.any(); }
bool areShaderUniformsDirty(gl::ShaderType shaderType) const
{
return mShaderUniformsDirty[shaderType];
......
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