forked from mirrors/gecko-dev
Bug 1924184 - Revert "Bug 1914707 - Disable attrib divisor for non-array attribs." r=gfx-reviewers,lsalzman, a=dmeehan
No longer needed. Differential Revision: https://phabricator.services.mozilla.com/D229096
This commit is contained in:
parent
88cb0b2d03
commit
a08af0549f
4 changed files with 5 additions and 15 deletions
|
|
@ -299,6 +299,7 @@ void WebGLContext::VertexAttribDivisor(GLuint index, GLuint divisor) {
|
|||
|
||||
MOZ_ASSERT(mBoundVertexArray);
|
||||
mBoundVertexArray->AttribDivisor(index, divisor);
|
||||
gl->fVertexAttribDivisor(index, divisor);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
|||
|
|
@ -67,13 +67,4 @@ Maybe<double> WebGLVertexArray::GetVertexAttrib(const uint32_t index,
|
|||
}
|
||||
}
|
||||
|
||||
void WebGLVertexArray::DoAttribDivisor(const uint32_t index) const {
|
||||
const auto& binding = mBindings.at(index);
|
||||
auto driverDivisor = binding.layout.divisor;
|
||||
if (!binding.layout.isArray) {
|
||||
driverDivisor = 0;
|
||||
}
|
||||
mContext->gl->fVertexAttribDivisor(index, driverDivisor);
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
|||
|
|
@ -84,9 +84,7 @@ class WebGLVertexArray : public WebGLContextBoundObject {
|
|||
void AttribDivisor(const uint32_t index, const uint32_t val) {
|
||||
auto& binding = mBindings.at(index);
|
||||
binding.layout.divisor = val;
|
||||
DoAttribDivisor(index);
|
||||
};
|
||||
void DoAttribDivisor(uint32_t index) const;
|
||||
}
|
||||
|
||||
void AttribPointer(const uint32_t index, WebGLBuffer* const buffer,
|
||||
const webgl::VertAttribPointerDesc& desc,
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ void WebGLVertexArray::DoVertexAttrib(const uint32_t index,
|
|||
const uint32_t vertOffset) const {
|
||||
const auto& gl = mContext->gl;
|
||||
|
||||
const bool mightHaveDivisor =
|
||||
const bool useDivisor =
|
||||
mContext->IsWebGL2() ||
|
||||
mContext->IsExtensionEnabled(WebGLExtensionID::ANGLE_instanced_arrays);
|
||||
|
||||
|
|
@ -36,8 +36,8 @@ void WebGLVertexArray::DoVertexAttrib(const uint32_t index,
|
|||
gl->fDisableVertexAttribArray(index);
|
||||
}
|
||||
|
||||
if (mightHaveDivisor) {
|
||||
DoAttribDivisor(index);
|
||||
if (useDivisor) {
|
||||
gl->fVertexAttribDivisor(index, binding.layout.divisor);
|
||||
}
|
||||
|
||||
static_assert(IsBufferTargetLazilyBound(LOCAL_GL_ARRAY_BUFFER));
|
||||
|
|
|
|||
Loading…
Reference in a new issue