Commit 1c654d54 by Le Hoang Quyen Committed by Commit Bot

Metal: Fix handling of vertex attrib offset not multiple of 4

Metal requires the vertex attribute offset to be multiples of 4, and its stride must not be less than attribute's size. This should fix the WebGL's test: conformance/attribs/gl-vertexattribpointer-offsets.html Bug: angleproject:4846 Bug: angleproject:2634 Change-Id: I0784a8ccaedd5e6c58a266243bfa94ba36e53e11 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2374829 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 5c56f228
...@@ -421,6 +421,8 @@ angle::Result VertexArrayMtl::syncDirtyAttrib(const gl::Context *glContext, ...@@ -421,6 +421,8 @@ angle::Result VertexArrayMtl::syncDirtyAttrib(const gl::Context *glContext,
bool needConversion = bool needConversion =
format.actualFormatId != format.intendedFormatId || format.actualFormatId != format.intendedFormatId ||
(binding.getOffset() % format.actualAngleFormat().pixelBytes) != 0 || (binding.getOffset() % format.actualAngleFormat().pixelBytes) != 0 ||
(binding.getOffset() % mtl::kVertexAttribBufferStrideAlignment) != 0 ||
(binding.getStride() < format.actualAngleFormat().pixelBytes) ||
(binding.getStride() % mtl::kVertexAttribBufferStrideAlignment) != 0; (binding.getStride() % mtl::kVertexAttribBufferStrideAlignment) != 0;
if (needConversion) if (needConversion)
......
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