summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_context.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_context.c')
-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);