File tree 2 files changed +4
-3
lines changed 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -423,11 +423,12 @@ class CkFragmentProgram implements ui.FragmentProgram {
423
423
if (type == UniformType .SampledImage ) {
424
424
textureCount += 1 ;
425
425
} else {
426
+ final Object ? rows = rawUniformData['rows' ];
426
427
final Object ? bitWidth = rawUniformData['bit_width' ];
427
- if (bitWidth is ! int ) {
428
+ if (bitWidth is ! int || rows is ! int ) {
428
429
throw const FormatException ('Invalid Shader Data' );
429
430
}
430
- floatCount += bitWidth ~ / 32 ;
431
+ floatCount += ( bitWidth ~ / 32 ) * rows ;
431
432
}
432
433
uniforms[location] = UniformData (
433
434
name: name,
Original file line number Diff line number Diff line change @@ -192,7 +192,7 @@ void testMain() {
192
192
final CkFragmentProgram program = await CkFragmentProgram .fromBytes ('test' , data);
193
193
194
194
expect (program.effect, isNotNull);
195
- expect (program.floatCount, 17 );
195
+ expect (program.floatCount, 32 );
196
196
expect (program.textureCount, 0 );
197
197
expect (program.uniforms, hasLength (17 ));
198
198
expect (program.name, 'test' );
You can’t perform that action at this time.
0 commit comments