Use Tint to extract local workgroup size

BUG=dawn:578

Change-Id: I7526fdcc3ee96099d1487cd159a7bea9210f2b4e
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38143
Auto-Submit: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: Austin Eng <enga@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
diff --git a/src/dawn_native/ShaderModule.cpp b/src/dawn_native/ShaderModule.cpp
index 90670af..a001569 100644
--- a/src/dawn_native/ShaderModule.cpp
+++ b/src/dawn_native/ShaderModule.cpp
@@ -711,6 +711,10 @@
 
                 auto metadata = std::make_unique<EntryPointMetadata>();
                 metadata->stage = PipelineStateToShaderStage(entryPoint.stage);
+                metadata->localWorkgroupSize.x = entryPoint.workgroup_size_x;
+                metadata->localWorkgroupSize.y = entryPoint.workgroup_size_y;
+                metadata->localWorkgroupSize.z = entryPoint.workgroup_size_z;
+
                 result[entryPoint.name] = std::move(metadata);
             }
             return std::move(result);
@@ -770,13 +774,19 @@
                         "Tint and SPIRV-Cross returned different stages for entry point");
                 }
 
+                if (tintEntry->localWorkgroupSize.x != tintEntry->localWorkgroupSize.x ||
+                    tintEntry->localWorkgroupSize.y != tintEntry->localWorkgroupSize.y ||
+                    tintEntry->localWorkgroupSize.z != tintEntry->localWorkgroupSize.z) {
+                    return DAWN_VALIDATION_ERROR(
+                        "Tint and SPIRV-Cross returned different values for local workgroup size");
+                }
+
                 // TODO(rharrison): Use the Inspector to get this data.
                 tintEntry->bindings = crossEntry->bindings;
                 tintEntry->usedVertexAttributes = crossEntry->usedVertexAttributes;
                 tintEntry->fragmentOutputFormatBaseTypes =
                     crossEntry->fragmentOutputFormatBaseTypes;
                 tintEntry->fragmentOutputsWritten = crossEntry->fragmentOutputsWritten;
-                tintEntry->localWorkgroupSize = crossEntry->localWorkgroupSize;
             }
             return {};
         }