Bug 1497439 - Revendor ANGLE with cherry-pick for large vert attrib divisors.
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 09 Oct 2018 17:46:05 -0700
changeset 440453 0be6d75ba4a31a6fb6321eb3dd08778b0f5a2612
parent 440404 3854b434407792df13fad738667b042e2ebb0449
child 440454 1ea62adf090265c003ed0385e97e59229f0a85f4
push id34821
push userryanvm@gmail.com
push dateWed, 10 Oct 2018 16:31:04 +0000
treeherdermozilla-central@1a9cbc785296 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1497439
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1497439 - Revendor ANGLE with cherry-pick for large vert attrib divisors. Re-enable the test. MozReview-Commit-ID: Jh2ekEXkit3
dom/canvas/test/webgl-conf/generated-mochitest.ini
dom/canvas/test/webgl-conf/mochitest-errata.ini
gfx/angle/checkout/out/gen/angle/id/commit.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
gfx/angle/cherry_picks.txt
--- a/dom/canvas/test/webgl-conf/generated-mochitest.ini
+++ b/dom/canvas/test/webgl-conf/generated-mochitest.ini
@@ -5335,17 +5335,16 @@ subsuite = webgl2-core
 fail-if = (os == 'mac') || (os == 'win')
 [generated/test_2_conformance2__rendering__instanced-arrays.html]
 subsuite = webgl2-core
 fail-if = 1
 [generated/test_2_conformance2__rendering__instanced-rendering-bug.html]
 subsuite = webgl2-core
 [generated/test_2_conformance2__rendering__instanced-rendering-large-divisor.html]
 subsuite = webgl2-core
-skip-if = (os == 'win')
 [generated/test_2_conformance2__rendering__line-rendering-quality.html]
 subsuite = webgl2-core
 [generated/test_2_conformance2__rendering__multisampling-fragment-evaluation.html]
 subsuite = webgl2-core
 [generated/test_2_conformance2__rendering__out-of-bounds-index-buffers-after-copying.html]
 subsuite = webgl2-core
 [generated/test_2_conformance2__rendering__read-draw-when-missing-image.html]
 subsuite = webgl2-core
--- a/dom/canvas/test/webgl-conf/mochitest-errata.ini
+++ b/dom/canvas/test/webgl-conf/mochitest-errata.ini
@@ -1167,11 +1167,8 @@ skip-if = (os == 'win')
 [generated/test_conformance__misc__webgl-specific-stencil-settings.html]
 skip-if = (os == 'win')
 [generated/test_conformance__textures__misc__tex-video-using-tex-unit-non-zero.html]
 # Fails on QuantumRender configs, but passes on standard configs?
 # Might be intermittant.
 skip-if = (os == 'win')
 [generated/test_2_conformance__textures__misc__tex-video-using-tex-unit-non-zero.html]
 skip-if = (os == 'win')
-[generated/test_2_conformance2__rendering__instanced-rendering-large-divisor.html]
-# Assertion failed: static_cast<unsigned int>(packedAttrib.divisor) == divisor, file z:/build/build/src/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp, line 89
-skip-if = (os == 'win')
--- a/gfx/angle/checkout/out/gen/angle/id/commit.h
+++ b/gfx/angle/checkout/out/gen/angle/id/commit.h
@@ -1,3 +1,3 @@
-#define ANGLE_COMMIT_HASH "598f2502e3a4"
+#define ANGLE_COMMIT_HASH "790e8e6b4179"
 #define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "2018-10-09 13:54:05 -0700"
+#define ANGLE_COMMIT_DATE "2018-10-09 17:41:46 -0700"
--- a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
+++ b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
@@ -54,17 +54,18 @@ GLenum GetGLSLAttributeType(const std::v
     return GL_NONE;
 }
 
 struct PackedAttribute
 {
     uint8_t attribType;
     uint8_t semanticIndex;
     uint8_t vertexFormatType;
-    uint8_t divisor;
+    uint8_t dummyPadding;
+    uint32_t divisor;
 };
 
 }  // anonymous namespace
 
 PackedAttributeLayout::PackedAttributeLayout() : numAttributes(0), flags(0), attributeData({})
 {
 }
 
@@ -76,27 +77,28 @@ void PackedAttributeLayout::addAttribute
                                              unsigned int divisor)
 {
     gl::AttributeType attribType = gl::GetAttributeType(glType);
 
     PackedAttribute packedAttrib;
     packedAttrib.attribType       = static_cast<uint8_t>(attribType);
     packedAttrib.semanticIndex    = static_cast<uint8_t>(semanticIndex);
     packedAttrib.vertexFormatType = static_cast<uint8_t>(vertexFormatType);
-    packedAttrib.divisor          = static_cast<uint8_t>(divisor);
+    packedAttrib.dummyPadding     = 0u;
+    packedAttrib.divisor          = static_cast<uint32_t>(divisor);
 
     ASSERT(static_cast<gl::AttributeType>(packedAttrib.attribType) == attribType);
     ASSERT(static_cast<UINT>(packedAttrib.semanticIndex) == semanticIndex);
     ASSERT(static_cast<gl::VertexFormatType>(packedAttrib.vertexFormatType) == vertexFormatType);
     ASSERT(static_cast<unsigned int>(packedAttrib.divisor) == divisor);
 
-    static_assert(sizeof(uint32_t) == sizeof(PackedAttribute),
-                  "PackedAttributes must be 32-bits exactly.");
+    static_assert(sizeof(uint64_t) == sizeof(PackedAttribute),
+                  "PackedAttributes must be 64-bits exactly.");
 
-    attributeData[numAttributes++] = gl::bitCast<uint32_t>(packedAttrib);
+    attributeData[numAttributes++] = gl::bitCast<uint64_t>(packedAttrib);
 }
 
 bool PackedAttributeLayout::operator==(const PackedAttributeLayout &other) const
 {
     return (numAttributes == other.numAttributes) && (flags == other.flags) &&
            (attributeData == other.attributeData);
 }
 
--- a/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
+++ b/gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
@@ -43,17 +43,17 @@ struct PackedAttributeLayout
     {
         FLAG_USES_INSTANCED_SPRITES     = 0x1,
         FLAG_INSTANCED_SPRITES_ACTIVE   = 0x2,
         FLAG_INSTANCED_RENDERING_ACTIVE = 0x4,
     };
 
     uint32_t numAttributes;
     uint32_t flags;
-    gl::AttribArray<uint32_t> attributeData;
+    gl::AttribArray<uint64_t> attributeData;
 };
 }  // namespace rx
 
 namespace std
 {
 template <>
 struct hash<rx::PackedAttributeLayout>
 {
--- a/gfx/angle/cherry_picks.txt
+++ b/gfx/angle/cherry_picks.txt
@@ -1,8 +1,28 @@
+commit 790e8e6b417905eca335d06c16ec54c977188110
+Author: Olli Etuaho <oetuaho@nvidia.com>
+Date:   Thu Sep 20 13:20:50 2018 +0300
+
+    Fix using a large vertex attrib divisor on D3D11
+    
+    A divisor >= 256 used to trigger an assert on the D3D11 backend since
+    it couldn't fit into the input layout cache. Increase the space
+    reserved for the divisor in the input layout cache to make sure that
+    the correct input layout will get used and to fix the assert.
+    
+    BUG=angleproject:2832
+    TEST=angle_end2end_tests
+    
+    Change-Id: I34eead6c4e8c4fea379bbafc8670b4e32a5b633b
+    Reviewed-on: https://chromium-review.googlesource.com/1236293
+    Reviewed-by: Jamie Madill <jmadill@chromium.org>
+    Reviewed-by: Geoff Lang <geofflang@chromium.org>
+    Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
+
 commit 598f2502e3a41b76d90037e7858c43c18e66399d
 Merge: 8212058a6 e15a25c6f
 Author: Jeff Gilbert <jdashg@gmail.com>
 Date:   Tue Oct 9 13:54:05 2018 -0700
 
     Merge pull request #13 from mattwoodrow/async-load-program
     
     Support async glProgramBInary