Skip to content

Commit db88baa

Browse files
Manh NguyenCommit Bot
authored andcommitted
Serializes GL context states and reformats frame_capture_utils
Adds the ability to serialize GL context states. Adds serialization of GL context states to serializeContext method so that capture replay regression testing now compares the GL context states. Reformats frame_capture_utils to make most serialization methods private, except for the ones called by other classes and template methods. Bug: angleproject:4817 Change-Id: I2d53c88be3d503268bd6e2e5058b5fabe0644f67 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2314829 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: Jamie Madill <jmadill@chromium.org> Reviewed-by: Cody Northrop <cnorthrop@google.com>
1 parent 52d2563 commit db88baa

File tree

3 files changed

+402
-103
lines changed

3 files changed

+402
-103
lines changed

src/libANGLE/State.h

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ using SamplerBindingVector = std::vector<BindingPointer<Sampler>>;
6868
using TextureBindingVector = std::vector<BindingPointer<Texture>>;
6969
using TextureBindingMap = angle::PackedEnumMap<TextureType, TextureBindingVector>;
7070
using ActiveQueryMap = angle::PackedEnumMap<QueryType, BindingPointer<Query>>;
71+
using BufferVector = std::vector<OffsetBindingPointer<Buffer>>;
7172

7273
class ActiveTexturesCache final : angle::NonCopyable
7374
{
@@ -232,6 +233,10 @@ class State : angle::NonCopyable
232233
ASSERT(maskNumber < mMaxSampleMaskWords);
233234
return mSampleMaskValues[maskNumber];
234235
}
236+
std::array<GLbitfield, MAX_SAMPLE_MASK_WORDS> getSampleMaskValues() const
237+
{
238+
return mSampleMaskValues;
239+
}
235240
GLuint getMaxSampleMaskWords() const { return mMaxSampleMaskWords; }
236241

237242
// Multisampling/alpha to one manipulation.
@@ -265,6 +270,7 @@ class State : angle::NonCopyable
265270
GLenum getGenerateMipmapHint() const;
266271
void setTextureFilteringHint(GLenum hint);
267272
GLenum getTextureFilteringHint() const;
273+
GLenum getFragmentShaderDerivativeHint() const { return mFragmentShaderDerivativeHint; }
268274
void setFragmentShaderDerivativeHint(GLenum hint);
269275

270276
// GL_CHROMIUM_bind_generates_resource
@@ -796,6 +802,39 @@ class State : angle::NonCopyable
796802

797803
bool isEarlyFragmentTestsOptimizationAllowed() const { return isSampleCoverageEnabled(); }
798804

805+
const BufferVector &getOffsetBindingPointerUniformBuffers() const { return mUniformBuffers; }
806+
807+
const BufferVector &getOffsetBindingPointerAtomicCounterBuffers() const
808+
{
809+
return mAtomicCounterBuffers;
810+
}
811+
812+
const BufferVector &getOffsetBindingPointerShaderStorageBuffers() const
813+
{
814+
return mShaderStorageBuffers;
815+
}
816+
817+
ActiveTextureMask getTexturesIncompatibleWithSamplers() const
818+
{
819+
return mTexturesIncompatibleWithSamplers;
820+
}
821+
822+
bool isProgramBinaryCacheEnabled() const { return mProgramBinaryCacheEnabled; }
823+
824+
bool isTextureRectangleEnabled() const { return mTextureRectangleEnabled; }
825+
826+
DrawBufferMask getBlendFuncConstantAlphaDrawBuffers() const
827+
{
828+
return mBlendFuncConstantAlphaDrawBuffers;
829+
}
830+
831+
DrawBufferMask getBlendFuncConstantColorDrawBuffers() const
832+
{
833+
return mBlendFuncConstantColorDrawBuffers;
834+
}
835+
836+
const std::vector<ImageUnit> getImageUnits() const { return mImageUnits; }
837+
799838
const BlendStateExt &getBlendStateExt() const { return mBlendStateExt; }
800839

801840
private:
@@ -973,7 +1012,6 @@ class State : angle::NonCopyable
9731012
// vertex array object.
9741013
BoundBufferMap mBoundBuffers;
9751014

976-
using BufferVector = std::vector<OffsetBindingPointer<Buffer>>;
9771015
BufferVector mUniformBuffers;
9781016
BufferVector mAtomicCounterBuffers;
9791017
BufferVector mShaderStorageBuffers;

0 commit comments

Comments
 (0)