How do you guys take the screenshots for the visualization tests? Do you use the Screenshot function in the debug layer? Capture with RTT? Code snippet? Do you go to fullscreen, screenshot the whole screen and you resize the screenshot afterwards to 600x400 or is there something I am not aware of how to make the screenshot in fullscreen directly to 600x400 more easily? Must it be 600x400 or can I use a fullscreen FullHD screenshot?
EDIT:
Guys, would someone please give me detailed information how to create a new Visualization test from A to Z? The documentation is outdated and even after I created a 600x400 png (fullscreen screenshot + photoshop - I don’t even know if I need to center the image ), edited the config, I couldn’t get the tests running (wrong url in the docs). Enlighten me please! Thank you!
run visualization tests with the -u parameter. This will generate the screenshot for you. You can run your test only, but running npm run test:visualization -- -i "webgl2" -t "Your Test Name" -u
webgl2 without problems, but failed to create the screenshot on webgpu:
Evaluation failed: TypeError: navigator.gpu.getPreferredCanvasFormat is not a function
at new WebGPUEngine (../dev/core/src/Engines/webgpuEngine.ts:361:76)
at __puppeteer_evaluation_script__:52:24
at ExecutionContext._evaluateInternal (node_modules/puppeteer/src/common/ExecutionContext.ts:273:13)
at async ExecutionContext.evaluate (node_modules/puppeteer/src/common/ExecutionContext.ts:140:12)
I just changed the -i parameter to webgpu and ofcourse edited the webgpu config.
and the screenshot should probably be the same. there is no reason to generate two. so if this test is running on webgl2 - this should also fit the screenshot of webgpu
I was curios whether it’s just an issue on Mac so I’ve tried that on PC just right now. I have the most recent version of the repo, did an npm i, but no luck. Same error.
When testing for WebGPU, I have to manually change the path to Chrome in jest-puppeteer.config.js because it seems the Chrome version embedded with puppeteer does not support WebGPU.
If I want to test with Canary instead, I use the path C:/Users/micro/AppData/Local/Google/Chrome SxS/Application/chrome.exe.
Note that the image does not need to be copied in ReferenceImages/webgpu/: as your test is declared in config.json, the picture must be copied in ReferenceImages/.
This part of the doc is still relevant (except for the url) to explain what is a test list and that pictures are related to a list.
A test list is orthogonal to the engine you use to launch the tests: you can test webgpu.json with WebGL2 and config.json with WebGPU.
By default, when using WebGL2, it’s config.json that is used, and webgpu.json for WebGPU. But you can change this by editing tests/test/visualization/visualization.webgl2.test.ts or visualization.webgpu.test.ts: the second parameter of the evaluateTests call is the name of the list, without the .json part.
In any case, I think we are going to add all the tests from webgpu.json to config.json, now that the WebGPU engine is up to date.
EDIT: Just to be precise, I was trying to figure out what and where to put before I got your answers, so the image may have appeared in one of my commits in the webgpu folder as well.