summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_emit.c25
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.c30
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.h15
3 files changed, 53 insertions, 17 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
index 956e6dfb405..69d0c3eee95 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.c
@@ -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);
}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
index f1b34440d47..fb83d0e7e63 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
@@ -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);
}
}
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.h b/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
index ee26b83341e..cc8ae4599c9 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.h
@@ -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)