Commit 4901ac64 by Lubosz Sarnecki Committed by Commit Bot

FrameCapture: Capture GLES1 specific states.

Implement capturing GLES1 specific state by checking the difference to the default state using getEnableFeature. When getEnableFeature is called from a context version higher than 1 and a GLES1 state is requested, an assertion is hit. Therefore the context version needs to be determined before calling getEnableFeature. Use the available isTextureTargetEnabled function to determine GL_TEXTURE_2D and GL_TEXTURE_CUBE_MAP states in getEnableFeature. Return false in isTextureTargetEnabled when mTextUnitEnables is empty, so the vector is not accessed when not initialized, which was the case for a default state. Bug: angleproject:5893 Change-Id: I66ee41c3bf7a8e1f04a8a4ce0461fddc16f9a013 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2877237Reviewed-by: 's avatarCody Northrop <cnorthrop@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Lubosz Sarnecki <lubosz.sarnecki@collabora.com>
parent 46a139ad
...@@ -388,6 +388,10 @@ bool GLES1State::isTexCoordArrayEnabled(unsigned int unit) const ...@@ -388,6 +388,10 @@ bool GLES1State::isTexCoordArrayEnabled(unsigned int unit) const
bool GLES1State::isTextureTargetEnabled(unsigned int unit, const TextureType type) const bool GLES1State::isTextureTargetEnabled(unsigned int unit, const TextureType type) const
{ {
if (mTexUnitEnables.empty())
{
return false;
}
return mTexUnitEnables[unit].test(type); return mTexUnitEnables[unit].test(type);
} }
......
...@@ -1421,9 +1421,9 @@ bool State::getEnableFeature(GLenum feature) const ...@@ -1421,9 +1421,9 @@ bool State::getEnableFeature(GLenum feature) const
case GL_TEXTURE_COORD_ARRAY: case GL_TEXTURE_COORD_ARRAY:
return mGLES1State.mTexCoordArrayEnabled[mGLES1State.mClientActiveTexture]; return mGLES1State.mTexCoordArrayEnabled[mGLES1State.mClientActiveTexture];
case GL_TEXTURE_2D: case GL_TEXTURE_2D:
return mGLES1State.mTexUnitEnables[mActiveSampler].test(TextureType::_2D); return mGLES1State.isTextureTargetEnabled(getActiveSampler(), TextureType::_2D);
case GL_TEXTURE_CUBE_MAP: case GL_TEXTURE_CUBE_MAP:
return mGLES1State.mTexUnitEnables[mActiveSampler].test(TextureType::CubeMap); return mGLES1State.isTextureTargetEnabled(getActiveSampler(), TextureType::CubeMap);
case GL_LIGHTING: case GL_LIGHTING:
return mGLES1State.mLightingEnabled; return mGLES1State.mLightingEnabled;
case GL_LIGHT0: case GL_LIGHT0:
......
...@@ -3224,6 +3224,17 @@ void CaptureMidExecutionSetup(const gl::Context *context, ...@@ -3224,6 +3224,17 @@ void CaptureMidExecutionSetup(const gl::Context *context,
} }
}; };
// Capture GLES1 context states.
if (context->isGLES1())
{
const bool currentTextureState = apiState.getEnableFeature(GL_TEXTURE_2D);
const bool defaultTextureState = replayState.getEnableFeature(GL_TEXTURE_2D);
if (currentTextureState != defaultTextureState)
{
capCap(GL_TEXTURE_2D, currentTextureState);
}
}
// Rasterizer state. Missing ES 3.x features. // Rasterizer state. Missing ES 3.x features.
const gl::RasterizerState &defaultRasterState = replayState.getRasterizerState(); const gl::RasterizerState &defaultRasterState = replayState.getRasterizerState();
const gl::RasterizerState &currentRasterState = apiState.getRasterizerState(); const gl::RasterizerState &currentRasterState = apiState.getRasterizerState();
......
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