Commit 212849e9 by Gert Wollny Committed by Commit Bot

Capture: store some array values as vector

This reduces the number of values that are added with the same key. Bug: angleproject:5853 Change-Id: Ie13408cc7ad419dec06746dc38b753f76292fae6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2824433 Commit-Queue: Gert Wollny <gert.wollny@collabora.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com>
parent 3116c91c
...@@ -1028,23 +1028,16 @@ void SerializeProgramState(JsonSerializer *json, const gl::ProgramState &program ...@@ -1028,23 +1028,16 @@ void SerializeProgramState(JsonSerializer *json, const gl::ProgramState &program
{ {
json->addString("Label", programState.getLabel()); json->addString("Label", programState.getLabel());
SerializeWorkGroupSize(json, programState.getComputeShaderLocalSize()); SerializeWorkGroupSize(json, programState.getComputeShaderLocalSize());
for (gl::Shader *shader : programState.getAttachedShaders())
{ auto attachedShaders = programState.getAttachedShaders();
if (shader) std::vector<GLint> shaderHandles(attachedShaders.size());
{ std::transform(attachedShaders.begin(), attachedShaders.end(), shaderHandles.begin(),
json->addScalar("Handle", shader->getHandle().value); [](gl::Shader *shader) { return shader ? shader->getHandle().value : 0; });
} json->addVector("Handle", shaderHandles);
else
{
json->addScalar("Handle", 0);
}
}
json->addScalar("LocationsUsedForXfbExtension", programState.getLocationsUsedForXfbExtension()); json->addScalar("LocationsUsedForXfbExtension", programState.getLocationsUsedForXfbExtension());
for (const std::string &transformFeedbackVaryingName :
programState.getTransformFeedbackVaryingNames()) json->addVectorOfStrings("TransformFeedbackVaryingNames",
{ programState.getTransformFeedbackVaryingNames());
json->addString("TransformFeedbackVaryingName", transformFeedbackVaryingName);
}
json->addScalar("ActiveUniformBlockBindingsMask", json->addScalar("ActiveUniformBlockBindingsMask",
programState.getActiveUniformBlockBindingsMask().to_ulong()); programState.getActiveUniformBlockBindingsMask().to_ulong());
SerializeVariableLocationsVector(json, "UniformLocations", programState.getUniformLocations()); SerializeVariableLocationsVector(json, "UniformLocations", programState.getUniformLocations());
...@@ -1053,10 +1046,7 @@ void SerializeProgramState(JsonSerializer *json, const gl::ProgramState &program ...@@ -1053,10 +1046,7 @@ void SerializeProgramState(JsonSerializer *json, const gl::ProgramState &program
SerializeVariableLocationsVector(json, "SecondaryOutputLocations", SerializeVariableLocationsVector(json, "SecondaryOutputLocations",
programState.getSecondaryOutputLocations()); programState.getSecondaryOutputLocations());
json->addScalar("ActiveOutputVariables", programState.getActiveOutputVariables().to_ulong()); json->addScalar("ActiveOutputVariables", programState.getActiveOutputVariables().to_ulong());
for (GLenum outputVariableType : programState.getOutputVariableTypes()) json->addVector("OutputVariableTypes", programState.getOutputVariableTypes());
{
json->addScalar("OutputVariableType", outputVariableType);
}
json->addScalar("DrawBufferTypeMask", programState.getDrawBufferTypeMask().to_ulong()); json->addScalar("DrawBufferTypeMask", programState.getDrawBufferTypeMask().to_ulong());
json->addScalar("BinaryRetrieveableHint", programState.hasBinaryRetrieveableHint()); json->addScalar("BinaryRetrieveableHint", programState.hasBinaryRetrieveableHint());
json->addScalar("Separable", programState.isSeparable()); json->addScalar("Separable", programState.isSeparable());
......
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