-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compat: refactor state_tracking test for 0 frag buffers.
This is a first attempt. Feel free to push back and/or give ideas. The original tests use 2 read-only-storage buffers and 1 read-write storage buffer. Each has a single i32 in it and generally they substract the first 2 from the 2nd. Storage buffers in the fragment stage might not exist on some compat devices so the question is how to work around that and still test. This solution is to add subcases, `storage` and `uniform`. The `storage` case is unchanged. The compute pass case will run in compat always. The render pass and render bundle cases only run in compat if the device supports storage buffers in the fragment stage. The uniform cases use 2 uniform buffers and render to a single pixel r32sint texture. They then copy that texture to the `out` buffer that the original test was checking. This path needs no storage buffers in the fragment shader and so always runs. This works but it's effectively only checking 2 bindings, not 3. So, the question is, should I add 3rd buffer and change the algo to out = a - b - c etc.... so that we can shuffle more bindings? Or is this good enough? Or should I do something completely different. Also note: the last test 'compatible_pipelines' is unchagned and so only runs the comput pass unless the device supports storage buffers in fragment shaders. I didn't update it yet because for it to work requires either (a) two render passes to render to 2 different render targets. Or it needs some viewport settings to render to 2 different pixels in the same target. Or something..., all of which seem like the might require some big refactors. In the `createEncoder` infra in gpu_test.ts or else they'd just have to do their own thing entirely. Maybe that change doesn't need to happen in this PR but ideas are welcome.
- Loading branch information
Showing
3 changed files
with
245 additions
and
65 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.