Skip to content

Commit

Permalink
Add multi_draw_indirect_count
Browse files Browse the repository at this point in the history
  • Loading branch information
fyellin committed Sep 19, 2024
1 parent 1625262 commit 5173abd
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions tests/test_set_override.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import wgpu.utils
from tests.testutils import can_use_wgpu_lib, run_tests
from wgpu import GPUValidationError, TextureFormat
from wgpu import TextureFormat

if not can_use_wgpu_lib:
pytest.skip("Skipping tests that need the wgpu lib", allow_module_level=True)
Expand Down Expand Up @@ -196,17 +196,19 @@ def test_override_compute_constants(runner):


def test_numbered_constants_must_be_overridden_by_number(runner):
# Note. The naga implementation ignores unknown constants passed as an override.
# The JS implementation throws an exception. The JS implementation matches the
# specification,
#
# We will test for current naga behavior, but if this test fails in the future,
# it should be replaced with something like the following:
#
# with pytest.raises(GPUValidationError):
# runner.run_test(....)
overrides = {"c": 23, "d": 24}
try:
# In naga, the bad constant is ignored.
# In the JS implementation, this throws an exception, which I think is the
# correct behavior. So just in case this ever gets fixed, we accept either.
result = runner.run_test(
render=True, vertex_constants=overrides, fragment_constants=overrides
)
except GPUValidationError:
return
assert [1, 2, 3, 0, 1, 2, 3, 0] == result
assert [1, 2, 3, 0, 1, 2, 3, 0] == runner.run_test(
render=True, vertex_constants=overrides, fragment_constants=overrides
)


if __name__ == "__main__":
Expand Down

0 comments on commit 5173abd

Please sign in to comment.