From 4240d2e8f566673bad785b1bf43b68712dc216c2 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 4 Feb 2015 09:38:18 +1000 Subject: [PATCH] tests: add simple 2d resource creation helper --- tests/testvirgl.c | 15 +++++++++++++++ tests/testvirgl.h | 1 + 2 files changed, 16 insertions(+) diff --git a/tests/testvirgl.c b/tests/testvirgl.c index cb910f3..4559609 100644 --- a/tests/testvirgl.c +++ b/tests/testvirgl.c @@ -35,6 +35,21 @@ void testvirgl_init_simple_1d_resource(struct virgl_renderer_resource_create_arg res->target = PIPE_TEXTURE_1D; res->format = PIPE_FORMAT_B8G8R8X8_UNORM; res->width = 50; + res->height = 1; + res->depth = 1; + res->array_size = 1; + res->last_level = 0; + res->nr_samples = 0; + res->bind = PIPE_BIND_SAMPLER_VIEW; + res->flags = 0; +} + +void testvirgl_init_simple_2d_resource(struct virgl_renderer_resource_create_args *res, int handle) +{ + res->handle = handle; + res->target = PIPE_TEXTURE_2D; + res->format = PIPE_FORMAT_B8G8R8X8_UNORM; + res->width = 50; res->height = 50; res->depth = 1; res->array_size = 1; diff --git a/tests/testvirgl.h b/tests/testvirgl.h index aa75eb8..557d4f1 100644 --- a/tests/testvirgl.h +++ b/tests/testvirgl.h @@ -28,6 +28,7 @@ #include "virglrenderer.h" void testvirgl_init_simple_1d_resource(struct virgl_renderer_resource_create_args *args, int handle); +void testvirgl_init_simple_2d_resource(struct virgl_renderer_resource_create_args *res, int handle); int testvirgl_init_single_ctx(void); void testvirgl_fini_single_ctx(void);