Lines Matching refs:screen
103 llvmpipe_get_vendor(struct pipe_screen *screen) in llvmpipe_get_vendor() argument
110 llvmpipe_get_name(struct pipe_screen *screen) in llvmpipe_get_name() argument
112 struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); in llvmpipe_get_name()
118 llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param) in llvmpipe_get_param() argument
202 struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); in llvmpipe_get_param()
214 struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); in llvmpipe_get_param()
259 struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); in llvmpipe_get_param()
365 struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); in llvmpipe_get_param()
369 return u_pipe_screen_get_param_defaults(screen, param); in llvmpipe_get_param()
374 llvmpipe_get_shader_param(struct pipe_screen *screen, in llvmpipe_get_shader_param() argument
378 struct llvmpipe_screen *lscreen = llvmpipe_screen(screen); in llvmpipe_get_shader_param()
433 llvmpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param) in llvmpipe_get_paramf() argument
612 llvmpipe_finalize_nir(struct pipe_screen *screen, in llvmpipe_finalize_nir() argument
621 llvmpipe_get_compiler_options(struct pipe_screen *screen, in llvmpipe_get_compiler_options() argument
642 struct llvmpipe_screen *screen = llvmpipe_screen(_screen); in llvmpipe_is_format_supported() local
643 struct sw_winsys *winsys = screen->winsys; in llvmpipe_is_format_supported()
809 struct llvmpipe_screen *screen = llvmpipe_screen(_screen); in llvmpipe_flush_frontbuffer() local
810 struct sw_winsys *winsys = screen->winsys; in llvmpipe_flush_frontbuffer()
821 struct llvmpipe_screen *screen = llvmpipe_screen(_screen); in llvmpipe_destroy_screen() local
822 struct sw_winsys *winsys = screen->winsys; in llvmpipe_destroy_screen()
824 if (screen->cs_tpool) in llvmpipe_destroy_screen()
825 lp_cs_tpool_destroy(screen->cs_tpool); in llvmpipe_destroy_screen()
827 if (screen->rast) in llvmpipe_destroy_screen()
828 lp_rast_destroy(screen->rast); in llvmpipe_destroy_screen()
830 lp_jit_screen_cleanup(screen); in llvmpipe_destroy_screen()
833 printf("disk shader cache: hits = %u, misses = %u\n", screen->num_disk_shader_cache_hits, in llvmpipe_destroy_screen()
834 screen->num_disk_shader_cache_misses); in llvmpipe_destroy_screen()
835 disk_cache_destroy(screen->disk_shader_cache); in llvmpipe_destroy_screen()
841 mtx_destroy(&screen->rast_mutex); in llvmpipe_destroy_screen()
842 mtx_destroy(&screen->cs_mutex); in llvmpipe_destroy_screen()
843 FREE(screen); in llvmpipe_destroy_screen()
853 llvmpipe_fence_reference(struct pipe_screen *screen, in llvmpipe_fence_reference() argument
868 llvmpipe_fence_finish(struct pipe_screen *screen, in llvmpipe_fence_finish() argument
904 static void lp_disk_cache_create(struct llvmpipe_screen *screen) in lp_disk_cache_create() argument
921 screen->disk_shader_cache = disk_cache_create("llvmpipe", cache_id, 0); in lp_disk_cache_create()
926 struct llvmpipe_screen *screen = llvmpipe_screen(_screen); in lp_get_disk_shader_cache() local
928 return screen->disk_shader_cache; in lp_get_disk_shader_cache()
931 void lp_disk_cache_find_shader(struct llvmpipe_screen *screen, in lp_disk_cache_find_shader() argument
937 if (!screen->disk_shader_cache) in lp_disk_cache_find_shader()
939 disk_cache_compute_key(screen->disk_shader_cache, ir_sha1_cache_key, 20, sha1); in lp_disk_cache_find_shader()
942 uint8_t *buffer = disk_cache_get(screen->disk_shader_cache, sha1, &binary_size); in lp_disk_cache_find_shader()
945 p_atomic_inc(&screen->num_disk_shader_cache_misses); in lp_disk_cache_find_shader()
950 p_atomic_inc(&screen->num_disk_shader_cache_hits); in lp_disk_cache_find_shader()
953 void lp_disk_cache_insert_shader(struct llvmpipe_screen *screen, in lp_disk_cache_insert_shader() argument
959 if (!screen->disk_shader_cache || !cache->data_size || cache->dont_cache) in lp_disk_cache_insert_shader()
961 disk_cache_compute_key(screen->disk_shader_cache, ir_sha1_cache_key, 20, sha1); in lp_disk_cache_insert_shader()
962 disk_cache_put(screen->disk_shader_cache, sha1, cache->data, cache->data_size, NULL); in lp_disk_cache_insert_shader()
966 llvmpipe_screen_late_init(struct llvmpipe_screen *screen) in llvmpipe_screen_late_init() argument
969 mtx_lock(&screen->late_mutex); in llvmpipe_screen_late_init()
971 if (screen->late_init_done) in llvmpipe_screen_late_init()
974 screen->rast = lp_rast_create(screen->num_threads); in llvmpipe_screen_late_init()
975 if (!screen->rast) { in llvmpipe_screen_late_init()
980 screen->cs_tpool = lp_cs_tpool_create(screen->num_threads); in llvmpipe_screen_late_init()
981 if (!screen->cs_tpool) { in llvmpipe_screen_late_init()
982 lp_rast_destroy(screen->rast); in llvmpipe_screen_late_init()
987 lp_disk_cache_create(screen); in llvmpipe_screen_late_init()
988 screen->late_init_done = true; in llvmpipe_screen_late_init()
990 mtx_unlock(&screen->late_mutex); in llvmpipe_screen_late_init()
1001 struct llvmpipe_screen *screen; in llvmpipe_create_screen() local
1013 screen = CALLOC_STRUCT(llvmpipe_screen); in llvmpipe_create_screen()
1014 if (!screen) in llvmpipe_create_screen()
1017 if (!lp_jit_screen_init(screen)) { in llvmpipe_create_screen()
1018 FREE(screen); in llvmpipe_create_screen()
1022 screen->winsys = winsys; in llvmpipe_create_screen()
1024 screen->base.destroy = llvmpipe_destroy_screen; in llvmpipe_create_screen()
1026 screen->base.get_name = llvmpipe_get_name; in llvmpipe_create_screen()
1027 screen->base.get_vendor = llvmpipe_get_vendor; in llvmpipe_create_screen()
1028 screen->base.get_device_vendor = llvmpipe_get_vendor; // TODO should be the CPU vendor in llvmpipe_create_screen()
1029 screen->base.get_param = llvmpipe_get_param; in llvmpipe_create_screen()
1030 screen->base.get_shader_param = llvmpipe_get_shader_param; in llvmpipe_create_screen()
1031 screen->base.get_compute_param = llvmpipe_get_compute_param; in llvmpipe_create_screen()
1032 screen->base.get_paramf = llvmpipe_get_paramf; in llvmpipe_create_screen()
1033 screen->base.get_compiler_options = llvmpipe_get_compiler_options; in llvmpipe_create_screen()
1034 screen->base.is_format_supported = llvmpipe_is_format_supported; in llvmpipe_create_screen()
1036 screen->base.context_create = llvmpipe_create_context; in llvmpipe_create_screen()
1037 screen->base.flush_frontbuffer = llvmpipe_flush_frontbuffer; in llvmpipe_create_screen()
1038 screen->base.fence_reference = llvmpipe_fence_reference; in llvmpipe_create_screen()
1039 screen->base.fence_finish = llvmpipe_fence_finish; in llvmpipe_create_screen()
1041 screen->base.get_timestamp = llvmpipe_get_timestamp; in llvmpipe_create_screen()
1043 screen->base.finalize_nir = llvmpipe_finalize_nir; in llvmpipe_create_screen()
1045 screen->base.get_disk_shader_cache = lp_get_disk_shader_cache; in llvmpipe_create_screen()
1046 llvmpipe_init_screen_resource_funcs(&screen->base); in llvmpipe_create_screen()
1048 screen->allow_cl = !!getenv("LP_CL"); in llvmpipe_create_screen()
1049 screen->use_tgsi = (LP_DEBUG & DEBUG_TGSI_IR); in llvmpipe_create_screen()
1050 screen->num_threads = util_get_cpu_caps()->nr_cpus > 1 ? util_get_cpu_caps()->nr_cpus : 0; in llvmpipe_create_screen()
1052 screen->num_threads = MIN2(screen->num_threads, 2); in llvmpipe_create_screen()
1054 screen->num_threads = debug_get_num_option("LP_NUM_THREADS", screen->num_threads); in llvmpipe_create_screen()
1055 screen->num_threads = MIN2(screen->num_threads, LP_MAX_THREADS); in llvmpipe_create_screen()
1059 …snprintf(screen->renderer_string, sizeof(screen->renderer_string), "llvmpipe (LLVM " MESA_LLVM_VER… in llvmpipe_create_screen()
1061 (void) mtx_init(&screen->cs_mutex, mtx_plain); in llvmpipe_create_screen()
1062 (void) mtx_init(&screen->rast_mutex, mtx_plain); in llvmpipe_create_screen()
1064 (void) mtx_init(&screen->late_mutex, mtx_plain); in llvmpipe_create_screen()
1066 return &screen->base; in llvmpipe_create_screen()