Commit fba96e90 by Manh Nguyen Committed by Commit Bot

Add shaders and programs serialization capability

Serializes shaders and programs' states stored on CPU. Adds shaders and programs serialization to serializeContext method so that capture replay regresssion testing now compares the states of shaders and programs too. Bug: angleproject:4817 Change-Id: I026762ffcd85c9cf209f17d02025730aa286bd2f Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2329830 Commit-Queue: Manh Nguyen <nguyenmh@google.com> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 322cc825
......@@ -333,6 +333,42 @@ class ProgramState final : angle::NonCopyable
// can answer isCompute() based on which shaders it has.
bool isCompute() const { return mExecutable->hasLinkedShaderStage(ShaderType::Compute); }
const std::string &getLabel() const { return mLabel; }
const ShaderMap<bool> &getAttachedShadersMarkedForDetach() const
{
return mAttachedShadersMarkedForDetach;
}
uint32_t getLocationsUsedForXfbExtension() const { return mLocationsUsedForXfbExtension; }
const std::vector<GLenum> &getOutputVariableTypes() const { return mOutputVariableTypes; }
ComponentTypeMask getDrawBufferTypeMask() const { return mDrawBufferTypeMask; }
bool hasBinaryRetrieveableHint() const { return mBinaryRetrieveableHint; }
bool isSeparable() const { return mSeparable; }
PrimitiveMode getGeometryShaderInputPrimitiveType() const
{
return mGeometryShaderInputPrimitiveType;
}
PrimitiveMode getGeometryShaderOutputPrimitiveType() const
{
return mGeometryShaderOutputPrimitiveType;
}
int getGeometryShaderInvocations() const { return mGeometryShaderInvocations; }
int getGeometryShaderMaxVertices() const { return mGeometryShaderMaxVertices; }
int getDrawIDLocation() const { return mDrawIDLocation; }
int getBaseVertexLocation() const { return mBaseVertexLocation; }
int getBaseInstanceLocation() const { return mBaseInstanceLocation; }
private:
friend class MemoryProgramCache;
friend class Program;
......
......@@ -89,6 +89,28 @@ class ShaderState final : angle::NonCopyable
bool compilePending() const { return mCompileStatus == CompileStatus::COMPILE_REQUESTED; }
const sh::WorkGroupSize &getLocalSize() const { return mLocalSize; }
bool getEarlyFragmentTestsOptimization() const { return mEarlyFragmentTestsOptimization; }
int getNumViews() const { return mNumViews; }
Optional<PrimitiveMode> getGeometryShaderInputPrimitiveType() const
{
return mGeometryShaderInputPrimitiveType;
}
Optional<PrimitiveMode> getGeometryShaderOutputPrimitiveType() const
{
return mGeometryShaderOutputPrimitiveType;
}
Optional<GLint> geoGeometryShaderMaxVertices() const { return mGeometryShaderMaxVertices; }
Optional<GLint> getGeometryShaderInvocations() const { return mGeometryShaderInvocations; }
CompileStatus getCompileStatus() const { return mCompileStatus; }
private:
friend class Shader;
......@@ -198,6 +220,15 @@ class Shader final : angle::NonCopyable, public LabeledObject
const std::string &getCompilerResourcesString() const;
const ShaderState &getState() const { return mState; }
GLuint getCurrentMaxComputeWorkGroupInvocations() const
{
return mCurrentMaxComputeWorkGroupInvocations;
}
unsigned int getMaxComputeSharedMemory() const { return mMaxComputeSharedMemory; }
private:
struct CompilingState;
......
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