Lines Matching refs:ctx
64 struct panfrost_context *ctx = pan_context(pipe);
65 struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
67 if (!panfrost_render_condition_check(ctx))
77 panfrost_blitter_save(ctx, false /* render condition */);
79 util_blitter_clear(ctx->blitter,
80 ctx->pipe_framebuffer.width,
81 ctx->pipe_framebuffer.height,
82 util_framebuffer_get_num_layers(&ctx->pipe_framebuffer),
84 util_framebuffer_get_num_samples(&ctx->pipe_framebuffer) > 1);
88 panfrost_writes_point_size(struct panfrost_context *ctx)
90 assert(ctx->shader[PIPE_SHADER_VERTEX]);
91 struct panfrost_shader_state *vs = panfrost_get_shader_state(ctx, PIPE_SHADER_VERTEX);
93 return vs->info.vs.writes_point_size && ctx->active_prim == PIPE_PRIM_POINTS;
104 struct panfrost_context *ctx = pan_context(pipe);
109 panfrost_flush_all_batches(ctx, NULL);
112 struct pipe_fence_handle *f = panfrost_fence_create(ctx);
124 struct panfrost_context *ctx = pan_context(pipe);
125 panfrost_flush_all_batches(ctx, "Texture barrier");
131 struct panfrost_context *ctx = pan_context(pipe);
132 panfrost_flush_all_batches(ctx, "Frontend no-op change");
133 ctx->is_noop = enable;
146 struct panfrost_context *ctx = pan_context(pipe);
147 ctx->blend = cso;
148 ctx->dirty |= PAN_DIRTY_BLEND;
155 struct panfrost_context *ctx = pan_context(pipe);
156 ctx->dirty |= PAN_DIRTY_BLEND;
159 ctx->blend_color = *blend_color;
167 struct panfrost_context *ctx = batch->ctx;
168 struct panfrost_device *dev = pan_device(ctx->base.screen);
169 struct panfrost_blend_state *blend = ctx->blend;
178 ctx->blend_color.color)) {
188 memcpy(pan_blend.constants, ctx->blend_color.color,
197 struct panfrost_shader_state *ss = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
211 pan_screen(ctx->base.screen)->vtbl.get_blend_shader(dev,
232 struct panfrost_context *ctx = pan_context(pctx);
233 ctx->rasterizer = hwcso;
239 ctx->dirty |= PAN_DIRTY_SCISSOR | PAN_DIRTY_RASTERIZER;
249 struct panfrost_context *ctx = pan_context(pctx);
250 ctx->dirty_shader[PIPE_SHADER_FRAGMENT] |= PAN_DIRTY_STAGE_IMAGE;
255 pipe_resource_reference(&ctx->images[shader][i].resource, NULL);
258 ctx->image_mask[shader] &= ~(((1ull << count) - 1) << start_slot);
265 SET_BIT(ctx->image_mask[shader], 1 << (start_slot + i), image->resource);
268 util_copy_image_view(&ctx->images[shader][start_slot+i], NULL);
276 pan_resource_modifier_convert(ctx, rsrc,
281 util_copy_image_view(&ctx->images[shader][start_slot+i], image);
286 SET_BIT(ctx->image_mask[shader], 1 << (start_slot + count + i), NULL);
287 util_copy_image_view(&ctx->images[shader][start_slot+count+i], NULL);
296 struct panfrost_context *ctx = pan_context(pctx);
297 ctx->vertex = hwcso;
298 ctx->dirty |= PAN_DIRTY_VERTEX;
327 struct panfrost_context *ctx = pan_context(pctx);
332 &ctx->shaders, &ctx->descs,
377 struct panfrost_context *ctx = pan_context(pctx);
378 ctx->dirty_shader[shader] |= PAN_DIRTY_STAGE_SAMPLER;
380 ctx->sampler_count[shader] = sampler ? num_sampler : 0;
382 memcpy(ctx->samplers[shader], sampler, num_sampler * sizeof (void *));
386 panfrost_build_key(struct panfrost_context *ctx,
394 struct panfrost_device *dev = pan_device(ctx->base.screen);
395 struct pipe_framebuffer_state *fb = &ctx->pipe_framebuffer;
396 struct pipe_rasterizer_state *rast = (void *) ctx->rasterizer;
397 struct panfrost_shader_variants *vs = ctx->shader[MESA_SHADER_VERTEX];
402 if (dev->arch >= 6 && rast && ctx->active_prim == PIPE_PRIM_POINTS) {
473 struct panfrost_context *ctx,
503 panfrost_shader_compile(ctx->base.screen,
504 &ctx->shaders, &ctx->descs,
524 struct panfrost_context *ctx = pan_context(pctx);
525 ctx->shader[type] = hwcso;
527 ctx->dirty |= PAN_DIRTY_TLS_SIZE;
528 ctx->dirty_shader[type] |= PAN_DIRTY_STAGE_SHADER;
531 panfrost_update_shader_variant(ctx, type);
535 panfrost_update_shader_variant(struct panfrost_context *ctx,
543 if (type == PIPE_SHADER_FRAGMENT && !ctx->shader[PIPE_SHADER_VERTEX])
547 if (!ctx->shader[type])
552 struct panfrost_shader_variants *variants = ctx->shader[type];
560 panfrost_build_key(ctx, &key, variants->nir);
570 variant = panfrost_new_variant_locked(ctx, variants, &key);
586 struct panfrost_context *ctx = pan_context(pctx);
587 panfrost_update_shader_variant(ctx, PIPE_SHADER_FRAGMENT);
605 struct panfrost_context *ctx = pan_context(pctx);
607 util_set_vertex_buffers_mask(ctx->vertex_buffers, &ctx->vb_mask, buffers,
611 ctx->dirty |= PAN_DIRTY_VERTEX;
620 struct panfrost_context *ctx = pan_context(pctx);
621 struct panfrost_constant_buffer *pbuf = &ctx->constant_buffer[shader];
633 ctx->dirty_shader[shader] |= PAN_DIRTY_STAGE_CONST;
641 struct panfrost_context *ctx = pan_context(pctx);
642 ctx->stencil_ref = ref;
643 ctx->dirty |= PAN_DIRTY_ZS;
655 struct panfrost_context *ctx = pan_context(pctx);
656 ctx->dirty_shader[shader] |= PAN_DIRTY_STAGE_TEXTURE;
669 pipe_sampler_view_reference((struct pipe_sampler_view **)&ctx->sampler_views[shader][p],
671 ctx->sampler_views[shader][i] = (struct panfrost_sampler_view *)view;
673 pipe_sampler_view_reference((struct pipe_sampler_view **)&ctx->sampler_views[shader][p],
680 pipe_sampler_view_reference((struct pipe_sampler_view **)&ctx->sampler_views[shader][p],
686 if (ctx->sampler_view_count[shader] > start_slot + num_views + unbind_num_trailing_slots)
693 if (ctx->sampler_views[shader][i])
698 ctx->sampler_view_count[shader] = new_nr;
709 struct panfrost_context *ctx = pan_context(pctx);
711 util_set_shader_buffers_mask(ctx->ssbo[shader], &ctx->ssbo_mask[shader],
714 ctx->dirty_shader[shader] |= PAN_DIRTY_STAGE_SSBO;
721 struct panfrost_context *ctx = pan_context(pctx);
723 util_copy_framebuffer_state(&ctx->pipe_framebuffer, fb);
724 ctx->batch = NULL;
727 ctx->fb_rt_mask = 0;
729 for (unsigned i = 0; i < ctx->pipe_framebuffer.nr_cbufs; ++i) {
730 if (ctx->pipe_framebuffer.cbufs[i])
731 ctx->fb_rt_mask |= BITFIELD_BIT(i);
739 struct panfrost_context *ctx = pan_context(pipe);
740 ctx->depth_stencil = cso;
741 ctx->dirty |= PAN_DIRTY_ZS;
748 struct panfrost_context *ctx = pan_context(pipe);
749 ctx->sample_mask = sample_mask;
750 ctx->dirty |= PAN_DIRTY_MSAA;
757 struct panfrost_context *ctx = pan_context(pipe);
758 ctx->min_samples = min_samples;
759 ctx->dirty |= PAN_DIRTY_MSAA;
775 struct panfrost_context *ctx = pan_context(pipe);
780 ctx->pipe_viewport = *viewports;
781 ctx->dirty |= PAN_DIRTY_VIEWPORT;
790 struct panfrost_context *ctx = pan_context(pipe);
795 ctx->scissor = *scissors;
796 ctx->dirty |= PAN_DIRTY_SCISSOR;
810 struct panfrost_context *ctx = pan_context(pipe);
811 ctx->active_queries = enable;
812 ctx->dirty |= PAN_DIRTY_OQ;
821 struct panfrost_context *ctx = pan_context(pipe);
823 ctx->cond_query = (struct panfrost_query *)query;
824 ctx->cond_cond = condition;
825 ctx->cond_mode = mode;
874 struct panfrost_context *ctx = pan_context(pipe);
875 struct panfrost_device *dev = pan_device(ctx->base.screen);
886 query->rsrc = pipe_buffer_create(ctx->base.screen,
895 query->msaa = (ctx->pipe_framebuffer.samples > 1);
896 ctx->occlusion_query = query;
897 ctx->dirty |= PAN_DIRTY_OQ;
905 query->start = ctx->prims_generated;
908 query->start = ctx->tf_prims_generated;
922 struct panfrost_context *ctx = pan_context(pipe);
929 ctx->occlusion_query = NULL;
930 ctx->dirty |= PAN_DIRTY_OQ;
933 query->end = ctx->prims_generated;
936 query->end = ctx->tf_prims_generated;
950 struct panfrost_context *ctx = pan_context(pipe);
951 struct panfrost_device *dev = pan_device(ctx->base.screen);
958 panfrost_flush_writer(ctx, rsrc, "Occlusion query");
981 panfrost_flush_all_batches(ctx, "Primitive count query");
994 panfrost_render_condition_check(struct panfrost_context *ctx)
996 if (!ctx->cond_query)
999 perf_debug_ctx(ctx, "Implementing conditional rendering on the CPU");
1003 ctx->cond_mode != PIPE_RENDER_COND_NO_WAIT &&
1004 ctx->cond_mode != PIPE_RENDER_COND_BY_REGION_NO_WAIT;
1006 struct pipe_query *pq = (struct pipe_query *)ctx->cond_query;
1008 if (panfrost_get_query_result(&ctx->base, pq, wait, &res))
1009 return res.u64 != ctx->cond_cond;
1051 struct panfrost_context *ctx = pan_context(pctx);
1052 struct panfrost_streamout *so = &ctx->streamout;
1067 ctx->dirty |= PAN_DIRTY_SO;
1073 struct panfrost_context *ctx = rzalloc(NULL, struct panfrost_context);
1074 struct pipe_context *gallium = (struct pipe_context *) ctx;
1150 panfrost_pool_init(&ctx->descs, ctx, dev,
1153 panfrost_pool_init(&ctx->shaders, ctx, dev,
1156 ctx->blitter = util_blitter_create(gallium);
1158 ctx->writers = _mesa_hash_table_create(gallium, _mesa_hash_pointer,
1161 assert(ctx->blitter);
1166 ctx->sample_mask = ~0;
1167 ctx->active_queries = true;
1174 ret = drmSyncobjCreate(dev->fd, DRM_SYNCOBJ_CREATE_SIGNALED, &ctx->syncobj);
1175 assert(!ret && ctx->syncobj);