etnaviv: Don't emit boilerplate for compute only contexts

The blob just emits the VIVS_GL_API_MODE and VIVS_PA_SYSTEM_MODE state
changes in a single job before any other jobs.

Reviewed-by: Christian Gmeiner <cgmeiner@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25714>
This commit is contained in:
Tomeu Vizoso
2023-11-15 09:10:32 +01:00
committed by Marge Bot
parent 30a8c071e9
commit f014f1bba9
2 changed files with 15 additions and 0 deletions

View File

@@ -436,6 +436,17 @@ etna_reset_gpu_state(struct etna_context *ctx)
struct etna_screen *screen = ctx->screen; struct etna_screen *screen = ctx->screen;
uint32_t dummy_attribs[VIVS_NFE_GENERIC_ATTRIB__LEN] = { 0 }; uint32_t dummy_attribs[VIVS_NFE_GENERIC_ATTRIB__LEN] = { 0 };
if (ctx->compute_only) {
/* compute only context does not make use of any of the dirty state tracking. */
assert(ctx->dirty == 0);
assert(ctx->dirty_sampler_views == 0);
assert(ctx->prev_active_samplers == 0);
etna_cmd_stream_mark_end_of_context_init(stream);
return;
}
etna_set_state(stream, VIVS_GL_API_MODE, VIVS_GL_API_MODE_OPENGL); etna_set_state(stream, VIVS_GL_API_MODE, VIVS_GL_API_MODE_OPENGL);
etna_set_state(stream, VIVS_PA_W_CLIP_LIMIT, 0x34000001); etna_set_state(stream, VIVS_PA_W_CLIP_LIMIT, 0x34000001);
etna_set_state(stream, VIVS_PA_FLAGS, 0x00000000); /* blob sets ZCONVERT_BYPASS on GC3000+, this messes up z for us */ etna_set_state(stream, VIVS_PA_FLAGS, 0x00000000); /* blob sets ZCONVERT_BYPASS on GC3000+, this messes up z for us */
@@ -645,6 +656,8 @@ etna_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
/* need some sane default in case gallium frontends don't set some state: */ /* need some sane default in case gallium frontends don't set some state: */
ctx->sample_mask = 0xffff; ctx->sample_mask = 0xffff;
ctx->compute_only = flags & PIPE_CONTEXT_COMPUTE_ONLY;
/* Set sensible defaults for state */ /* Set sensible defaults for state */
etna_reset_gpu_state(ctx); etna_reset_gpu_state(ctx);

View File

@@ -206,6 +206,8 @@ struct etna_context {
bool is_noop; bool is_noop;
bool compute_only;
/* conditional rendering */ /* conditional rendering */
struct pipe_query *cond_query; struct pipe_query *cond_query;
bool cond_cond; /* inverted rendering condition */ bool cond_cond; /* inverted rendering condition */