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