diff --git a/core/src/commonMain/kotlin/Shader.kt b/core/src/commonMain/kotlin/Shader.kt index 51501ab..6fdd076 100644 --- a/core/src/commonMain/kotlin/Shader.kt +++ b/core/src/commonMain/kotlin/Shader.kt @@ -143,7 +143,7 @@ public interface Shader { * @see Transpiler * @see Transpiler.Dynamic */ - public interface SingleTarget : Transpiler where L : Language, F : FormFactor { + public interface Simple : Transpiler where L : Language, F : FormFactor { /** * The [Kind] of all [Shader]s outputted by this [Transpiler]. * @@ -153,11 +153,13 @@ public interface Shader { } /** - * Transpile [Shader]s to any of the pre-selected [outputKinds]. + * Transpiles [Shader]s to any of the pre-selected [outputKinds]. * * It is up to the implementation to select the optimal [Kind]. * * @see 0.0.1-alpha.4 + * @see Transpiler + * @see Transpiler.Simple */ public interface Dynamic : Transpiler where L : Language, F : FormFactor { /** diff --git a/core/src/commonMain/kotlin/Shaders.kt b/core/src/commonMain/kotlin/Shaders.kt index d20ed1e..b584ee3 100644 --- a/core/src/commonMain/kotlin/Shaders.kt +++ b/core/src/commonMain/kotlin/Shaders.kt @@ -108,12 +108,12 @@ public val Shader.kind: Shader.Kind<*, *> get() = Shader.Kind Shader.Transpiler.outputKinds: ImmutableSet> where L : Shader.Language, F : Shader.FormFactor get() = when (this) { is Shader.Transpiler.Dynamic -> outputKinds - is Shader.Transpiler.SingleTarget -> persistentHashSetOf(outputKind) + is Shader.Transpiler.Simple -> persistentHashSetOf(outputKind) } /** @@ -124,7 +124,7 @@ private inline fun Shader.isAnyKindOutputtedBy( predicate: Shader.(Shader.Kind<*, *>) -> Boolean ) = when (transpiler) { is Shader.Transpiler.Dynamic -> transpiler.outputKinds.any { predicate(it) } - is Shader.Transpiler.SingleTarget -> predicate(transpiler.outputKind) + is Shader.Transpiler.Simple -> predicate(transpiler.outputKind) } /** diff --git a/example/src/commonMain/kotlin/AdvancedRenderer.kt b/example/src/commonMain/kotlin/AdvancedRenderer.kt index ef07892..7b1c42b 100644 --- a/example/src/commonMain/kotlin/AdvancedRenderer.kt +++ b/example/src/commonMain/kotlin/AdvancedRenderer.kt @@ -17,7 +17,7 @@ public class AdvancedRenderer( override val format: TextureFormat = surface.textureFormat, public val scene: RenderScene, public val vertexKind: VertexKind, - transpiler: Shader.Transpiler.SingleTarget + transpiler: Shader.Transpiler.Simple ) : WebGpuRenderer, Closer by Closer(surface, device) { private val shaders = +ShaderCache(transpiler) private val shaderDescriptors = +ManualCache {