Module: Mesa
Branch: master
Commit: df48267c65f1247b21f379e3a758bb5ddf7ade37
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=df48267c65f1247b21f379e3a758bb5ddf7ade37

Author: Marek Olšák <[email protected]>
Date:   Sun Feb  7 19:12:19 2021 -0500

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 <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8906>

---

 src/gallium/auxiliary/util/u_tests.c | 8 ++++++--
 1 file 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);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to