diff options
| author | Akshay Nair <phenax5@gmail.com> | 2026-09-10 00:30:25 +0530 |
|---|---|---|
| committer | Akshay Nair <phenax5@gmail.com> | 2026-09-10 00:30:25 +0530 |
| commit | 33f12612f9a34bc86faf314ef10e035a35d26cc9 (patch) | |
| tree | 38f27099b226e7531639e0ed3668410dd530d953 /src | |
| parent | d58f16b84e4909eeb2820172987767df47e73429 (diff) | |
| download | art-playground-openrndr-33f12612f9a34bc86faf314ef10e035a35d26cc9.tar.gz art-playground-openrndr-33f12612f9a34bc86faf314ef10e035a35d26cc9.zip | |
Restore old shader if theres an error loading changes
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/kotlin/phenax/utils/program.kt | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/main/kotlin/phenax/utils/program.kt b/src/main/kotlin/phenax/utils/program.kt index 6ff5379..a05307c 100644 --- a/src/main/kotlin/phenax/utils/program.kt +++ b/src/main/kotlin/phenax/utils/program.kt @@ -55,6 +55,8 @@ fun Program.liveComputeShader(name: String): ReadOnlyProperty<Any?, ComputeShade try { cs = ComputeShader.fromCode(shaderCode, name) } catch (e: Exception) { + // Restore old shader if new code has error + cs = ComputeShader.fromCode(lastCompiledCode, name) println("Shader compile failed: ${e.message}") } lastCompiledCode = shaderCode |
