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 | 41246c0567f4c48ec5788a291386e377241e0eed (patch) | |
| tree | 09eb3140b51b3cb8b105e77b9711f65e5702d4df /src/main/kotlin/phenax | |
| parent | 80fd0d3c61f315b83c1eeda40daef31af01ad798 (diff) | |
| download | art-playground-openrndr-41246c0567f4c48ec5788a291386e377241e0eed.tar.gz art-playground-openrndr-41246c0567f4c48ec5788a291386e377241e0eed.zip | |
Restore old shader if theres an error loading changes
Diffstat (limited to 'src/main/kotlin/phenax')
| -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 |
