summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAkihiko Odaki <akihiko.odaki@gmail.com>2022-01-12 13:23:08 +0900
committerMarge Bot <emma+marge@anholt.net>2022-03-07 15:53:57 +0000
commit8d452da88316a112785c1f8dee2b1d27211f9727 (patch)
tree86bd3a186f96339758a22884cd667796981a270a /tests
parent16ff21319d104f457953a3bc9dfdeb22afd546e3 (diff)
vrend: Check GL errors
There are many combinations of invalid arguments for OpenGL functions and it is impractical to cover all of them. Even if nothing is wrong with the user, GL_CONTEXT_LOST and GL_OUT_OF_MEMORY can also occur in many GL functions due to hardware problems. They can leave the context in an invalid state which can result in a reliability or security issue. Check GL errors after an operation completes and prevent from using the GL context after a GL error occurred. spec@!opengl 1.5@draw-vertices, spec@!opengl 1.5@draw-vertices-user, and spec@!opengl 2.0@gl-2.0-vertexattribpointer are marked as crash in .gitlab-ci/expectations/host/piglit-virgl-gles-fails.txt because they require GL_DOUBLE specification for glVertexAttribPointer, which is not supported by OpenGL ES. Avoiding the crashes requires capability checks on the guest, which this change does not implement. Signed-off-by: Akihiko Odaki <akihiko.odaki@gmail.com> Part-of: <https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/715>
Diffstat (limited to 'tests')
-rw-r--r--tests/test_virgl_transfer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/test_virgl_transfer.c b/tests/test_virgl_transfer.c
index 3c53c3d..ad15f75 100644
--- a/tests/test_virgl_transfer.c
+++ b/tests/test_virgl_transfer.c
@@ -879,7 +879,7 @@ START_TEST(virgl_test_copy_transfer_to_staging_without_iov_fails)
virgl_encoder_copy_transfer(&ctx, &dst_res, 0, 0, &box, &src_res, 0, synchronized);
ret = virgl_renderer_submit_cmd(ctx.cbuf->buf, ctx.ctx_id, ctx.cbuf->cdw);
- ck_assert_int_eq(ret, 0);
+ ck_assert_int_eq(ret, EINVAL);
virgl_renderer_ctx_detach_resource(ctx.ctx_id, src_res.handle);
virgl_renderer_ctx_detach_resource(ctx.ctx_id, dst_res.handle);