summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-07-31 15:06:38 -0700
committerAlyssa Rosenzweig <[email protected]>2019-08-01 16:23:03 -0700
commit428bed3bded5426d621cbbb1c3161c8984f0779d (patch)
treeed2f544421a5c8c42d438be77ada4700354d15e1
parenta34370e85570b8e49e37020851509c6d8253e5bd (diff)
panfrost: Generalize UBO upload for other shader stages
Now that everything is unified, this generalization is nice and easy. Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 5e881915c14..fbf2e07f985 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1267,12 +1267,15 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
const struct pipe_viewport_state *vp = &ctx->pipe_viewport;
- for (int i = 0; i <= PIPE_SHADER_FRAGMENT; ++i) {
+ for (int i = 0; i < PIPE_SHADER_TYPES; ++i) {
+ struct panfrost_shader_variants *all = ctx->shader[i];
+
+ if (!all)
+ continue;
+
struct panfrost_constant_buffer *buf = &ctx->constant_buffer[i];
- struct panfrost_shader_state *vs = &ctx->shader[PIPE_SHADER_VERTEX]->variants[ctx->shader[PIPE_SHADER_VERTEX]->active_variant];
- struct panfrost_shader_state *fs = &ctx->shader[PIPE_SHADER_FRAGMENT]->variants[ctx->shader[PIPE_SHADER_FRAGMENT]->active_variant];
- struct panfrost_shader_state *ss = (i == PIPE_SHADER_FRAGMENT) ? fs : vs;
+ struct panfrost_shader_state *ss = &all->variants[all->active_variant];
/* Uniforms are implicitly UBO #0 */
bool has_uniforms = buf->enabled_mask & (1 << 0);