radeonsi: don't allow draw calls with uninitialized VS inputs
[mesa.git] / src / gallium / drivers / radeonsi / si_test_dma.c
index ee6ab7c2cf2c9bd5a3266105ea550d740566de34..b3ab2750f25a313cfa3f8f1fe83d0699c77233f2 100644 (file)
@@ -192,11 +192,10 @@ void si_test_dma(struct si_screen *sscreen)
        struct pipe_context *ctx = screen->context_create(screen, NULL, 0);
        struct si_context *sctx = (struct si_context*)ctx;
        uint64_t max_alloc_size;
-       unsigned i, iterations, num_partial_copies, max_levels, max_tex_side;
+       unsigned i, iterations, num_partial_copies, max_tex_side;
        unsigned num_pass = 0, num_fail = 0;
 
-       max_levels = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
-       max_tex_side = 1 << (max_levels - 1);
+       max_tex_side = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE);
 
        /* Max 128 MB allowed for both textures. */
        max_alloc_size = 128 * 1024 * 1024;
@@ -224,7 +223,7 @@ void si_test_dma(struct si_screen *sscreen)
                struct si_texture *ssrc;
                struct cpu_texture src_cpu, dst_cpu;
                unsigned bpp, max_width, max_height, max_depth, j, num;
-               unsigned gfx_blits = 0, dma_blits = 0, max_tex_side_gen;
+               unsigned gfx_blits = 0, dma_blits = 0, cs_blits = 0, max_tex_side_gen;
                unsigned max_tex_layers;
                bool pass;
                bool do_partial_copies = rand() & 1;
@@ -307,7 +306,9 @@ void si_test_dma(struct si_screen *sscreen)
                set_random_pixels(ctx, src, &src_cpu);
 
                /* clear dst pixels */
-               si_clear_buffer(sctx, dst, 0, sdst->surface.surf_size, 0, true);
+               uint32_t zero = 0;
+               si_clear_buffer(sctx, dst, 0, sdst->surface.surf_size, &zero, 4,
+                               SI_COHERENCY_SHADER, false);
                memset(dst_cpu.ptr, 0, dst_cpu.layer_stride * tdst.array_size);
 
                /* preparation */
@@ -322,6 +323,7 @@ void si_test_dma(struct si_screen *sscreen)
                        struct pipe_box box;
                        unsigned old_num_draw_calls = sctx->num_draw_calls;
                        unsigned old_num_dma_calls = sctx->num_dma_calls;
+                       unsigned old_num_cs_calls = sctx->num_compute_calls;
 
                        if (!do_partial_copies) {
                                /* copy whole src to dst */
@@ -381,6 +383,7 @@ void si_test_dma(struct si_screen *sscreen)
                        /* See which engine was used. */
                        gfx_blits += sctx->num_draw_calls > old_num_draw_calls;
                        dma_blits += sctx->num_dma_calls > old_num_dma_calls;
+                       cs_blits  += sctx->num_compute_calls > old_num_cs_calls;
 
                        /* CPU copy */
                        util_copy_box(dst_cpu.ptr, tdst.format, dst_cpu.stride,
@@ -397,8 +400,8 @@ void si_test_dma(struct si_screen *sscreen)
                else
                        num_fail++;
 
-               printf("BLITs: GFX = %2u, DMA = %2u, %s [%u/%u]\n",
-                      gfx_blits, dma_blits, pass ? "pass" : "fail",
+               printf("BLITs: GFX = %2u, DMA = %2u, CS = %2u, %s [%u/%u]\n",
+                      gfx_blits, dma_blits, cs_blits, pass ? "pass" : "fail",
                       num_pass, num_pass+num_fail);
 
                /* cleanup */