Skip to content

Instantly share code, notes, and snippets.

@jonahwilliams
Created December 14, 2022 16:57
Show Gist options
  • Save jonahwilliams/cbb6e260c6121679b0e786e2279d3d6b to your computer and use it in GitHub Desktop.
Save jonahwilliams/cbb6e260c6121679b0e786e2279d3d6b to your computer and use it in GitHub Desktop.
diff --git a/lib/web_ui/lib/src/engine/canvaskit/painting.dart b/lib/web_ui/lib/src/engine/canvaskit/painting.dart
index 8cd9fc1ab8..3f7e536ac4 100644
--- a/lib/web_ui/lib/src/engine/canvaskit/painting.dart
+++ b/lib/web_ui/lib/src/engine/canvaskit/painting.dart
@@ -423,11 +423,12 @@ class CkFragmentProgram implements ui.FragmentProgram {
if (type == UniformType.SampledImage) {
textureCount += 1;
} else {
+ final Object? rows = rawUniformData['rows'];
final Object? bitWidth = rawUniformData['bit_width'];
- if (bitWidth is! int) {
+ if (bitWidth is! int || rows is! int) {
throw const FormatException('Invalid Shader Data');
}
- floatCount += bitWidth ~/ 32;
+ floatCount += (bitWidth ~/ 32) * rows;
}
uniforms[location] = UniformData(
name: name,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment