Repository navigation
ariadne: scene shaders and UI shaders are separate capabilities - #899
Merged
Merged
Conversation
gl.shaders read the backend's Capabilities::glsl, so it answered for the UI only. arigl --terminal renders the scene offscreen through GL, so a node's shader: block runs there, but the terminal backend reports glsl = false. A document could not tell "the scene runs my GLSL" from "nothing does". - SceneAdapter::runs_shaders() (default false): the adapter's renderer compiles the GLSL a document gives its scene. cvcGL's GlSceneAdapter and TerminalScene return true. - HostFacts::scene_shaders, set by AppRuntime from its adapter (Runtime::set_scene_shaders). - Tokens: gl.scene.shaders (the scene runs the document's GLSL), gl.ui.shaders (the UI draws GLSL itself, a shader_canvas: Capabilities::glsl), and gl.shaders now means both. arigl in a window has all three; arigl --terminal has gl.scene.shaders only; ari has none. - ari/arigl info: the token column is two wider, so the 16-character tokens line up. - Tests: the tokens over three host shapes, has? on the Runtime, an AppRuntime with a shader- running adapter and a terminal backend loading requires: of each token, and cvcgl_terminal_scene checks TerminalScene answers gl.scene.shaders but not gl.ui.shaders. - docs/ARIADNE.md 5.7 and the roadmap's 16.3 say which to require.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
gl.shadersread the backend'sCapabilities::glsl, so it only answered for the UI.arigl --terminalrenders the scene offscreen through GL, so a node'sshader:block runs there, but the terminal backend reportsglsl = false. A document couldn't tell "the scene runs my GLSL" apart from "nothing does".What
SceneAdapter::runs_shaders()(defaultfalse): the adapter's renderer compiles the GLSL a document gives its scene. cvcGL'sGlSceneAdapterandTerminalScenereturntrue.HostFacts::scene_shaders, whichAppRuntimesets from its adapter (Runtime::set_scene_shaders).Tokens:
--terminalgl.scene.shadersshader:blocks)gl.ui.shadersshader_canvas;Capabilities::glsl)gl.shadersgl.shadersgives the same answers as before on every current host, so existing documents behave the same.ari info/arigl info: the token column is two characters wider, so the 16-character tokens line up.Docs:
docs/ARIADNE.md§5.7 says which token to require; the roadmap's §16.3 is updated to match.Tests
SceneShadersAndUiShadersAreSeparateTokens: the tokens over three host shapes (window,--terminal, ari).HasAnswersTokensFunctionsAndWidgetTypes:has?on the Runtime; scene shaders need a scene.ATerminalHostWithAGlSceneRunsSceneShadersOnly: anAppRuntimewith a shader-running adapter and a terminal backend.requires: [gl.scene.shaders]loads;gl.ui.shadersandgl.shaderseach fail, naming the token.cvcgl_terminal_scene: the realTerminalSceneanswersgl.scene.shadersbut notgl.ui.shaders.Verified
Built locally on Windows (MSVC 14.44, Release, cvcGL off):
ariadne_requires_test13 passed and 2 skipped, andariadne_loader_test198 of 198 passed. The two skips are existing tests that need FTXUI, which that configure didn't have. The cvcGL changes (the two overrides and thecvcgl_terminal_scenecheck) were not compiled locally; CI is their first build.Follow-up
Once #898 merges,
lsystem_forest.ari(which usesshader: { preset: ... }) can listgl.scene.shaders.