panfrost: Rip out primconvert code

This is handled in common Gallium code if we set the appropriate CAP.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12509>
This commit is contained in:
Alyssa Rosenzweig
2021-08-23 12:10:53 -04:00
committed by Marge Bot
parent 2d31d469f7
commit 0606af1d4a
4 changed files with 13 additions and 33 deletions
@@ -31,7 +31,6 @@
#include "util/u_memory.h"
#include "pipe/p_defines.h"
#include "pipe/p_state.h"
#include "indices/u_primconvert.h"
#include "gallium/auxiliary/util/u_blend.h"
#include "panfrost-quirks.h"
@@ -2751,18 +2750,6 @@ panfrost_direct_draw(struct panfrost_batch *batch,
struct panfrost_context *ctx = batch->ctx;
/* Fallback for unsupported modes */
if (!(ctx->draw_modes & BITFIELD_BIT(info->mode))) {
if (draw->count < 4) {
/* Degenerate case? */
return;
}
util_primconvert_save_rasterizer_state(ctx->primconvert, &ctx->rasterizer->base);
util_primconvert_draw_vbo(ctx->primconvert, info, drawid_offset, NULL, draw, 1);
return;
}
/* Take into account a negative bias */
ctx->indirect_draw = false;
ctx->vertex_count = draw->count + (info->index_size ? abs(draw->index_bias) : 0);
@@ -2864,7 +2851,6 @@ panfrost_indirect_draw(struct panfrost_batch *batch,
/* TODO: Increment transform feedback offsets */
assert(ctx->streamout.num_targets == 0);
assert(ctx->draw_modes & (1 << info->mode));
ctx->active_prim = info->mode;
ctx->drawid = drawid_offset;
ctx->indirect_draw = true;
@@ -44,7 +44,6 @@
#include "util/format/u_format.h"
#include "util/u_prim.h"
#include "util/u_prim_restart.h"
#include "indices/u_primconvert.h"
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_from_mesa.h"
#include "util/u_math.h"
@@ -802,8 +801,6 @@ panfrost_destroy(struct pipe_context *pipe)
panfrost_pool_cleanup(&panfrost->descs);
panfrost_pool_cleanup(&panfrost->shaders);
util_primconvert_destroy(panfrost->primconvert);
ralloc_free(pipe);
}
@@ -1116,18 +1113,6 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags)
panfrost_pool_init(&ctx->shaders, ctx, dev,
PAN_BO_EXECUTE, 4096, "Shaders", true, false);
/* All of our GPUs support ES mode. Midgard supports additionally
* QUADS/QUAD_STRIPS/POLYGON. Bifrost supports just QUADS. */
ctx->draw_modes = (1 << (PIPE_PRIM_QUADS + 1)) - 1;
if (!pan_is_bifrost(dev)) {
ctx->draw_modes |= (1 << PIPE_PRIM_QUAD_STRIP);
ctx->draw_modes |= (1 << PIPE_PRIM_POLYGON);
}
ctx->primconvert = util_primconvert_create(gallium, ctx->draw_modes);
ctx->blitter = util_blitter_create(gallium);
assert(ctx->blitter);
@@ -148,9 +148,6 @@ struct panfrost_context {
/* Within a launch_grid call.. */
const struct pipe_grid_info *compute_grid;
/* Bit mask for supported PIPE_DRAW for this hardware */
unsigned draw_modes;
struct pipe_framebuffer_state pipe_framebuffer;
struct panfrost_streamout streamout;
@@ -198,7 +195,6 @@ struct panfrost_context {
struct panfrost_sampler_view *sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SHADER_SAMPLER_VIEWS];
unsigned sampler_view_count[PIPE_SHADER_TYPES];
struct primconvert_context *primconvert;
struct blitter_context *blitter;
struct panfrost_blend_state *blend;
+13
View File
@@ -309,6 +309,19 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_DRAW_PARAMETERS:
return pan_is_bifrost(dev);
case PIPE_CAP_SUPPORTED_PRIM_MODES:
case PIPE_CAP_SUPPORTED_PRIM_MODES_WITH_RESTART: {
/* Mali supports GLES and QUADS. Midgard supports more */
uint32_t modes = BITFIELD_MASK(PIPE_PRIM_QUADS + 1);
if (dev->arch <= 5) {
modes |= BITFIELD_BIT(PIPE_PRIM_QUAD_STRIP);
modes |= BITFIELD_BIT(PIPE_PRIM_POLYGON);
}
return modes;
}
default:
return u_pipe_screen_get_param_defaults(screen, param);
}