summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2021-02-07 19:12:19 -0500
committerMarge Bot <eric+marge@anholt.net>2021-02-09 02:37:50 +0000
commitdf48267c65f1247b21f379e3a758bb5ddf7ade37 (patch)
treee3e6c16f67c00abd6d24ce9f46a5999ae966493b
parent974c4a17001bb27673c39048a335c5f3141acbfd (diff)
gallium/u_tests: test no-op fragment shader instead of NULL fragment shader
radeonsi stopped supporting NULL fragment shaders. This makes the test pass. Reviewed-by: Gert Wollny <gert.wollny@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8906>
-rw-r--r--src/gallium/auxiliary/util/u_tests.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c
index 47f479c435a..e94174554ef 100644
--- a/src/gallium/auxiliary/util/u_tests.c
+++ b/src/gallium/auxiliary/util/u_tests.c
@@ -473,7 +473,7 @@ util_test_constant_buffer(struct pipe_context *ctx,
}
static void
-null_fragment_shader(struct pipe_context *ctx)
+disabled_fragment_shader(struct pipe_context *ctx)
{
struct cso_context *cso;
struct pipe_resource *cb;
@@ -493,6 +493,9 @@ null_fragment_shader(struct pipe_context *ctx)
vs = util_set_passthrough_vertex_shader(cso, ctx, false);
+ void *fs = util_make_empty_fragment_shader(ctx);
+ cso_set_fragment_shader_handle(cso, fs);
+
query = ctx->create_query(ctx, PIPE_QUERY_PRIMITIVES_GENERATED, 0);
ctx->begin_query(ctx, query);
util_draw_fullscreen_quad(cso);
@@ -502,6 +505,7 @@ null_fragment_shader(struct pipe_context *ctx)
/* Cleanup. */
cso_destroy_context(cso);
ctx->delete_vs_state(ctx, vs);
+ ctx->delete_fs_state(ctx, fs);
ctx->destroy_query(ctx, query);
pipe_resource_reference(&cb, NULL);
@@ -1024,7 +1028,7 @@ util_run_tests(struct pipe_screen *screen)
{
struct pipe_context *ctx = screen->context_create(screen, NULL, 0);
- null_fragment_shader(ctx);
+ disabled_fragment_shader(ctx);
tgsi_vs_window_space_position(ctx);
null_sampler_view(ctx, TGSI_TEXTURE_2D);
null_sampler_view(ctx, TGSI_TEXTURE_BUFFER);