updateFromLayout method

  1. @visibleForTesting
void updateFromLayout({
  1. required String blockName,
  2. required int blockSizeBytes,
  3. required Map<String, ({int offset, bool sourceColor, FmatType type})> parameters,
  4. Map<String, Object> defaults = const {},
  5. Map<String, FmatHintKind?> samplers = const {},
})

Test hook mirroring updateFromMetadata but with an explicit reflected layout, so the value-preservation logic can be exercised without a GPU shader (see withLayout).

Implementation

@visibleForTesting
void updateFromLayout({
  required String blockName,
  required int blockSizeBytes,
  required Map<String, ({FmatType type, int offset, bool sourceColor})>
  parameters,
  Map<String, Object> defaults = const {},
  Map<String, FmatHintKind?> samplers = const {},
}) {
  final layout = {
    for (final e in parameters.entries)
      e.key: _ParamSlot(
        e.value.type,
        e.value.offset,
        sourceColor: e.value.sourceColor,
      ),
  };
  _applyRefresh(blockName, blockSizeBytes, layout, defaults, samplers);
}