Lines Matching refs:ctx

291 lima_fs_compile_shader(struct lima_context *ctx,
296 struct lima_screen *screen = lima_screen(ctx->base.screen);
314 if (!ppir_compile_nir(fs, nir, screen->pp_ra, &ctx->debug)) {
326 lima_fs_upload_shader(struct lima_context *ctx,
329 struct lima_screen *screen = lima_screen(ctx->base.screen);
343 lima_get_compiled_fs(struct lima_context *ctx,
347 struct lima_screen *screen = lima_screen(ctx->base.screen);
351 ht = ctx->fs_cache;
368 if (!lima_fs_compile_shader(ctx, key, ufs, fs))
374 if (!lima_fs_upload_shader(ctx, fs))
397 struct lima_context *ctx = lima_context(pctx);
437 lima_get_compiled_fs(ctx, so, &key);
446 struct lima_context *ctx = lima_context(pctx);
448 ctx->uncomp_fs = hwcso;
449 ctx->dirty |= LIMA_CONTEXT_DIRTY_UNCOMPILED_FS;
455 struct lima_context *ctx = lima_context(pctx);
458 hash_table_foreach(ctx->fs_cache, entry) {
462 _mesa_hash_table_remove(ctx->fs_cache, entry);
466 if (fs == ctx->fs)
467 ctx->fs = NULL;
478 lima_vs_compile_shader(struct lima_context *ctx,
490 if (!gpir_compile_nir(vs, nir, &ctx->debug)) {
501 lima_vs_upload_shader(struct lima_context *ctx,
504 struct lima_screen *screen = lima_screen(ctx->base.screen);
517 lima_get_compiled_vs(struct lima_context *ctx,
521 struct lima_screen *screen = lima_screen(ctx->base.screen);
525 ht = ctx->vs_cache;
541 if (!lima_vs_compile_shader(ctx, key, uvs, vs))
547 if (!lima_vs_upload_shader(ctx, vs))
566 lima_update_vs_state(struct lima_context *ctx)
568 if (!(ctx->dirty & LIMA_CONTEXT_DIRTY_UNCOMPILED_VS)) {
575 memcpy(key->nir_sha1, ctx->uncomp_vs->nir_sha1,
576 sizeof(ctx->uncomp_vs->nir_sha1));
578 struct lima_vs_compiled_shader *old_vs = ctx->vs;
579 struct lima_vs_compiled_shader *vs = lima_get_compiled_vs(ctx,
580 ctx->uncomp_vs,
585 ctx->vs = vs;
587 if (ctx->vs != old_vs)
588 ctx->dirty |= LIMA_CONTEXT_DIRTY_COMPILED_VS;
594 lima_update_fs_state(struct lima_context *ctx)
596 if (!(ctx->dirty & (LIMA_CONTEXT_DIRTY_UNCOMPILED_FS |
601 struct lima_texture_stateobj *lima_tex = &ctx->tex_stateobj;
605 memcpy(key->nir_sha1, ctx->uncomp_fs->nir_sha1,
606 sizeof(ctx->uncomp_fs->nir_sha1));
624 struct lima_fs_compiled_shader *old_fs = ctx->fs;
626 struct lima_fs_compiled_shader *fs = lima_get_compiled_fs(ctx,
627 ctx->uncomp_fs,
632 ctx->fs = fs;
634 if (ctx->fs != old_fs)
635 ctx->dirty |= LIMA_CONTEXT_DIRTY_COMPILED_FS;
644 struct lima_context *ctx = lima_context(pctx);
680 lima_get_compiled_vs(ctx, so, &key);
689 struct lima_context *ctx = lima_context(pctx);
691 ctx->uncomp_vs = hwcso;
692 ctx->dirty |= LIMA_CONTEXT_DIRTY_UNCOMPILED_VS;
698 struct lima_context *ctx = lima_context(pctx);
701 hash_table_foreach(ctx->vs_cache, entry) {
705 _mesa_hash_table_remove(ctx->vs_cache, entry);
709 if (vs == ctx->vs)
710 ctx->vs = NULL;
745 lima_program_init(struct lima_context *ctx)
747 ctx->base.create_fs_state = lima_create_fs_state;
748 ctx->base.bind_fs_state = lima_bind_fs_state;
749 ctx->base.delete_fs_state = lima_delete_fs_state;
751 ctx->base.create_vs_state = lima_create_vs_state;
752 ctx->base.bind_vs_state = lima_bind_vs_state;
753 ctx->base.delete_vs_state = lima_delete_vs_state;
755 ctx->fs_cache = _mesa_hash_table_create(ctx, lima_fs_cache_hash,
757 ctx->vs_cache = _mesa_hash_table_create(ctx, lima_vs_cache_hash,
762 lima_program_fini(struct lima_context *ctx)
764 hash_table_foreach(ctx->vs_cache, entry) {
769 _mesa_hash_table_remove(ctx->vs_cache, entry);
772 hash_table_foreach(ctx->fs_cache, entry) {
777 _mesa_hash_table_remove(ctx->fs_cache, entry);