sourceOf static method

ShaderSource? sourceOf(
  1. Shader shader, {
  2. ShaderBackend? backend,
})

The compiled output of shader for backend (the running platform's by default), or null when unavailable.

Implementation

static ShaderSource? sourceOf(gpu.Shader shader, {ShaderBackend? backend}) {
  final info = infoFor(shader);
  if (info == null) return null;
  final backendInfo = backend == null ? info.current : info.backends[backend];
  return backendInfo?.source;
}