Lines Matching refs:vc4
1700 "vc4 doesn't support indirect inputs");
1796 "vc4 doesn't support indirect outputs");
1883 if (!c->vc4->screen->has_control_flow) {
2038 if (!c->vc4->screen->has_control_flow) {
2205 vc4_shader_ntq(struct vc4_context *vc4, enum qstage stage,
2210 c->vc4 = vc4;
2394 vc4_generate_code(vc4, c);
2416 struct vc4_context *vc4 = vc4_context(pctx);
2421 so->program_id = vc4->next_uncompiled_program_id++;
2495 vc4_setup_compiled_fs_inputs(struct vc4_context *vc4, struct vc4_compile *c,
2543 struct set_entry *entry = _mesa_set_search(vc4->fs_inputs_set, &inputs);
2550 alloc_inputs = rzalloc(vc4->fs_inputs_set, struct vc4_fs_inputs);
2553 _mesa_set_add(vc4->fs_inputs_set, alloc_inputs);
2560 vc4_get_compiled_shader(struct vc4_context *vc4, enum qstage stage,
2568 ht = vc4->fs_cache;
2570 try_threading = vc4->screen->has_threaded_fs;
2572 ht = vc4->vs_cache;
2582 struct vc4_compile *c = vc4_shader_ntq(vc4, stage, key, try_threading);
2586 c = vc4_shader_ntq(vc4, stage, key, false);
2591 shader->program_id = vc4->next_compiled_program_id++;
2593 vc4_setup_compiled_fs_inputs(vc4, c, shader);
2617 shader->bo = vc4_bo_alloc_shader(vc4->screen, c->qpu_insts,
2642 vc4_setup_shared_key(struct vc4_context *vc4, struct vc4_key *key,
2673 key->ucp_enables = vc4->rasterizer->base.clip_plane_enable;
2677 vc4_update_compiled_fs(struct vc4_context *vc4, uint8_t prim_mode)
2679 struct vc4_job *job = vc4->job;
2683 if (!(vc4->dirty & (VC4_DIRTY_PRIM_MODE |
2696 vc4_setup_shared_key(vc4, &key->base, &vc4->fragtex);
2697 key->base.shader_state = vc4->prog.bind_fs;
2701 key->blend = vc4->blend->rt[0];
2702 if (vc4->blend->logicop_enable) {
2703 key->logicop_func = vc4->blend->logicop_func;
2708 key->msaa = vc4->rasterizer->base.multisample;
2709 key->sample_coverage = (vc4->sample_mask != (1 << VC4_MAX_SAMPLES) - 1);
2710 key->sample_alpha_to_coverage = vc4->blend->alpha_to_coverage;
2711 key->sample_alpha_to_one = vc4->blend->alpha_to_one;
2714 if (vc4->framebuffer.cbufs[0])
2715 key->color_format = vc4->framebuffer.cbufs[0]->format;
2717 key->stencil_enabled = vc4->zsa->stencil_uniforms[0] != 0;
2718 key->stencil_twoside = vc4->zsa->stencil_uniforms[1] != 0;
2719 key->stencil_full_writemasks = vc4->zsa->stencil_uniforms[2] != 0;
2720 key->depth_enabled = (vc4->zsa->base.depth_enabled ||
2725 vc4->rasterizer->base.sprite_coord_enable;
2727 (vc4->rasterizer->base.sprite_coord_mode ==
2731 key->ubo_1_size = vc4->constbuf[PIPE_SHADER_FRAGMENT].cb[1].buffer_size;
2733 struct vc4_compiled_shader *old_fs = vc4->prog.fs;
2734 vc4->prog.fs = vc4_get_compiled_shader(vc4, QSTAGE_FRAG, &key->base);
2735 if (vc4->prog.fs == old_fs)
2738 vc4->dirty |= VC4_DIRTY_COMPILED_FS;
2740 if (vc4->rasterizer->base.flatshade &&
2741 (!old_fs || vc4->prog.fs->color_inputs != old_fs->color_inputs)) {
2742 vc4->dirty |= VC4_DIRTY_FLAT_SHADE_FLAGS;
2745 if (!old_fs || vc4->prog.fs->fs_inputs != old_fs->fs_inputs)
2746 vc4->dirty |= VC4_DIRTY_FS_INPUTS;
2750 vc4_update_compiled_vs(struct vc4_context *vc4, uint8_t prim_mode)
2755 if (!(vc4->dirty & (VC4_DIRTY_PRIM_MODE |
2765 vc4_setup_shared_key(vc4, &key->base, &vc4->verttex);
2766 key->base.shader_state = vc4->prog.bind_vs;
2767 key->fs_inputs = vc4->prog.fs->fs_inputs;
2770 key->attr_formats[i] = vc4->vtx->pipe[i].src_format;
2774 vc4->rasterizer->base.point_size_per_vertex);
2777 vc4_get_compiled_shader(vc4, QSTAGE_VERT, &key->base);
2778 if (vs != vc4->prog.vs) {
2779 vc4->prog.vs = vs;
2780 vc4->dirty |= VC4_DIRTY_COMPILED_VS;
2787 vc4_get_compiled_shader(vc4, QSTAGE_COORD, &key->base);
2788 if (cs != vc4->prog.cs) {
2789 vc4->prog.cs = cs;
2790 vc4->dirty |= VC4_DIRTY_COMPILED_CS;
2795 vc4_update_compiled_shaders(struct vc4_context *vc4, uint8_t prim_mode)
2797 vc4_update_compiled_fs(vc4, prim_mode);
2798 vc4_update_compiled_vs(vc4, prim_mode);
2800 return !(vc4->prog.cs->failed ||
2801 vc4->prog.vs->failed ||
2802 vc4->prog.fs->failed);
2875 struct vc4_context *vc4 = vc4_context(pctx);
2878 hash_table_foreach(vc4->fs_cache, entry) {
2879 delete_from_cache_if_matches(vc4->fs_cache, &vc4->prog.fs,
2882 hash_table_foreach(vc4->vs_cache, entry) {
2883 delete_from_cache_if_matches(vc4->vs_cache, &vc4->prog.vs,
2894 struct vc4_context *vc4 = vc4_context(pctx);
2895 vc4->prog.bind_fs = hwcso;
2896 vc4->dirty |= VC4_DIRTY_UNCOMPILED_FS;
2902 struct vc4_context *vc4 = vc4_context(pctx);
2903 vc4->prog.bind_vs = hwcso;
2904 vc4->dirty |= VC4_DIRTY_UNCOMPILED_VS;
2910 struct vc4_context *vc4 = vc4_context(pctx);
2921 vc4->fs_cache = _mesa_hash_table_create(pctx, fs_cache_hash,
2923 vc4->vs_cache = _mesa_hash_table_create(pctx, vs_cache_hash,
2925 vc4->fs_inputs_set = _mesa_set_create(pctx, fs_inputs_hash,
2932 struct vc4_context *vc4 = vc4_context(pctx);
2934 hash_table_foreach(vc4->fs_cache, entry) {
2938 _mesa_hash_table_remove(vc4->fs_cache, entry);
2941 hash_table_foreach(vc4->vs_cache, entry) {
2945 _mesa_hash_table_remove(vc4->vs_cache, entry);