Skip to content

Commit

Permalink
add some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishavlin committed Jun 28, 2024
1 parent 470f096 commit 60ef4e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions yt_idv/shader_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ class Shader(traitlets.HasTraits):
This can either be a string containing a full source of a shader,
an absolute path to a source file or a filename of a shader
residing in the ./shaders/ directory.
allow_null : bool
If True (default) then shader compilation errors will be caught and
printed without raising exception (convenient for general use and for
developing new shaders). If False, any compilation errors will raise
a RunTimeError (useful for CI testing).
"""

Expand Down
4 changes: 4 additions & 0 deletions yt_idv/tests/test_yt_idv.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@ def test_curves(osmesa_fake_amr, image_store):

@pytest.fixture()
def set_very_bad_shader():
# this temporarily points the default vertex shader source file to a
# bad shader that will raise compilation errors.
known_shaders = shader_objects.known_shaders
good_shader = known_shaders["vertex"]["default"]["source"]
known_shaders["vertex"]["default"]["source"] = "bad_shader.vert.glsl"
Expand All @@ -171,6 +173,8 @@ def set_very_bad_shader():


def test_bad_shader(osmesa_empty, set_very_bad_shader):
# this test is meant to check that a bad shader would indeed be caught
# by the subsequent test_shader_programs test.
shader_name = "box_outline"
program = shader_objects.component_shaders[shader_name]["default"]

Expand Down

0 comments on commit 60ef4e9

Please sign in to comment.