freedreno/a6xx: stop using ir3_emit_{vs,fs}_consts()
authorRob Clark <robdclark@chromium.org>
Thu, 1 Aug 2019 15:31:25 +0000 (08:31 -0700)
committerRob Clark <robdclark@chromium.org>
Tue, 13 Aug 2019 15:11:26 +0000 (08:11 -0700)
Should be no functional change.  Next step is to re-arrange various
const state into different stateobjs.

Signed-off-by: Rob Clark <robdclark@chromium.org>
src/gallium/drivers/freedreno/a6xx/fd6_emit.c
src/gallium/drivers/freedreno/ir3/ir3_gallium.c
src/gallium/drivers/freedreno/ir3/ir3_gallium.h

index 956e6dfb4058c7e9936ed3e629091f0069079a6a..69d0c3eee95ebaeb015054a298f3fe260f667af4 100644 (file)
@@ -934,7 +934,19 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
                struct fd_ringbuffer *vsconstobj = fd_submit_new_ringbuffer(
                                ctx->batch->submit, 0x1000, FD_RINGBUFFER_STREAMING);
 
-               ir3_emit_vs_consts(vp, vsconstobj, ctx, emit->info);
+               ir3_emit_user_consts(ctx->screen, vp, vsconstobj,
+                               &ctx->constbuf[PIPE_SHADER_VERTEX]);
+               ir3_emit_ubos(ctx->screen, vp, vsconstobj,
+                               &ctx->constbuf[PIPE_SHADER_VERTEX]);
+               ir3_emit_immediates(ctx->screen, vp, vsconstobj);
+               ir3_emit_ssbo_sizes(ctx->screen, vp, vsconstobj,
+                               &ctx->shaderbuf[PIPE_SHADER_VERTEX]);
+               ir3_emit_image_dims(ctx->screen, vp, vsconstobj,
+                               &ctx->shaderimg[PIPE_SHADER_VERTEX]);
+
+               if (ir3_needs_vs_driver_params(vp))
+                       ir3_emit_vs_driver_params(vp, vsconstobj, ctx, emit->info);
+
                fd6_emit_add_group(emit, vsconstobj, FD6_GROUP_VS_CONST, 0x7);
                fd_ringbuffer_del(vsconstobj);
        }
@@ -943,7 +955,16 @@ fd6_emit_state(struct fd_ringbuffer *ring, struct fd6_emit *emit)
                struct fd_ringbuffer *fsconstobj = fd_submit_new_ringbuffer(
                                ctx->batch->submit, 0x1000, FD_RINGBUFFER_STREAMING);
 
-               ir3_emit_fs_consts(fp, fsconstobj, ctx);
+               ir3_emit_user_consts(ctx->screen, fp, fsconstobj,
+                               &ctx->constbuf[PIPE_SHADER_FRAGMENT]);
+               ir3_emit_ubos(ctx->screen, fp, fsconstobj,
+                               &ctx->constbuf[PIPE_SHADER_FRAGMENT]);
+               ir3_emit_immediates(ctx->screen, fp, fsconstobj);
+               ir3_emit_ssbo_sizes(ctx->screen, fp, fsconstobj,
+                               &ctx->shaderbuf[PIPE_SHADER_FRAGMENT]);
+               ir3_emit_image_dims(ctx->screen, fp, fsconstobj,
+                               &ctx->shaderimg[PIPE_SHADER_FRAGMENT]);
+
                fd6_emit_add_group(emit, fsconstobj, FD6_GROUP_FS_CONST, 0x6);
                fd_ringbuffer_del(fsconstobj);
        }
index f1b34440d4765998ad0560c5e1d8037f0e623372..fb83d0e7e6357e3137c5b616b3039c3403dd3070 100644 (file)
@@ -211,8 +211,8 @@ emit_const(struct fd_screen *screen, struct fd_ringbuffer *ring,
                        offset, size, user_buffer, buffer);
 }
 
-static void
-emit_user_consts(struct fd_screen *screen, const struct ir3_shader_variant *v,
+void
+ir3_emit_user_consts(struct fd_screen *screen, const struct ir3_shader_variant *v,
                struct fd_ringbuffer *ring, struct fd_constbuf_stateobj *constbuf)
 {
        struct ir3_ubo_analysis_state *state;
@@ -246,8 +246,8 @@ emit_user_consts(struct fd_screen *screen, const struct ir3_shader_variant *v,
        }
 }
 
-static void
-emit_ubos(struct fd_screen *screen, const struct ir3_shader_variant *v,
+void
+ir3_emit_ubos(struct fd_screen *screen, const struct ir3_shader_variant *v,
                struct fd_ringbuffer *ring, struct fd_constbuf_stateobj *constbuf)
 {
        const struct ir3_const_state *const_state = &v->shader->const_state;
@@ -277,8 +277,8 @@ emit_ubos(struct fd_screen *screen, const struct ir3_shader_variant *v,
        }
 }
 
-static void
-emit_ssbo_sizes(struct fd_screen *screen, const struct ir3_shader_variant *v,
+void
+ir3_emit_ssbo_sizes(struct fd_screen *screen, const struct ir3_shader_variant *v,
                struct fd_ringbuffer *ring, struct fd_shaderbuf_stateobj *sb)
 {
        const struct ir3_const_state *const_state = &v->shader->const_state;
@@ -298,8 +298,8 @@ emit_ssbo_sizes(struct fd_screen *screen, const struct ir3_shader_variant *v,
        }
 }
 
-static void
-emit_image_dims(struct fd_screen *screen, const struct ir3_shader_variant *v,
+void
+ir3_emit_image_dims(struct fd_screen *screen, const struct ir3_shader_variant *v,
                struct fd_ringbuffer *ring, struct fd_shaderimg_stateobj *si)
 {
        const struct ir3_const_state *const_state = &v->shader->const_state;
@@ -350,8 +350,8 @@ emit_image_dims(struct fd_screen *screen, const struct ir3_shader_variant *v,
        }
 }
 
-static void
-emit_immediates(struct fd_screen *screen, const struct ir3_shader_variant *v,
+void
+ir3_emit_immediates(struct fd_screen *screen, const struct ir3_shader_variant *v,
                struct fd_ringbuffer *ring)
 {
        const struct ir3_const_state *const_state = &v->shader->const_state;
@@ -482,22 +482,22 @@ emit_common_consts(const struct ir3_shader_variant *v, struct fd_ringbuffer *rin
 
                ring_wfi(ctx->batch, ring);
 
-               emit_user_consts(ctx->screen, v, ring, constbuf);
-               emit_ubos(ctx->screen, v, ring, constbuf);
+               ir3_emit_user_consts(ctx->screen, v, ring, constbuf);
+               ir3_emit_ubos(ctx->screen, v, ring, constbuf);
                if (shader_dirty)
-                       emit_immediates(ctx->screen, v, ring);
+                       ir3_emit_immediates(ctx->screen, v, ring);
        }
 
        if (dirty & (FD_DIRTY_SHADER_PROG | FD_DIRTY_SHADER_SSBO)) {
                struct fd_shaderbuf_stateobj *sb = &ctx->shaderbuf[t];
                ring_wfi(ctx->batch, ring);
-               emit_ssbo_sizes(ctx->screen, v, ring, sb);
+               ir3_emit_ssbo_sizes(ctx->screen, v, ring, sb);
        }
 
        if (dirty & (FD_DIRTY_SHADER_PROG | FD_DIRTY_SHADER_IMAGE)) {
                struct fd_shaderimg_stateobj *si = &ctx->shaderimg[t];
                ring_wfi(ctx->batch, ring);
-               emit_image_dims(ctx->screen, v, ring, si);
+               ir3_emit_image_dims(ctx->screen, v, ring, si);
        }
 }
 
index ee26b83341ec9022aaa3de05c92e7d651221ba18..cc8ae4599c951a4246ba0e6cfc3b97bd1fdac7f7 100644 (file)
@@ -46,6 +46,21 @@ struct ir3_shader_variant * ir3_shader_variant(struct ir3_shader *shader,
 
 struct fd_ringbuffer;
 struct fd_context;
+struct fd_screen;
+struct fd_constbuf_stateobj;
+struct fd_shaderbuf_stateobj;
+struct fd_shaderimg_stateobj;
+
+void ir3_emit_user_consts(struct fd_screen *screen, const struct ir3_shader_variant *v,
+               struct fd_ringbuffer *ring, struct fd_constbuf_stateobj *constbuf);
+void ir3_emit_ubos(struct fd_screen *screen, const struct ir3_shader_variant *v,
+               struct fd_ringbuffer *ring, struct fd_constbuf_stateobj *constbuf);
+void ir3_emit_ssbo_sizes(struct fd_screen *screen, const struct ir3_shader_variant *v,
+               struct fd_ringbuffer *ring, struct fd_shaderbuf_stateobj *sb);
+void ir3_emit_image_dims(struct fd_screen *screen, const struct ir3_shader_variant *v,
+               struct fd_ringbuffer *ring, struct fd_shaderimg_stateobj *si);
+void ir3_emit_immediates(struct fd_screen *screen, const struct ir3_shader_variant *v,
+               struct fd_ringbuffer *ring);
 
 static inline bool
 ir3_needs_vs_driver_params(const struct ir3_shader_variant *v)