summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mesa/src/gallium/tests')
-rw-r--r--lib/mesa/src/gallium/tests/graw/fs-test.c6
-rw-r--r--lib/mesa/src/gallium/tests/graw/gs-test.c6
-rw-r--r--lib/mesa/src/gallium/tests/graw/quad-sample.c6
-rw-r--r--lib/mesa/src/gallium/tests/graw/quad-tex.c2
-rw-r--r--lib/mesa/src/gallium/tests/graw/tex-srgb.c4
-rw-r--r--lib/mesa/src/gallium/tests/graw/tex-swizzle.c2
-rw-r--r--lib/mesa/src/gallium/tests/graw/tri-instanced.c5
-rw-r--r--lib/mesa/src/gallium/tests/graw/vs-test.c6
-rw-r--r--lib/mesa/src/gallium/tests/trivial/compute.c21
-rw-r--r--lib/mesa/src/gallium/tests/trivial/quad-tex.c6
10 files changed, 35 insertions, 29 deletions
diff --git a/lib/mesa/src/gallium/tests/graw/fs-test.c b/lib/mesa/src/gallium/tests/graw/fs-test.c
index f9bddccda..b4ddfb609 100644
--- a/lib/mesa/src/gallium/tests/graw/fs-test.c
+++ b/lib/mesa/src/gallium/tests/graw/fs-test.c
@@ -331,7 +331,7 @@ static void init_tex( void )
{
struct pipe_transfer *t;
uint32_t *ptr;
- ptr = pipe_transfer_map(ctx, samptex,
+ ptr = pipe_texture_map(ctx, samptex,
0, 0, /* level, layer */
PIPE_MAP_READ,
0, 0, SIZE, SIZE, &t); /* x, y, width, height */
@@ -341,7 +341,7 @@ static void init_tex( void )
exit(9);
}
- ctx->transfer_unmap(ctx, t);
+ ctx->texture_unmap(ctx, t);
}
memset(&sv_template, 0, sizeof sv_template);
@@ -355,7 +355,7 @@ static void init_tex( void )
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
diff --git a/lib/mesa/src/gallium/tests/graw/gs-test.c b/lib/mesa/src/gallium/tests/graw/gs-test.c
index 4d8f5c31f..cd6bdec98 100644
--- a/lib/mesa/src/gallium/tests/graw/gs-test.c
+++ b/lib/mesa/src/gallium/tests/graw/gs-test.c
@@ -421,7 +421,7 @@ static void init_tex( void )
{
struct pipe_transfer *t;
uint32_t *ptr;
- ptr = pipe_transfer_map(ctx, samptex,
+ ptr = pipe_texture_map(ctx, samptex,
0, 0, /* level, layer */
PIPE_MAP_READ,
0, 0, SIZE, SIZE, &t); /* x, y, width, height */
@@ -431,7 +431,7 @@ static void init_tex( void )
exit(9);
}
- ctx->transfer_unmap(ctx, t);
+ ctx->texture_unmap(ctx, t);
}
memset(&sv_template, 0, sizeof sv_template);
@@ -445,7 +445,7 @@ static void init_tex( void )
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
diff --git a/lib/mesa/src/gallium/tests/graw/quad-sample.c b/lib/mesa/src/gallium/tests/graw/quad-sample.c
index 912df7e7a..436674635 100644
--- a/lib/mesa/src/gallium/tests/graw/quad-sample.c
+++ b/lib/mesa/src/gallium/tests/graw/quad-sample.c
@@ -246,7 +246,7 @@ static void init_tex( void )
{
struct pipe_transfer *t;
uint32_t *ptr;
- ptr = pipe_transfer_map(ctx, samptex,
+ ptr = pipe_texture_map(ctx, samptex,
0, 0, /* level, layer */
PIPE_MAP_READ,
0, 0, SIZE, SIZE, &t); /* x, y, width, height */
@@ -256,7 +256,7 @@ static void init_tex( void )
exit(9);
}
- ctx->transfer_unmap(ctx, t);
+ ctx->texture_unmap(ctx, t);
}
memset(&sv_template, 0, sizeof sv_template);
@@ -270,7 +270,7 @@ static void init_tex( void )
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
diff --git a/lib/mesa/src/gallium/tests/graw/quad-tex.c b/lib/mesa/src/gallium/tests/graw/quad-tex.c
index 5eb1ae59e..3c78b3550 100644
--- a/lib/mesa/src/gallium/tests/graw/quad-tex.c
+++ b/lib/mesa/src/gallium/tests/graw/quad-tex.c
@@ -168,7 +168,7 @@ static void init_tex( void )
PIPE_FORMAT_B8G8R8A8_UNORM, tex2d);
sv = graw_util_create_simple_sampler_view(&info, texture);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &sv);
sampler = graw_util_create_simple_sampler(&info,
PIPE_TEX_WRAP_REPEAT,
diff --git a/lib/mesa/src/gallium/tests/graw/tex-srgb.c b/lib/mesa/src/gallium/tests/graw/tex-srgb.c
index cf9a2a14b..0d3e9ba15 100644
--- a/lib/mesa/src/gallium/tests/graw/tex-srgb.c
+++ b/lib/mesa/src/gallium/tests/graw/tex-srgb.c
@@ -129,11 +129,11 @@ static void draw( void )
info.ctx->clear(info.ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &linear_sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &linear_sv);
set_vertices(vertices1, 4);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &srgb_sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &srgb_sv);
set_vertices(vertices2, 4);
util_draw_arrays(info.ctx, PIPE_PRIM_QUADS, 0, 4);
diff --git a/lib/mesa/src/gallium/tests/graw/tex-swizzle.c b/lib/mesa/src/gallium/tests/graw/tex-swizzle.c
index fa5a3e8e5..a522a2e01 100644
--- a/lib/mesa/src/gallium/tests/graw/tex-swizzle.c
+++ b/lib/mesa/src/gallium/tests/graw/tex-swizzle.c
@@ -147,7 +147,7 @@ init_tex(const unsigned swizzle[4])
if (sv == NULL)
exit(5);
- info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
+ info.ctx->set_sampler_views(info.ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &sv);
sampler = graw_util_create_simple_sampler(&info,
PIPE_TEX_WRAP_REPEAT,
diff --git a/lib/mesa/src/gallium/tests/graw/tri-instanced.c b/lib/mesa/src/gallium/tests/graw/tri-instanced.c
index 8ddd26679..66f7d1b22 100644
--- a/lib/mesa/src/gallium/tests/graw/tri-instanced.c
+++ b/lib/mesa/src/gallium/tests/graw/tri-instanced.c
@@ -192,7 +192,7 @@ static void draw( void )
{
union pipe_color_union clear_color = { {1,0,1,1} };
struct pipe_draw_info info;
- struct pipe_draw_start_count draw;
+ struct pipe_draw_start_count_bias draw;
ctx->clear(ctx, PIPE_CLEAR_COLOR, NULL, &clear_color, 0, 0);
@@ -202,6 +202,7 @@ static void draw( void )
info.mode = PIPE_PRIM_TRIANGLES;
draw.start = 0;
draw.count = 3;
+ draw.index_bias = 0;
/* draw NUM_INST triangles */
info.instance_count = NUM_INST;
@@ -215,7 +216,7 @@ static void draw( void )
indices);
}
- ctx->draw_vbo(ctx, &info, NULL, &draw, 1);
+ ctx->draw_vbo(ctx, &info, 0, NULL, &draw, 1);
pipe_resource_reference(&info.index.resource, NULL);
diff --git a/lib/mesa/src/gallium/tests/graw/vs-test.c b/lib/mesa/src/gallium/tests/graw/vs-test.c
index 23e642b47..215a756bb 100644
--- a/lib/mesa/src/gallium/tests/graw/vs-test.c
+++ b/lib/mesa/src/gallium/tests/graw/vs-test.c
@@ -319,7 +319,7 @@ static void init_tex( void )
{
struct pipe_transfer *t;
uint32_t *ptr;
- ptr = pipe_transfer_map(ctx, samptex,
+ ptr = pipe_texture_map(ctx, samptex,
0, 0, /* level, layer */
PIPE_MAP_READ,
0, 0, SIZE, SIZE, &t); /* x, y, width, height */
@@ -329,7 +329,7 @@ static void init_tex( void )
exit(9);
}
- ctx->transfer_unmap(ctx, t);
+ ctx->texture_unmap(ctx, t);
}
memset(&sv_template, 0, sizeof sv_template);
@@ -343,7 +343,7 @@ static void init_tex( void )
if (sv == NULL)
exit(5);
- ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, &sv);
+ ctx->set_sampler_views(ctx, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &sv);
memset(&sampler_desc, 0, sizeof sampler_desc);
diff --git a/lib/mesa/src/gallium/tests/trivial/compute.c b/lib/mesa/src/gallium/tests/trivial/compute.c
index a1ca7f3c3..2fd475664 100644
--- a/lib/mesa/src/gallium/tests/trivial/compute.c
+++ b/lib/mesa/src/gallium/tests/trivial/compute.c
@@ -204,7 +204,7 @@ static void init_tex(struct context *ctx, int slot,
*tex = ctx->screen->resource_create(ctx->screen, &ttex);
assert(*tex);
- map = pipe->transfer_map(pipe, *tex, 0, PIPE_MAP_WRITE,
+ map = pipe->texture_map(pipe, *tex, 0, PIPE_MAP_WRITE,
&(struct pipe_box) { .width = w,
.height = h,
.depth = 1 }, &xfer);
@@ -217,7 +217,7 @@ static void init_tex(struct context *ctx, int slot,
}
}
- pipe->transfer_unmap(pipe, xfer);
+ pipe->texture_unmap(pipe, xfer);
ctx->tex_rw[slot] = rw;
}
@@ -246,7 +246,7 @@ static void check_tex(struct context *ctx, int slot,
if (!check)
check = default_check;
- map = pipe->transfer_map(pipe, tex, 0, PIPE_MAP_READ,
+ map = pipe->texture_map(pipe, tex, 0, PIPE_MAP_READ,
&(struct pipe_box) { .width = tex->width0,
.height = tex->height0,
.depth = 1 }, &xfer);
@@ -282,7 +282,7 @@ static void check_tex(struct context *ctx, int slot,
}
}
- pipe->transfer_unmap(pipe, xfer);
+ pipe->texture_unmap(pipe, xfer);
if (err)
printf("(%d, %d): \x1b[31mFAIL\x1b[0m (%d)\n", x, y, err);
@@ -315,7 +315,7 @@ static void init_sampler_views(struct context *ctx, const int *slots)
assert(ctx->view[i]);
}
- pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, 0, ctx->view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, 0, false, ctx->view);
}
static void destroy_sampler_views(struct context *ctx)
@@ -323,7 +323,7 @@ static void destroy_sampler_views(struct context *ctx)
struct pipe_context *pipe = ctx->pipe;
int i;
- pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, 0, MAX_RESOURCES, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, 0, MAX_RESOURCES, false, NULL);
for (i = 0; i < MAX_RESOURCES; ++i) {
if (ctx->view[i]) {
@@ -1203,6 +1203,11 @@ static void test_surface_st_expectu(void *p, int s, int x, int y)
util_format_pack_rgba(surface_fmts[i], p, v, 1);
}
+static unsigned absdiff(uint32_t a, uint32_t b)
+{
+ return (a > b) ? (a - b) : (b - a);
+}
+
static bool test_surface_st_check(void *x, void *y, int sz)
{
int i = 0, j;
@@ -1212,8 +1217,8 @@ static bool test_surface_st_check(void *x, void *y, int sz)
} else if ((sz % 4) == 0) {
for (j = 0; j < sz / 4; j++)
- if (abs(((uint32_t *)x)[j] -
- ((uint32_t *)y)[j]) > 1)
+ if (absdiff(((uint32_t *)x)[j],
+ ((uint32_t *)y)[j]) > 1)
return false;
return true;
} else {
diff --git a/lib/mesa/src/gallium/tests/trivial/quad-tex.c b/lib/mesa/src/gallium/tests/trivial/quad-tex.c
index 79e9c39ca..2578fb573 100644
--- a/lib/mesa/src/gallium/tests/trivial/quad-tex.c
+++ b/lib/mesa/src/gallium/tests/trivial/quad-tex.c
@@ -177,12 +177,12 @@ static void init_prog(struct program *p)
box.height = 2;
box.depth = 1;
- ptr = p->pipe->transfer_map(p->pipe, p->tex, 0, PIPE_MAP_WRITE, &box, &t);
+ ptr = p->pipe->texture_map(p->pipe, p->tex, 0, PIPE_MAP_WRITE, &box, &t);
ptr[0] = 0xffff0000;
ptr[1] = 0xff0000ff;
ptr[2] = 0xff00ff00;
ptr[3] = 0xffffff00;
- p->pipe->transfer_unmap(p->pipe, t);
+ p->pipe->texture_unmap(p->pipe, t);
u_sampler_view_default_template(&v_tmplt, p->tex, p->tex->format);
@@ -327,7 +327,7 @@ static void draw(struct program *p)
cso_set_samplers(p->cso, PIPE_SHADER_FRAGMENT, 1, samplers);
/* texture sampler view */
- p->pipe->set_sampler_views(p->pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, &p->view);
+ p->pipe->set_sampler_views(p->pipe, PIPE_SHADER_FRAGMENT, 0, 1, 0, false, &p->view);
/* shaders */
cso_set_fragment_shader_handle(p->cso, p->fs);