Inline many more hotspots for the Texture draw test.

Bug: angleproject:2763
Change-Id: Ib8193e7ff5ee7763b92f4775fb7e9adaa51c9305
Reviewed-on: https://chromium-review.googlesource.com/c/1262738
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Yuly Novikov <ynovikov@google.com>
This commit is contained in:
Jamie Madill 2018-10-09 18:30:01 -04:00 коммит произвёл Commit Bot
Родитель fcf10b62f7
Коммит 31116738ad
15 изменённых файлов: 62 добавлений и 81 удалений

Просмотреть файл

@ -7823,11 +7823,6 @@ Shader *Context::getShader(GLuint handle) const
return mState.mShaderPrograms->getShader(handle); return mState.mShaderPrograms->getShader(handle);
} }
bool Context::isTextureGenerated(GLuint texture) const
{
return mState.mTextures->isHandleGenerated(texture);
}
bool Context::isRenderbufferGenerated(GLuint renderbuffer) const bool Context::isRenderbufferGenerated(GLuint renderbuffer) const
{ {
return mState.mRenderbuffers->isHandleGenerated(renderbuffer); return mState.mRenderbuffers->isHandleGenerated(renderbuffer);

Просмотреть файл

@ -480,7 +480,10 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
Buffer *getBuffer(GLuint handle) const; Buffer *getBuffer(GLuint handle) const;
FenceNV *getFenceNV(GLuint handle); FenceNV *getFenceNV(GLuint handle);
Sync *getSync(GLsync handle) const; Sync *getSync(GLsync handle) const;
Texture *getTexture(GLuint handle) const { return mState.mTextures->getTexture(handle); } ANGLE_INLINE Texture *getTexture(GLuint handle) const
{
return mState.mTextures->getTexture(handle);
}
Framebuffer *getFramebuffer(GLuint handle) const; Framebuffer *getFramebuffer(GLuint handle) const;
Renderbuffer *getRenderbuffer(GLuint handle) const; Renderbuffer *getRenderbuffer(GLuint handle) const;
@ -1636,7 +1639,11 @@ class Context final : public egl::LabeledObject, angle::NonCopyable, public angl
Program *getProgramNoResolveLink(GLuint handle) const; Program *getProgramNoResolveLink(GLuint handle) const;
Shader *getShader(GLuint handle) const; Shader *getShader(GLuint handle) const;
bool isTextureGenerated(GLuint texture) const; ANGLE_INLINE bool isTextureGenerated(GLuint texture) const
{
return mState.mTextures->isHandleGenerated(texture);
}
bool isBufferGenerated(GLuint buffer) const bool isBufferGenerated(GLuint buffer) const
{ {
return mState.mBuffers->isHandleGenerated(buffer); return mState.mBuffers->isHandleGenerated(buffer);

Просмотреть файл

@ -587,16 +587,6 @@ bool FramebufferState::hasStencil() const
return (mStencilAttachment.isAttached() && mStencilAttachment.getStencilSize() > 0); return (mStencilAttachment.isAttached() && mStencilAttachment.getStencilSize() > 0);
} }
GLsizei FramebufferState::getNumViews() const
{
const FramebufferAttachment *attachment = getFirstNonNullAttachment();
if (attachment == nullptr)
{
return FramebufferAttachment::kDefaultNumViews;
}
return attachment->getNumViews();
}
const std::vector<Offset> *FramebufferState::getViewportOffsets() const const std::vector<Offset> *FramebufferState::getViewportOffsets() const
{ {
const FramebufferAttachment *attachment = getFirstNonNullAttachment(); const FramebufferAttachment *attachment = getFirstNonNullAttachment();

Просмотреть файл

@ -97,7 +97,17 @@ class FramebufferState final : angle::NonCopyable
bool hasStencil() const; bool hasStencil() const;
GLenum getMultiviewLayout() const; GLenum getMultiviewLayout() const;
GLsizei getNumViews() const;
ANGLE_INLINE GLsizei getNumViews() const
{
const FramebufferAttachment *attachment = getFirstNonNullAttachment();
if (attachment == nullptr)
{
return FramebufferAttachment::kDefaultNumViews;
}
return attachment->getNumViews();
}
const std::vector<Offset> *getViewportOffsets() const; const std::vector<Offset> *getViewportOffsets() const;
GLint getBaseViewIndex() const; GLint getBaseViewIndex() const;
@ -240,7 +250,7 @@ class Framebuffer final : public angle::ObserverInterface,
void invalidateCompletenessCache(const Context *context); void invalidateCompletenessCache(const Context *context);
GLenum checkStatus(const Context *context) ANGLE_INLINE GLenum checkStatus(const Context *context)
{ {
// The default framebuffer is always complete except when it is surfaceless in which // The default framebuffer is always complete except when it is surfaceless in which
// case it is always unsupported. // case it is always unsupported.
@ -257,7 +267,7 @@ class Framebuffer final : public angle::ObserverInterface,
int getCachedSamples(const Context *context); int getCachedSamples(const Context *context);
// Helper for checkStatus == GL_FRAMEBUFFER_COMPLETE. // Helper for checkStatus == GL_FRAMEBUFFER_COMPLETE.
bool isComplete(const Context *context) ANGLE_INLINE bool isComplete(const Context *context)
{ {
return (checkStatus(context) == GL_FRAMEBUFFER_COMPLETE); return (checkStatus(context) == GL_FRAMEBUFFER_COMPLETE);
} }

Просмотреть файл

@ -256,11 +256,6 @@ bool FramebufferAttachment::isLayered() const
return mTarget.textureIndex().isLayered(); return mTarget.textureIndex().isLayered();
} }
GLsizei FramebufferAttachment::getNumViews() const
{
return mNumViews;
}
GLenum FramebufferAttachment::getMultiviewLayout() const GLenum FramebufferAttachment::getMultiviewLayout() const
{ {
return mMultiviewLayout; return mMultiviewLayout;

Просмотреть файл

@ -114,7 +114,9 @@ class FramebufferAttachment final
GLint mipLevel() const; GLint mipLevel() const;
GLint layer() const; GLint layer() const;
bool isLayered() const; bool isLayered() const;
GLsizei getNumViews() const;
GLsizei getNumViews() const { return mNumViews; }
GLenum getMultiviewLayout() const; GLenum getMultiviewLayout() const;
GLint getBaseViewIndex() const; GLint getBaseViewIndex() const;
const std::vector<Offset> &getMultiviewViewportOffsets() const; const std::vector<Offset> &getMultiviewViewportOffsets() const;

Просмотреть файл

@ -64,7 +64,7 @@ class TypedResourceManager : public ResourceManagerBase<HandleAllocatorType>
TypedResourceManager() {} TypedResourceManager() {}
void deleteObject(const Context *context, GLuint handle); void deleteObject(const Context *context, GLuint handle);
bool isHandleGenerated(GLuint handle) const ANGLE_INLINE bool isHandleGenerated(GLuint handle) const
{ {
// Zero is always assumed to have been generated implicitly. // Zero is always assumed to have been generated implicitly.
return handle == 0 || mObjectMap.contains(handle); return handle == 0 || mObjectMap.contains(handle);
@ -166,7 +166,7 @@ class TextureManager : public TypedResourceManager<Texture, HandleAllocator, Tex
{ {
public: public:
GLuint createTexture(); GLuint createTexture();
Texture *getTexture(GLuint handle) const ANGLE_INLINE Texture *getTexture(GLuint handle) const
{ {
ASSERT(mObjectMap.query(0) == nullptr); ASSERT(mObjectMap.query(0) == nullptr);
return mObjectMap.query(handle); return mObjectMap.query(handle);
@ -174,7 +174,9 @@ class TextureManager : public TypedResourceManager<Texture, HandleAllocator, Tex
void signalAllTexturesDirty(const Context *context) const; void signalAllTexturesDirty(const Context *context) const;
Texture *checkTextureAllocation(rx::GLImplFactory *factory, GLuint handle, TextureType type) ANGLE_INLINE Texture *checkTextureAllocation(rx::GLImplFactory *factory,
GLuint handle,
TextureType type)
{ {
return checkObjectAllocation(factory, handle, type); return checkObjectAllocation(factory, handle, type);
} }

Просмотреть файл

@ -120,7 +120,7 @@ ResourceMap<ResourceType>::~ResourceMap()
} }
template <typename ResourceType> template <typename ResourceType>
bool ResourceMap<ResourceType>::contains(GLuint handle) const ANGLE_INLINE bool ResourceMap<ResourceType>::contains(GLuint handle) const
{ {
if (handle < mFlatResourcesSize) if (handle < mFlatResourcesSize)
{ {

Просмотреть файл

@ -381,7 +381,7 @@ ANGLE_INLINE angle::Result State::updateActiveTexture(const Context *context,
return angle::Result::Continue(); return angle::Result::Continue();
} }
mCompleteTextureBindings[textureIndex].bind(texture->getSubject()); mCompleteTextureBindings[textureIndex].bind(texture->getImplementation());
if (!texture->isSamplerComplete(context, sampler)) if (!texture->isSamplerComplete(context, sampler))
{ {

Просмотреть файл

@ -169,11 +169,6 @@ void TransformFeedback::resume()
mImplementation->resume(); mImplementation->resume();
} }
bool TransformFeedback::isActive() const
{
return mState.mActive;
}
bool TransformFeedback::isPaused() const bool TransformFeedback::isPaused() const
{ {
return mState.mPaused; return mState.mPaused;

Просмотреть файл

@ -68,7 +68,8 @@ class TransformFeedback final : public RefCountObject, public LabeledObject
void pause(); void pause();
void resume(); void resume();
bool isActive() const; bool isActive() const { return mState.mActive; }
bool isPaused() const; bool isPaused() const;
PrimitiveMode getPrimitiveMode() const; PrimitiveMode getPrimitiveMode() const;
// Validates that the vertices produced by a draw call will fit in the bound transform feedback // Validates that the vertices produced by a draw call will fit in the bound transform feedback

Просмотреть файл

@ -20,43 +20,6 @@ namespace gl
constexpr ParamTypeInfo ParamsBase::TypeInfo; constexpr ParamTypeInfo ParamsBase::TypeInfo;
constexpr ParamTypeInfo DrawCallParams::TypeInfo; constexpr ParamTypeInfo DrawCallParams::TypeInfo;
// DrawCallParams implementation.
// Called by DrawArrays.
DrawCallParams::DrawCallParams(PrimitiveMode mode,
GLint firstVertex,
GLsizei vertexCount,
GLsizei instances)
: mMode(mode),
mFirstVertex(firstVertex),
mVertexCount(vertexCount),
mIndexCount(0),
mBaseVertex(0),
mType(GL_NONE),
mIndices(nullptr),
mInstances(instances),
mIndirect(nullptr)
{
}
// Called by DrawElements.
DrawCallParams::DrawCallParams(PrimitiveMode mode,
GLint indexCount,
GLenum type,
const void *indices,
GLint baseVertex,
GLsizei instances)
: mMode(mode),
mFirstVertex(0),
mVertexCount(0),
mIndexCount(indexCount),
mBaseVertex(baseVertex),
mType(type),
mIndices(indices),
mInstances(instances),
mIndirect(nullptr)
{
}
// Called by DrawArraysIndirect. // Called by DrawArraysIndirect.
DrawCallParams::DrawCallParams(PrimitiveMode mode, const void *indirect) DrawCallParams::DrawCallParams(PrimitiveMode mode, const void *indirect)
: mMode(mode), : mMode(mode),

Просмотреть файл

@ -78,7 +78,18 @@ class DrawCallParams final : angle::NonCopyable
{ {
public: public:
// Called by DrawArrays. // Called by DrawArrays.
DrawCallParams(PrimitiveMode mode, GLint firstVertex, GLsizei vertexCount, GLsizei instances); DrawCallParams(PrimitiveMode mode, GLint firstVertex, GLsizei vertexCount, GLsizei instances)
: mMode(mode),
mFirstVertex(firstVertex),
mVertexCount(vertexCount),
mIndexCount(0),
mBaseVertex(0),
mType(GL_NONE),
mIndices(nullptr),
mInstances(instances),
mIndirect(nullptr)
{
}
// Called by DrawElements. // Called by DrawElements.
DrawCallParams(PrimitiveMode mode, DrawCallParams(PrimitiveMode mode,
@ -86,7 +97,18 @@ class DrawCallParams final : angle::NonCopyable
GLenum type, GLenum type,
const void *indices, const void *indices,
GLint baseVertex, GLint baseVertex,
GLsizei instances); GLsizei instances)
: mMode(mode),
mFirstVertex(0),
mVertexCount(0),
mIndexCount(indexCount),
mBaseVertex(baseVertex),
mType(type),
mIndices(indices),
mInstances(instances),
mIndirect(nullptr)
{
}
// Called by DrawArraysIndirect. // Called by DrawArraysIndirect.
DrawCallParams(PrimitiveMode mode, const void *indirect); DrawCallParams(PrimitiveMode mode, const void *indirect);

Просмотреть файл

@ -5681,11 +5681,6 @@ bool ValidateUniform1i(Context *context, GLint location, GLint x)
return ValidateUniform1iv(context, location, 1, &x); return ValidateUniform1iv(context, location, 1, &x);
} }
bool ValidateUniform2f(Context *context, GLint location, GLfloat x, GLfloat y)
{
return ValidateUniform(context, GL_FLOAT_VEC2, location, 1);
}
bool ValidateUniform2fv(Context *context, GLint location, GLsizei count, const GLfloat *v) bool ValidateUniform2fv(Context *context, GLint location, GLsizei count, const GLfloat *v)
{ {
return ValidateUniform(context, GL_FLOAT_VEC2, location, count); return ValidateUniform(context, GL_FLOAT_VEC2, location, count);

Просмотреть файл

@ -723,6 +723,10 @@ bool ValidateTexStorage3DEXT(Context *context,
GLsizei depth); GLsizei depth);
bool ValidateMaxShaderCompilerThreadsKHR(Context *context, GLuint count); bool ValidateMaxShaderCompilerThreadsKHR(Context *context, GLuint count);
ANGLE_INLINE bool ValidateUniform2f(Context *context, GLint location, GLfloat x, GLfloat y)
{
return ValidateUniform(context, GL_FLOAT_VEC2, location, 1);
}
} // namespace gl } // namespace gl
#endif // LIBANGLE_VALIDATION_ES2_H_ #endif // LIBANGLE_VALIDATION_ES2_H_