Lines Matching refs:vc5
135 struct vc5_context *vc5 = vc5_context(pctx); in vc5_shader_state_create() local
140 so->program_id = vc5->next_uncompiled_program_id++; in vc5_shader_state_create()
195 vc5_get_compiled_shader(struct vc5_context *vc5, struct v3d_key *key) in vc5_get_compiled_shader() argument
203 ht = vc5->fs_cache; in vc5_get_compiled_shader()
206 ht = vc5->vs_cache; in vc5_get_compiled_shader()
227 qpu_insts = v3d_compile_vs(vc5->screen->compiler, in vc5_get_compiled_shader()
236 qpu_insts = v3d_compile_fs(vc5->screen->compiler, in vc5_get_compiled_shader()
248 shader->bo = vc5_bo_alloc(vc5->screen, shader_size, "shader"); in vc5_get_compiled_shader()
263 vc5_setup_shared_key(struct vc5_context *vc5, struct v3d_key *key, in vc5_setup_shared_key() argument
266 const struct v3d_device_info *devinfo = &vc5->screen->devinfo; in vc5_setup_shared_key()
325 key->ucp_enables = vc5->rasterizer->base.clip_plane_enable; in vc5_setup_shared_key()
329 vc5_update_compiled_fs(struct vc5_context *vc5, uint8_t prim_mode) in vc5_update_compiled_fs() argument
331 struct vc5_job *job = vc5->job; in vc5_update_compiled_fs()
335 if (!(vc5->dirty & (VC5_DIRTY_PRIM_MODE | in vc5_update_compiled_fs()
347 vc5_setup_shared_key(vc5, &key->base, &vc5->fragtex); in vc5_update_compiled_fs()
348 key->base.shader_state = vc5->prog.bind_fs; in vc5_update_compiled_fs()
352 key->clamp_color = vc5->rasterizer->base.clamp_fragment_color; in vc5_update_compiled_fs()
353 if (vc5->blend->logicop_enable) { in vc5_update_compiled_fs()
354 key->logicop_func = vc5->blend->logicop_func; in vc5_update_compiled_fs()
359 key->msaa = vc5->rasterizer->base.multisample; in vc5_update_compiled_fs()
360 key->sample_coverage = (vc5->rasterizer->base.multisample && in vc5_update_compiled_fs()
361 vc5->sample_mask != (1 << VC5_MAX_SAMPLES) - 1); in vc5_update_compiled_fs()
362 key->sample_alpha_to_coverage = vc5->blend->alpha_to_coverage; in vc5_update_compiled_fs()
363 key->sample_alpha_to_one = vc5->blend->alpha_to_one; in vc5_update_compiled_fs()
366 key->depth_enabled = (vc5->zsa->base.depth.enabled || in vc5_update_compiled_fs()
367 vc5->zsa->base.stencil[0].enabled); in vc5_update_compiled_fs()
368 if (vc5->zsa->base.alpha.enabled) { in vc5_update_compiled_fs()
370 key->alpha_test_func = vc5->zsa->base.alpha.func; in vc5_update_compiled_fs()
376 key->nr_cbufs = vc5->framebuffer.nr_cbufs; in vc5_update_compiled_fs()
377 key->swap_color_rb = vc5->swap_color_rb; in vc5_update_compiled_fs()
380 struct pipe_surface *cbuf = vc5->framebuffer.cbufs[i]; in vc5_update_compiled_fs()
392 vc5->rasterizer->base.sprite_coord_enable; in vc5_update_compiled_fs()
394 (vc5->rasterizer->base.sprite_coord_mode == in vc5_update_compiled_fs()
398 key->light_twoside = vc5->rasterizer->base.light_twoside; in vc5_update_compiled_fs()
399 key->shade_model_flat = vc5->rasterizer->base.flatshade; in vc5_update_compiled_fs()
401 struct vc5_compiled_shader *old_fs = vc5->prog.fs; in vc5_update_compiled_fs()
402 vc5->prog.fs = vc5_get_compiled_shader(vc5, &key->base); in vc5_update_compiled_fs()
403 if (vc5->prog.fs == old_fs) in vc5_update_compiled_fs()
406 vc5->dirty |= VC5_DIRTY_COMPILED_FS; in vc5_update_compiled_fs()
409 vc5->prog.fs->prog_data.fs->flat_shade_flags != in vc5_update_compiled_fs()
411 vc5->dirty |= VC5_DIRTY_FLAT_SHADE_FLAGS; in vc5_update_compiled_fs()
414 if (old_fs && memcmp(vc5->prog.fs->prog_data.fs->input_slots, in vc5_update_compiled_fs()
416 sizeof(vc5->prog.fs->prog_data.fs->input_slots))) { in vc5_update_compiled_fs()
417 vc5->dirty |= VC5_DIRTY_FS_INPUTS; in vc5_update_compiled_fs()
422 vc5_update_compiled_vs(struct vc5_context *vc5, uint8_t prim_mode) in vc5_update_compiled_vs() argument
427 if (!(vc5->dirty & (VC5_DIRTY_PRIM_MODE | in vc5_update_compiled_vs()
437 vc5_setup_shared_key(vc5, &key->base, &vc5->verttex); in vc5_update_compiled_vs()
438 key->base.shader_state = vc5->prog.bind_vs; in vc5_update_compiled_vs()
439 key->num_fs_inputs = vc5->prog.fs->prog_data.fs->base.num_inputs; in vc5_update_compiled_vs()
441 sizeof(vc5->prog.fs->prog_data.fs->input_slots)); in vc5_update_compiled_vs()
442 memcpy(key->fs_inputs, vc5->prog.fs->prog_data.fs->input_slots, in vc5_update_compiled_vs()
444 key->clamp_color = vc5->rasterizer->base.clamp_vertex_color; in vc5_update_compiled_vs()
448 vc5->rasterizer->base.point_size_per_vertex); in vc5_update_compiled_vs()
451 vc5_get_compiled_shader(vc5, &key->base); in vc5_update_compiled_vs()
452 if (vs != vc5->prog.vs) { in vc5_update_compiled_vs()
453 vc5->prog.vs = vs; in vc5_update_compiled_vs()
454 vc5->dirty |= VC5_DIRTY_COMPILED_VS; in vc5_update_compiled_vs()
471 vc5_get_compiled_shader(vc5, &key->base); in vc5_update_compiled_vs()
472 if (cs != vc5->prog.cs) { in vc5_update_compiled_vs()
473 vc5->prog.cs = cs; in vc5_update_compiled_vs()
474 vc5->dirty |= VC5_DIRTY_COMPILED_CS; in vc5_update_compiled_vs()
479 vc5_update_compiled_shaders(struct vc5_context *vc5, uint8_t prim_mode) in vc5_update_compiled_shaders() argument
481 vc5_update_compiled_fs(vc5, prim_mode); in vc5_update_compiled_shaders()
482 vc5_update_compiled_vs(vc5, prim_mode); in vc5_update_compiled_shaders()
532 struct vc5_context *vc5 = vc5_context(pctx); in vc5_shader_state_delete() local
536 hash_table_foreach(vc5->fs_cache, entry) { in vc5_shader_state_delete()
537 delete_from_cache_if_matches(vc5->fs_cache, &vc5->prog.fs, in vc5_shader_state_delete()
540 hash_table_foreach(vc5->vs_cache, entry) { in vc5_shader_state_delete()
541 delete_from_cache_if_matches(vc5->vs_cache, &vc5->prog.vs, in vc5_shader_state_delete()
552 struct vc5_context *vc5 = vc5_context(pctx); in vc5_fp_state_bind() local
553 vc5->prog.bind_fs = hwcso; in vc5_fp_state_bind()
554 vc5->dirty |= VC5_DIRTY_UNCOMPILED_FS; in vc5_fp_state_bind()
560 struct vc5_context *vc5 = vc5_context(pctx); in vc5_vp_state_bind() local
561 vc5->prog.bind_vs = hwcso; in vc5_vp_state_bind()
562 vc5->dirty |= VC5_DIRTY_UNCOMPILED_VS; in vc5_vp_state_bind()
568 struct vc5_context *vc5 = vc5_context(pctx); in vc5_program_init() local
579 vc5->fs_cache = _mesa_hash_table_create(pctx, fs_cache_hash, in vc5_program_init()
581 vc5->vs_cache = _mesa_hash_table_create(pctx, vs_cache_hash, in vc5_program_init()
588 struct vc5_context *vc5 = vc5_context(pctx); in vc5_program_fini() local
591 hash_table_foreach(vc5->fs_cache, entry) { in vc5_program_fini()
595 _mesa_hash_table_remove(vc5->fs_cache, entry); in vc5_program_fini()
598 hash_table_foreach(vc5->vs_cache, entry) { in vc5_program_fini()
602 _mesa_hash_table_remove(vc5->vs_cache, entry); in vc5_program_fini()