mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
asahi: Add real per-stage dirty flags
Instead of just using ~0 as a stub todo. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24847>
This commit is contained in:
parent
9a60478966
commit
9fa5dec767
2 changed files with 14 additions and 7 deletions
|
|
@ -86,7 +86,7 @@ agx_set_shader_images(struct pipe_context *pctx, enum pipe_shader_type shader,
|
||||||
const struct pipe_image_view *iviews)
|
const struct pipe_image_view *iviews)
|
||||||
{
|
{
|
||||||
struct agx_context *ctx = agx_context(pctx);
|
struct agx_context *ctx = agx_context(pctx);
|
||||||
ctx->stage[shader].dirty = ~0;
|
ctx->stage[shader].dirty |= AGX_STAGE_DIRTY_IMAGE;
|
||||||
|
|
||||||
/* Unbind start_slot...start_slot+count */
|
/* Unbind start_slot...start_slot+count */
|
||||||
if (!iviews) {
|
if (!iviews) {
|
||||||
|
|
@ -155,7 +155,7 @@ agx_set_shader_buffers(struct pipe_context *pctx, enum pipe_shader_type shader,
|
||||||
&ctx->stage[shader].ssbo_mask, buffers, start,
|
&ctx->stage[shader].ssbo_mask, buffers, start,
|
||||||
count);
|
count);
|
||||||
|
|
||||||
ctx->stage[shader].dirty = ~0;
|
ctx->stage[shader].dirty |= AGX_STAGE_DIRTY_SSBO;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -529,7 +529,7 @@ agx_bind_sampler_states(struct pipe_context *pctx, enum pipe_shader_type shader,
|
||||||
{
|
{
|
||||||
struct agx_context *ctx = agx_context(pctx);
|
struct agx_context *ctx = agx_context(pctx);
|
||||||
|
|
||||||
ctx->stage[shader].dirty = ~0;
|
ctx->stage[shader].dirty |= AGX_STAGE_DIRTY_SAMPLER;
|
||||||
|
|
||||||
for (unsigned i = 0; i < count; i++) {
|
for (unsigned i = 0; i < count; i++) {
|
||||||
unsigned p = start + i;
|
unsigned p = start + i;
|
||||||
|
|
@ -812,7 +812,7 @@ agx_set_sampler_views(struct pipe_context *pctx, enum pipe_shader_type shader,
|
||||||
(struct pipe_sampler_view **)&ctx->stage[shader].textures[i], NULL);
|
(struct pipe_sampler_view **)&ctx->stage[shader].textures[i], NULL);
|
||||||
}
|
}
|
||||||
ctx->stage[shader].texture_count = new_nr;
|
ctx->stage[shader].texture_count = new_nr;
|
||||||
ctx->stage[shader].dirty = ~0;
|
ctx->stage[shader].dirty |= AGX_STAGE_DIRTY_IMAGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -1286,7 +1286,7 @@ agx_set_constant_buffer(struct pipe_context *pctx, enum pipe_shader_type shader,
|
||||||
else
|
else
|
||||||
s->cb_mask &= ~mask;
|
s->cb_mask &= ~mask;
|
||||||
|
|
||||||
ctx->stage[shader].dirty = ~0;
|
ctx->stage[shader].dirty |= AGX_STAGE_DIRTY_CONST;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -2181,10 +2181,10 @@ agx_update_descriptors(struct agx_batch *batch, struct agx_compiled_shader *cs,
|
||||||
{
|
{
|
||||||
struct agx_context *ctx = batch->ctx;
|
struct agx_context *ctx = batch->ctx;
|
||||||
|
|
||||||
/* TODO: Dirty track more finely */
|
if (ctx->stage[stage].dirty & AGX_STAGE_DIRTY_IMAGE)
|
||||||
if (ctx->stage[stage].dirty) {
|
|
||||||
agx_upload_textures(batch, cs, stage);
|
agx_upload_textures(batch, cs, stage);
|
||||||
|
|
||||||
|
if (ctx->stage[stage].dirty) {
|
||||||
batch->tables[AGX_SYSVAL_STAGE(stage)] =
|
batch->tables[AGX_SYSVAL_STAGE(stage)] =
|
||||||
agx_upload_stage_uniforms(batch, batch->textures[stage], stage);
|
agx_upload_stage_uniforms(batch, batch->textures[stage], stage);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -208,6 +208,13 @@ struct agx_uncompiled_shader {
|
||||||
unsigned base_varying;
|
unsigned base_varying;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum agx_stage_dirty {
|
||||||
|
AGX_STAGE_DIRTY_CONST = BITFIELD_BIT(0),
|
||||||
|
AGX_STAGE_DIRTY_SSBO = BITFIELD_BIT(1),
|
||||||
|
AGX_STAGE_DIRTY_IMAGE = BITFIELD_BIT(2),
|
||||||
|
AGX_STAGE_DIRTY_SAMPLER = BITFIELD_BIT(3),
|
||||||
|
};
|
||||||
|
|
||||||
struct agx_stage {
|
struct agx_stage {
|
||||||
struct agx_uncompiled_shader *shader;
|
struct agx_uncompiled_shader *shader;
|
||||||
uint32_t dirty;
|
uint32_t dirty;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue