Lines Matching refs:ctx
49 update_draw_cost(struct fd_context *ctx) assert_dt
51 struct pipe_framebuffer_state *pfb = &ctx->framebuffer;
53 ctx->draw_cost = pfb->nr_cbufs;
55 if (fd_blend_enabled(ctx, i))
56 ctx->draw_cost++;
57 if (fd_depth_enabled(ctx))
58 ctx->draw_cost++;
59 if (fd_depth_write_enabled(ctx))
60 ctx->draw_cost++;
67 struct fd_context *ctx = fd_context(pctx);
68 ctx->blend_color = *blend_color;
69 fd_context_dirty(ctx, FD_DIRTY_BLEND_COLOR);
76 struct fd_context *ctx = fd_context(pctx);
77 ctx->stencil_ref = stencil_ref;
78 fd_context_dirty(ctx, FD_DIRTY_STENCIL_REF);
85 struct fd_context *ctx = fd_context(pctx);
86 ctx->ucp = *clip;
87 fd_context_dirty(ctx, FD_DIRTY_UCP);
93 struct fd_context *ctx = fd_context(pctx);
94 ctx->sample_mask = (uint16_t)sample_mask;
95 fd_context_dirty(ctx, FD_DIRTY_SAMPLE_MASK);
101 struct fd_context *ctx = fd_context(pctx);
102 ctx->min_samples = min_samples;
103 fd_context_dirty(ctx, FD_DIRTY_MIN_SAMPLES);
119 struct fd_context *ctx = fd_context(pctx);
120 struct fd_constbuf_stateobj *so = &ctx->constbuf[shader];
134 fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_CONST);
139 ctx->dirty |= FD_DIRTY_RESOURCE;
149 struct fd_context *ctx = fd_context(pctx);
150 struct fd_shaderbuf_stateobj *so = &ctx->shaderbuf[shader];
186 fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_SSBO);
195 struct fd_context *ctx = fd_context(pctx);
196 struct fd_shaderimg_stateobj *so = &ctx->shaderimg[shader];
249 fd_context_dirty_shader(ctx, shader, FD_DIRTY_SHADER_IMAGE);
256 struct fd_context *ctx = fd_context(pctx);
262 cso = &ctx->framebuffer;
274 fd_context_switch_from(ctx);
280 if (ctx->screen->reorder) {
283 fd_batch_reference(&old_batch, ctx->batch);
288 fd_batch_reference(&ctx->batch, NULL);
289 fd_context_all_dirty(ctx);
290 ctx->update_active_queries = true;
293 } else if (ctx->batch) {
294 DBG("%d: cbufs[0]=%p, zsbuf=%p", ctx->batch->needs_flush,
296 fd_batch_flush(ctx->batch);
299 fd_context_dirty(ctx, FD_DIRTY_FRAMEBUFFER);
301 ctx->disabled_scissor.minx = 0;
302 ctx->disabled_scissor.miny = 0;
303 ctx->disabled_scissor.maxx = cso->width;
304 ctx->disabled_scissor.maxy = cso->height;
306 fd_context_dirty(ctx, FD_DIRTY_SCISSOR);
307 update_draw_cost(ctx);
314 struct fd_context *ctx = fd_context(pctx);
315 ctx->stipple = *stipple;
316 fd_context_dirty(ctx, FD_DIRTY_STIPPLE);
324 struct fd_context *ctx = fd_context(pctx);
326 ctx->scissor = *scissor;
327 fd_context_dirty(ctx, FD_DIRTY_SCISSOR);
335 struct fd_context *ctx = fd_context(pctx);
336 struct pipe_scissor_state *scissor = &ctx->viewport_scissor;
339 ctx->viewport = *viewport;
357 const float max_dims = ctx->screen->gen >= 4 ? 16384.f : 4096.f;
365 fd_context_dirty(ctx, FD_DIRTY_VIEWPORT);
374 struct fd_context *ctx = fd_context(pctx);
375 struct fd_vertexbuf_stateobj *so = &ctx->vtx.vertexbuf;
382 if (ctx->screen->gen < 3) {
389 fd_context_dirty(ctx, FD_DIRTY_VTXSTATE);
403 fd_context_dirty(ctx, FD_DIRTY_VTXBUF);
422 struct fd_context *ctx = fd_context(pctx);
424 bool old_is_dual = ctx->blend ? ctx->blend->rt[0].blend_enable &&
425 util_blend_state_is_dual(ctx->blend, 0)
429 ctx->blend = hwcso;
430 fd_context_dirty(ctx, FD_DIRTY_BLEND);
432 fd_context_dirty(ctx, FD_DIRTY_BLEND_DUAL);
433 update_draw_cost(ctx);
445 struct fd_context *ctx = fd_context(pctx);
446 struct pipe_scissor_state *old_scissor = fd_context_get_scissor(ctx);
447 bool discard = get_safe(ctx->rasterizer, rasterizer_discard);
448 unsigned clip_plane_enable = get_safe(ctx->rasterizer, clip_plane_enable);
450 ctx->rasterizer = hwcso;
451 fd_context_dirty(ctx, FD_DIRTY_RASTERIZER);
453 if (ctx->rasterizer && ctx->rasterizer->scissor) {
454 ctx->current_scissor = &ctx->scissor;
456 ctx->current_scissor = &ctx->disabled_scissor;
462 * if it changed to/from &ctx->disable_scissor
464 if (old_scissor != fd_context_get_scissor(ctx))
465 fd_context_dirty(ctx, FD_DIRTY_SCISSOR);
467 if (discard != get_safe(ctx->rasterizer, rasterizer_discard))
468 fd_context_dirty(ctx, FD_DIRTY_RASTERIZER_DISCARD);
470 if (clip_plane_enable != get_safe(ctx->rasterizer, clip_plane_enable))
471 fd_context_dirty(ctx, FD_DIRTY_RASTERIZER_CLIP_PLANE_ENABLE);
483 struct fd_context *ctx = fd_context(pctx);
484 ctx->zsa = hwcso;
485 fd_context_dirty(ctx, FD_DIRTY_ZSA);
486 update_draw_cost(ctx);
519 struct fd_context *ctx = fd_context(pctx);
520 ctx->vtx.vtx = hwcso;
521 fd_context_dirty(ctx, FD_DIRTY_VTXSTATE);
570 struct fd_context *ctx = fd_context(pctx);
571 struct fd_streamout_stateobj *so = &ctx->streamout;
577 if (ctx->screen->gen < 5) {
579 ctx->stats_users++;
581 ctx->stats_users--;
599 ctx->streamout.verts_written = 0;
611 fd_context_dirty(ctx, FD_DIRTY_STREAMOUT);
617 struct fd_context *ctx = fd_context(pctx);
618 ctx->compute = state;
620 ctx->dirty_shader[PIPE_SHADER_COMPUTE] |= FD_DIRTY_SHADER_PROG;
633 struct fd_context *ctx = fd_context(pctx);
634 struct fd_constbuf_stateobj *so = &ctx->constbuf[PIPE_SHADER_COMPUTE];
662 struct fd_context *ctx = fd_context(pctx);
663 struct fd_global_bindings_stateobj *so = &ctx->global_bindings;