Commit f6784006 by Mohan Maiya Committed by Commit Bot

Modify data type of ActiveTextureMask and ImageUnitMask

ActiveTextureMask and ImageUnitMask need more than 64bits. We can now use the BitSetArray datatype and avoid the perf penalty of using std::bitset Bug: angleproject:3877 Tests: angle_perftests.exe --gtest_filter=TexturesBenchmark* Change-Id: Ic82e09d1aa2c1904d06ad48ba6200f35896665ac Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2664734 Commit-Queue: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent f1cbcaba
...@@ -68,9 +68,7 @@ ProgramExecutable::ProgramExecutable() ...@@ -68,9 +68,7 @@ ProgramExecutable::ProgramExecutable()
: mMaxActiveAttribLocation(0), : mMaxActiveAttribLocation(0),
mAttributesTypeMask(0), mAttributesTypeMask(0),
mAttributesMask(0), mAttributesMask(0),
mActiveSamplersMask(0),
mActiveSamplerRefCounts{}, mActiveSamplerRefCounts{},
mActiveImagesMask(0),
mCanDrawWith(false), mCanDrawWith(false),
mYUVOutput(false), mYUVOutput(false),
mTransformFeedbackBufferMode(GL_INTERLEAVED_ATTRIBS), mTransformFeedbackBufferMode(GL_INTERLEAVED_ATTRIBS),
......
...@@ -347,7 +347,6 @@ State::State(const State *shareContextState, ...@@ -347,7 +347,6 @@ State::State(const State *shareContextState,
mProvokingVertex(gl::ProvokingVertexConvention::LastVertexConvention), mProvokingVertex(gl::ProvokingVertexConvention::LastVertexConvention),
mVertexArray(nullptr), mVertexArray(nullptr),
mActiveSampler(0), mActiveSampler(0),
mTexturesIncompatibleWithSamplers(0),
mValidAtomicCounterBufferCount(0), mValidAtomicCounterBufferCount(0),
mPrimitiveRestart(false), mPrimitiveRestart(false),
mDebug(debug), mDebug(debug),
......
...@@ -786,8 +786,8 @@ class State : angle::NonCopyable ...@@ -786,8 +786,8 @@ class State : angle::NonCopyable
ANGLE_INLINE bool validateSamplerFormats() const ANGLE_INLINE bool validateSamplerFormats() const
{ {
return (!mExecutable || return (!mExecutable || !(mTexturesIncompatibleWithSamplers.intersects(
(mTexturesIncompatibleWithSamplers & mExecutable->getActiveSamplersMask()).none()); mExecutable->getActiveSamplersMask())));
} }
ProvokingVertexConvention getProvokingVertex() const { return mProvokingVertex; } ProvokingVertexConvention getProvokingVertex() const { return mProvokingVertex; }
......
...@@ -829,7 +829,7 @@ using DrawBuffersVector = angle::FixedVector<T, IMPLEMENTATION_MAX_DRAW_BUFFERS> ...@@ -829,7 +829,7 @@ using DrawBuffersVector = angle::FixedVector<T, IMPLEMENTATION_MAX_DRAW_BUFFERS>
template <typename T> template <typename T>
using AttribArray = std::array<T, MAX_VERTEX_ATTRIBS>; using AttribArray = std::array<T, MAX_VERTEX_ATTRIBS>;
using ActiveTextureMask = angle::BitSet<IMPLEMENTATION_MAX_ACTIVE_TEXTURES>; using ActiveTextureMask = angle::BitSetArray<IMPLEMENTATION_MAX_ACTIVE_TEXTURES>;
template <typename T> template <typename T>
using ActiveTextureArray = std::array<T, IMPLEMENTATION_MAX_ACTIVE_TEXTURES>; using ActiveTextureArray = std::array<T, IMPLEMENTATION_MAX_ACTIVE_TEXTURES>;
...@@ -846,7 +846,7 @@ using AtomicCounterBufferMask = angle::BitSet<IMPLEMENTATION_MAX_ATOMIC_COUNTE ...@@ -846,7 +846,7 @@ using AtomicCounterBufferMask = angle::BitSet<IMPLEMENTATION_MAX_ATOMIC_COUNTE
template <typename T> template <typename T>
using ImagesArray = std::array<T, IMPLEMENTATION_MAX_IMAGE_UNITS>; using ImagesArray = std::array<T, IMPLEMENTATION_MAX_IMAGE_UNITS>;
using ImageUnitMask = angle::BitSet<IMPLEMENTATION_MAX_IMAGE_UNITS>; using ImageUnitMask = angle::BitSetArray<IMPLEMENTATION_MAX_IMAGE_UNITS>;
using SupportedSampleSet = std::set<GLuint>; using SupportedSampleSet = std::set<GLuint>;
......
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