ctx->screen = pipe_loader_create_screen(ctx->dev, PIPE_SEARCH_DIR);
assert(ctx->screen);
- ctx->pipe = ctx->screen->context_create(ctx->screen, NULL);
+ ctx->pipe = ctx->screen->context_create(ctx->screen, NULL, 0);
assert(ctx->pipe);
DUMP_COMPUTE_PARAM(p, PIPE_COMPUTE_CAP_GRID_DIMENSION);
*tex = ctx->screen->resource_create(ctx->screen, &ttex);
assert(*tex);
- xfer = pipe->get_transfer(pipe, *tex, 0, PIPE_TRANSFER_WRITE,
+ map = pipe->transfer_map(pipe, *tex, 0, PIPE_TRANSFER_WRITE,
&(struct pipe_box) { .width = w,
.height = h,
- .depth = 1 });
+ .depth = 1 }, &xfer);
assert(xfer);
-
- map = pipe->transfer_map(pipe, xfer);
assert(map);
for (y = 0; y < ny; ++y) {
}
pipe->transfer_unmap(pipe, xfer);
- pipe->transfer_destroy(pipe, xfer);
ctx->tex_rw[slot] = rw;
}
if (!check)
check = default_check;
- xfer = pipe->get_transfer(pipe, tex, 0, PIPE_TRANSFER_READ,
+ map = pipe->transfer_map(pipe, tex, 0, PIPE_TRANSFER_READ,
&(struct pipe_box) { .width = tex->width0,
.height = tex->height0,
- .depth = 1 });
+ .depth = 1 }, &xfer);
assert(xfer);
-
- map = pipe->transfer_map(pipe, xfer);
assert(map);
for (y = 0; y < ny; ++y) {
}
pipe->transfer_unmap(pipe, xfer);
- pipe->transfer_destroy(pipe, xfer);
if (err)
printf("(%d, %d): \x1b[31mFAIL\x1b[0m (%d)\n", x, y, err);
assert(ctx->view[i]);
}
- pipe->set_compute_sampler_views(pipe, 0, i, ctx->view);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, i, ctx->view);
}
static void destroy_sampler_views(struct context *ctx)
struct pipe_context *pipe = ctx->pipe;
int i;
- pipe->set_compute_sampler_views(pipe, 0, MAX_RESOURCES, NULL);
+ pipe->set_sampler_views(pipe, PIPE_SHADER_COMPUTE, 0, MAX_RESOURCES, NULL);
for (i = 0; i < MAX_RESOURCES; ++i) {
if (ctx->view[i]) {
for (i = 0; *slots >= 0; ++i, ++slots) {
struct pipe_surface tsurf = {
.format = ctx->tex[*slots]->format,
- .usage = ctx->tex[*slots]->bind,
.writable = ctx->tex_rw[*slots]
};
assert(ctx->hwsmp[i]);
}
- pipe->bind_compute_sampler_states(pipe, 0, i, ctx->hwsmp);
+ pipe->bind_sampler_states(pipe, PIPE_SHADER_COMPUTE, 0, i, ctx->hwsmp);
}
static void destroy_sampler_states(struct context *ctx)
struct pipe_context *pipe = ctx->pipe;
int i;
- pipe->bind_compute_sampler_states(pipe, 0, MAX_RESOURCES, NULL);
+ pipe->bind_sampler_states(pipe, PIPE_SHADER_COMPUTE,
+ 0, MAX_RESOURCES, NULL);
for (i = 0; i < MAX_RESOURCES; ++i) {
if (ctx->hwsmp[i]) {
printf(" - %s\n", util_format_name(surface_fmts[i]));
+ if (!ctx->screen->is_format_supported(ctx->screen,
+ surface_fmts[i], PIPE_TEXTURE_2D, 1,
+ PIPE_BIND_COMPUTE_RESOURCE)) {
+ printf("(unsupported)\n");
+ continue;
+ }
+
init_tex(ctx, 0, PIPE_TEXTURE_2D, true, surface_fmts[i],
128, 32, (is_int ? init0i : init0f));
init_tex(ctx, 1, PIPE_TEXTURE_2D, true, PIPE_FORMAT_R32_FLOAT,
printf(" - %s\n", util_format_name(surface_fmts[i]));
+ if (!ctx->screen->is_format_supported(ctx->screen,
+ surface_fmts[i], PIPE_TEXTURE_2D, 1,
+ PIPE_BIND_COMPUTE_RESOURCE)) {
+ printf("(unsupported)\n");
+ continue;
+ }
+
init_tex(ctx, 0, PIPE_TEXTURE_2D, true, PIPE_FORMAT_R32_FLOAT,
512, 32, (is_int ? init0i : init0f));
init_tex(ctx, 1, PIPE_TEXTURE_2D, true, surface_fmts[i],
{
struct context *ctx = CALLOC_STRUCT(context);
+ unsigned tests = (argc > 1) ? strtoul(argv[1], NULL, 0) : ~0;
+
init_ctx(ctx);
- test_system_values(ctx);
- test_resource_access(ctx);
- test_function_calls(ctx);
- test_input_global(ctx);
- test_private(ctx);
- test_local(ctx);
- test_sample(ctx);
- test_many_kern(ctx);
- test_constant(ctx);
- test_resource_indirect(ctx);
- test_surface_ld(ctx);
- test_surface_st(ctx);
- test_barrier(ctx);
- test_atom_ops(ctx, true);
- test_atom_race(ctx, true);
- test_atom_ops(ctx, false);
- test_atom_race(ctx, false);
+
+ if (tests & (1 << 0))
+ test_system_values(ctx);
+ if (tests & (1 << 1))
+ test_resource_access(ctx);
+ if (tests & (1 << 2))
+ test_function_calls(ctx);
+ if (tests & (1 << 3))
+ test_input_global(ctx);
+ if (tests & (1 << 4))
+ test_private(ctx);
+ if (tests & (1 << 5))
+ test_local(ctx);
+ if (tests & (1 << 6))
+ test_sample(ctx);
+ if (tests & (1 << 7))
+ test_many_kern(ctx);
+ if (tests & (1 << 8))
+ test_constant(ctx);
+ if (tests & (1 << 9))
+ test_resource_indirect(ctx);
+ if (tests & (1 << 10))
+ test_surface_ld(ctx);
+ if (tests & (1 << 11))
+ test_surface_st(ctx);
+ if (tests & (1 << 12))
+ test_barrier(ctx);
+ if (tests & (1 << 13))
+ test_atom_ops(ctx, true);
+ if (tests & (1 << 14))
+ test_atom_race(ctx, true);
+ if (tests & (1 << 15))
+ test_atom_ops(ctx, false);
+ if (tests & (1 << 16))
+ test_atom_race(ctx, false);
+
destroy_ctx(ctx);
return 0;