Commit 3a8b8908 by Geoff Lang

GL: Follow-up primitive restart emulation fixes.

- Use the existing utility function for computing the primitive restart index. - Fix bad merge that removed the unfoldShortCircuits feature. BUG=1017337 BUG=angleproject:3997 Change-Id: I4ba5ada9816731bdd29a0e518ce225bdd69a762e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1876453Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 56d4da05
......@@ -267,7 +267,7 @@ ANGLE_INLINE angle::Result ContextGL::setDrawElementsState(const gl::Context *co
{
StateManagerGL *stateManager = getStateManager();
GLuint primitiveRestartIndex = nativegl::GetPrimitiveRestartIndexForIndexType(type);
GLuint primitiveRestartIndex = gl::GetPrimitiveRestartIndex(type);
stateManager->setPrimitiveRestartIndex(primitiveRestartIndex);
}
......
......@@ -1579,6 +1579,8 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
features, emulatePrimitiveRestartFixedIndex,
!functions->isAtLeastGL(gl::Version(4, 3)) && !functions->isAtLeastGLES(gl::Version(3, 0)));
ANGLE_FEATURE_CONDITION(features, unfoldShortCircuits, IsApple());
ANGLE_FEATURE_CONDITION(features, removeDynamicIndexingOfSwizzledVector,
IsApple() || IsAndroid() || IsWindows());
}
......@@ -1748,22 +1750,6 @@ std::string GetBufferBindingString(gl::BufferBinding bufferBinding)
return os.str();
}
GLuint GetPrimitiveRestartIndexForIndexType(gl::DrawElementsType type)
{
switch (type)
{
case gl::DrawElementsType::UnsignedByte:
return std::numeric_limits<GLubyte>::max();
case gl::DrawElementsType::UnsignedShort:
return std::numeric_limits<GLushort>::max();
case gl::DrawElementsType::UnsignedInt:
return std::numeric_limits<GLuint>::max();
default:
UNREACHABLE();
return 0;
}
}
} // namespace nativegl
const FunctionsGL *GetFunctionsGL(const gl::Context *context)
......
......@@ -108,7 +108,6 @@ bool UseTexImage3D(gl::TextureType textureType);
GLenum GetTextureBindingQuery(gl::TextureType textureType);
GLenum GetBufferBindingQuery(gl::BufferBinding bufferBinding);
std::string GetBufferBindingString(gl::BufferBinding bufferBinding);
GLuint GetPrimitiveRestartIndexForIndexType(gl::DrawElementsType type);
} // namespace nativegl
bool CanMapBufferForRead(const FunctionsGL *functions);
......
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