The Problem: glslViewer is using setSource() and use() to render the canvas shader (and possibly others).
The first overwrites the m_fragmentSource field and the latter calls load() with the (new) m_fragmentSource.
However, load() assumes the passed source is new and reverts to the local m_fragmentSource if it fails compilation - which also fails since it is the same and always results in the SHOW_MAGENTA_SHADER setting.
I expect REVERT_TO_PREVIOUS_SHADER to always fall back to the last working shader and started working on a fix at this forked branch - however it currently falls back to the last shader, so loading a shader twice that failed compilation shows a magenta screen again.
Maybe reverting to the previous shader, even if it failed compilation, should be the behavior of REVERT_TO_PREVIOUS_SHADER and a new setting should enable the behavior I expect: REVERT_TO_LAST_WORKING_SHADER. Happy to get feedback on this.
The Problem: glslViewer is using
setSource()
anduse()
to render the canvas shader (and possibly others). The first overwrites them_fragmentSource
field and the latter callsload()
with the (new)m_fragmentSource
. However,load()
assumes the passed source is new and reverts to the localm_fragmentSource
if it fails compilation - which also fails since it is the same and always results in theSHOW_MAGENTA_SHADER
setting.I expect
REVERT_TO_PREVIOUS_SHADER
to always fall back to the last working shader and started working on a fix at this forked branch - however it currently falls back to the last shader, so loading a shader twice that failed compilation shows a magenta screen again.Maybe reverting to the previous shader, even if it failed compilation, should be the behavior of
REVERT_TO_PREVIOUS_SHADER
and a new setting should enable the behavior I expect:REVERT_TO_LAST_WORKING_SHADER
. Happy to get feedback on this.