Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test parallel compilation of many small programs. #3597

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions sdk/tests/conformance/extensions/khr-parallel-shader-compile.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,32 @@
testPassed(`COMPLETION_STATUS_KHR sucessfully transitioned from false to true`);
}

debug("Checking that compiling lots of programs in parallel eventually completes.");
let programs = [];
for (let i = 0; i < 256; ++i) {
gl.shaderSource(vs, vertexSource());
gl.shaderSource(fs, fragmentSource());
gl.compileShader(vs);
gl.compileShader(fs);
let program = gl.createProgram();
gl.attachShader(program, vs);
gl.attachShader(program, fs);
gl.linkProgram(program);
programs.push(program);
}
let allDone = false;
while (!allDone) {
allDone = true;
for (let i = 0; i < programs.length; ++i) {
if (!gl.getProgramParameter(programs[i], COMPLETION_STATUS_KHR)) {
allDone = false;
break;
}
}
if (!allDone) {
await new Promise(requestAnimationFrame);
}
}

debug("Checking that status is true when context is lost.");
if (loseContext) {
Expand Down
Loading