Lines Matching refs:vrend_state
246 static struct global_renderer_state vrend_state; variable
250 return vrend_state.features[feature_id]; in has_feature()
255 vrend_state.features[feature_id] = true; in set_feature()
609 if (!vrend_state.use_core_profile) in vrend_format_is_emulated_alpha()
915 if (vrend_state.use_core_profile) { in vrend_alpha_test_enable()
1627 …case PIPE_TEX_WRAP_CLAMP: if (vrend_state.use_core_profile == false) return GL_CLAMP; else return … in convert_wrap()
1692 if (vrend_state.use_gles) { in vrend_create_sampler_state()
1886 else if (vrend_state.use_gles) in vrend_fb_bind_texture_id()
1987 if (!vrend_state.use_gles) { in vrend_hw_emit_framebuffer_state()
1990 } else if (!vrend_state.use_gles) { in vrend_hw_emit_framebuffer_state()
2183 if (vrend_state.use_gles) { in vrend_set_viewport_states()
2482 if (vrend_state.use_core_profile == false) { in vrend_set_single_sampler_view()
2691 if (vrend_state.use_core_profile == true) { in vrend_fill_shader_key()
3149 if (vrend_state.use_gles) { in vrend_clear()
3376 if (vrend_state.use_explicit_locations || has_feature(feat_gles31_vertex_attrib_binding)) { in vrend_draw_bind_vertex_legacy()
3525 if (vrend_state.use_core_profile == false) { in vrend_draw_bind_samplers_shader()
3622 if (!vrend_state.use_gles) in vrend_draw_bind_ssbo_shader()
3674 if (!vrend_state.use_gles) in vrend_draw_bind_images_shader()
3707 if (vrend_state.use_core_profile && ctx->sub->prog->fs_stipple_loc != -1) { in vrend_draw_bind_objects()
3899 if (vrend_state.use_gles) { in vrend_draw_vbo()
3968 if (vrend_state.use_gles) { in vrend_draw_vbo()
4196 if (vrend_state.use_gles) { in vrend_hw_emit_blend()
4276 if (!vrend_state.use_gles) { in vrend_hw_emit_blend()
4389 if (!vrend_state.use_core_profile) in vrend_hw_emit_dsa()
4498 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4508 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4535 if (vrend_state.use_gles == true) { in vrend_hw_emit_rs()
4542 } else if (vrend_state.use_core_profile == false) { in vrend_hw_emit_rs()
4556 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4566 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4579 if (vrend_state.use_core_profile == false) { in vrend_hw_emit_rs()
4590 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4601 if (!vrend_state.use_gles && has_feature(feat_polygon_offset_clamp)) in vrend_hw_emit_rs()
4606 if (vrend_state.use_core_profile == false) { in vrend_hw_emit_rs()
4617 if (vrend_state.use_core_profile == false && in vrend_hw_emit_rs()
4618 vrend_state.use_gles == false) { in vrend_hw_emit_rs()
4622 if (vrend_state.use_gles == false) { in vrend_hw_emit_rs()
4626 if (vrend_state.use_core_profile == false && in vrend_hw_emit_rs()
4627 vrend_state.use_gles == false) { in vrend_hw_emit_rs()
4651 if (vrend_state.use_core_profile == false) { in vrend_hw_emit_rs()
4667 if (vrend_state.use_core_profile == false) { in vrend_hw_emit_rs()
4674 if (vrend_state.use_gles) in vrend_hw_emit_rs()
4681 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4691 if (vrend_state.use_gles) { in vrend_hw_emit_rs()
4701 if (vrend_state.use_core_profile == false) { in vrend_hw_emit_rs()
4725 if (!vrend_state.use_gles) { in vrend_hw_emit_rs()
4865 if (vrend_state.use_gles) { in vrend_apply_sampler_state()
4886 if (!vrend_state.use_gles) { in vrend_apply_sampler_state()
4937 if (!vrend_state.sync_thread) in vrend_free_sync_thread()
4940 pipe_mutex_lock(vrend_state.fence_mutex); in vrend_free_sync_thread()
4941 vrend_state.stop_sync_thread = true; in vrend_free_sync_thread()
4942 pipe_condvar_signal(vrend_state.fence_cond); in vrend_free_sync_thread()
4943 pipe_mutex_unlock(vrend_state.fence_mutex); in vrend_free_sync_thread()
4945 pipe_thread_wait(vrend_state.sync_thread); in vrend_free_sync_thread()
4946 vrend_state.sync_thread = 0; in vrend_free_sync_thread()
4948 pipe_condvar_destroy(vrend_state.fence_cond); in vrend_free_sync_thread()
4949 pipe_mutex_destroy(vrend_state.fence_mutex); in vrend_free_sync_thread()
4995 pipe_mutex_lock(vrend_state.fence_mutex); in wait_sync()
4996 list_addtail(&fence->fences, &vrend_state.fence_list); in wait_sync()
4997 pipe_mutex_unlock(vrend_state.fence_mutex); in wait_sync()
4999 n = write_full(vrend_state.eventfd, &value, sizeof(value)); in wait_sync()
5007 virgl_gl_context gl_context = vrend_state.sync_context; in thread_sync()
5011 pipe_mutex_lock(vrend_state.fence_mutex); in thread_sync()
5014 while (!vrend_state.stop_sync_thread) { in thread_sync()
5015 if (LIST_IS_EMPTY(&vrend_state.fence_wait_list) && in thread_sync()
5016 pipe_condvar_wait(vrend_state.fence_cond, vrend_state.fence_mutex) != 0) { in thread_sync()
5021 LIST_FOR_EACH_ENTRY_SAFE(fence, stor, &vrend_state.fence_wait_list, fences) { in thread_sync()
5022 if (vrend_state.stop_sync_thread) in thread_sync()
5025 pipe_mutex_unlock(vrend_state.fence_mutex); in thread_sync()
5027 pipe_mutex_lock(vrend_state.fence_mutex); in thread_sync()
5032 vrend_clicbs->destroy_gl_context(vrend_state.sync_context); in thread_sync()
5033 pipe_mutex_unlock(vrend_state.fence_mutex); in thread_sync()
5045 ctx_params.major_ver = vrend_state.gl_major_ver; in vrend_renderer_use_threaded_sync()
5046 ctx_params.minor_ver = vrend_state.gl_minor_ver; in vrend_renderer_use_threaded_sync()
5048 vrend_state.stop_sync_thread = false; in vrend_renderer_use_threaded_sync()
5050 vrend_state.sync_context = vrend_clicbs->create_gl_context(0, &ctx_params); in vrend_renderer_use_threaded_sync()
5051 if (vrend_state.sync_context == NULL) { in vrend_renderer_use_threaded_sync()
5056 vrend_state.eventfd = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK); in vrend_renderer_use_threaded_sync()
5057 if (vrend_state.eventfd == -1) { in vrend_renderer_use_threaded_sync()
5059 vrend_clicbs->destroy_gl_context(vrend_state.sync_context); in vrend_renderer_use_threaded_sync()
5063 pipe_condvar_init(vrend_state.fence_cond); in vrend_renderer_use_threaded_sync()
5064 pipe_mutex_init(vrend_state.fence_mutex); in vrend_renderer_use_threaded_sync()
5066 vrend_state.sync_thread = pipe_thread_create(thread_sync, NULL); in vrend_renderer_use_threaded_sync()
5067 if (!vrend_state.sync_thread) { in vrend_renderer_use_threaded_sync()
5068 close(vrend_state.eventfd); in vrend_renderer_use_threaded_sync()
5069 vrend_state.eventfd = -1; in vrend_renderer_use_threaded_sync()
5070 vrend_clicbs->destroy_gl_context(vrend_state.sync_context); in vrend_renderer_use_threaded_sync()
5071 pipe_condvar_destroy(vrend_state.fence_cond); in vrend_renderer_use_threaded_sync()
5072 pipe_mutex_destroy(vrend_state.fence_mutex); in vrend_renderer_use_threaded_sync()
5099 if (!vrend_state.inited) { in vrend_renderer_init()
5100 vrend_state.inited = true; in vrend_renderer_init()
5129 vrend_state.gl_major_ver = gl_ver / 10; in vrend_renderer_init()
5130 vrend_state.gl_minor_ver = gl_ver % 10; in vrend_renderer_init()
5134 vrend_state.use_gles = true; in vrend_renderer_init()
5136 vrend_state.use_core_profile = 1; in vrend_renderer_init()
5139 vrend_state.use_core_profile = 1; in vrend_renderer_init()
5147 glGetIntegerv(GL_MAX_DRAW_BUFFERS, (GLint *) &vrend_state.max_draw_buffers); in vrend_renderer_init()
5171 if (vrend_state.use_gles) { in vrend_renderer_init()
5185 list_inithead(&vrend_state.fence_list); in vrend_renderer_init()
5186 list_inithead(&vrend_state.fence_wait_list); in vrend_renderer_init()
5187 list_inithead(&vrend_state.waiting_query_list); in vrend_renderer_init()
5188 list_inithead(&vrend_state.active_ctx_list); in vrend_renderer_init()
5192 vrend_state.eventfd = -1; in vrend_renderer_init()
5203 if (!vrend_state.inited) in vrend_renderer_fini()
5207 if (vrend_state.eventfd != -1) { in vrend_renderer_fini()
5208 close(vrend_state.eventfd); in vrend_renderer_fini()
5209 vrend_state.eventfd = -1; in vrend_renderer_fini()
5216 vrend_state.current_ctx = NULL; in vrend_renderer_fini()
5217 vrend_state.current_hw_ctx = NULL; in vrend_renderer_fini()
5218 vrend_state.inited = false; in vrend_renderer_fini()
5290 bool switch_0 = (ctx == vrend_state.current_ctx); in vrend_destroy_context()
5291 struct vrend_context *cur = vrend_state.current_ctx; in vrend_destroy_context()
5294 vrend_state.current_ctx = NULL; in vrend_destroy_context()
5295 vrend_state.current_hw_ctx = NULL; in vrend_destroy_context()
5298 if (vrend_state.use_core_profile) { in vrend_destroy_context()
5352 grctx->shader_cfg.use_gles = vrend_state.use_gles; in vrend_create_context()
5353 grctx->shader_cfg.use_core_profile = vrend_state.use_core_profile; in vrend_create_context()
5354 grctx->shader_cfg.use_explicit_locations = vrend_state.use_explicit_locations; in vrend_create_context()
5355 grctx->shader_cfg.max_draw_buffers = vrend_state.max_draw_buffers; in vrend_create_context()
5361 list_addtail(&grctx->ctx_entry, &vrend_state.active_ctx_list); in vrend_create_context()
5534 if (vrend_state.use_gles && gr->target == GL_TEXTURE_RECTANGLE_NV) { in vrend_renderer_resource_allocate_texture()
5543 if (vrend_state.use_gles && gr->target == GL_TEXTURE_1D) { in vrend_renderer_resource_allocate_texture()
5548 if (vrend_state.use_gles && gr->target == GL_TEXTURE_1D_ARRAY) { in vrend_renderer_resource_allocate_texture()
5574 if (vrend_state.use_gles || has_feature(feat_texture_storage)) { in vrend_renderer_resource_allocate_texture()
5628 } else if (gr->target == GL_TEXTURE_1D && vrend_state.use_gles) { in vrend_renderer_resource_allocate_texture()
5779 LIST_FOR_EACH_ENTRY(ctx, &vrend_state.active_ctx_list, ctx_entry) { in vrend_renderer_resource_unref()
6048 …if (vrend_state.use_core_profile == true && (res->y_0_top || (res->base.format == (enum pipe_forma… in vrend_renderer_transfer_write_iov()
6093 if ((!vrend_state.use_core_profile) && (res->y_0_top)) { in vrend_renderer_transfer_write_iov()
6157 if (!vrend_state.use_core_profile) in vrend_renderer_transfer_write_iov()
6183 if (vrend_state.use_gles) { in vrend_renderer_transfer_write_iov()
6207 if (!vrend_state.use_core_profile) in vrend_renderer_transfer_write_iov()
6291 } else if (vrend_state.use_gles) { in vrend_transfer_send_getteximage()
6299 } else if (vrend_state.use_gles) { in vrend_transfer_send_getteximage()
6410 if (!vrend_state.use_core_profile) { in vrend_transfer_send_readpixels()
6426 if (vrend_state.use_gles) { in vrend_transfer_send_readpixels()
6451 if (!vrend_state.use_core_profile) in vrend_transfer_send_readpixels()
6674 if (vrend_state.use_core_profile) { in vrend_set_polygon_stipple()
6706 if (vrend_state.use_core_profile) { in vrend_set_clip_state()
6874 if (vrend_state.use_gles) { in vrend_resource_copy_fallback()
7207 if (vrend_state.use_gles && in vrend_renderer_blit_int()
7281 if (!vrend_state.use_gles) { in vrend_renderer_blit_int()
7373 if (vrend_state.sync_thread) { in vrend_renderer_create_fence()
7374 pipe_mutex_lock(vrend_state.fence_mutex); in vrend_renderer_create_fence()
7375 list_addtail(&fence->fences, &vrend_state.fence_wait_list); in vrend_renderer_create_fence()
7376 pipe_condvar_signal(vrend_state.fence_cond); in vrend_renderer_create_fence()
7377 pipe_mutex_unlock(vrend_state.fence_mutex); in vrend_renderer_create_fence()
7379 list_addtail(&fence->fences, &vrend_state.fence_list); in vrend_renderer_create_fence()
7410 if (!vrend_state.inited) in vrend_renderer_check_fences()
7413 if (vrend_state.sync_thread) { in vrend_renderer_check_fences()
7414 flush_eventfd(vrend_state.eventfd); in vrend_renderer_check_fences()
7415 pipe_mutex_lock(vrend_state.fence_mutex); in vrend_renderer_check_fences()
7416 LIST_FOR_EACH_ENTRY_SAFE(fence, stor, &vrend_state.fence_list, fences) { in vrend_renderer_check_fences()
7421 pipe_mutex_unlock(vrend_state.fence_mutex); in vrend_renderer_check_fences()
7425 LIST_FOR_EACH_ENTRY_SAFE(fence, stor, &vrend_state.fence_list, fences) { in vrend_renderer_check_fences()
7484 if (!vrend_state.inited) in vrend_renderer_check_queries()
7487 LIST_FOR_EACH_ENTRY_SAFE(query, stor, &vrend_state.waiting_query_list, waiting_queries) { in vrend_renderer_check_queries()
7496 if (ctx == vrend_state.current_ctx && ctx->ctx_switch_pending == false) in vrend_hw_switch_context()
7507 vrend_state.current_ctx = ctx; in vrend_hw_switch_context()
7517 if (vrend_state.current_hw_ctx == ctx) in vrend_finish_context_switch()
7520 vrend_state.current_hw_ctx = ctx; in vrend_finish_context_switch()
7655 if (vrend_state.use_gles && q->gltype == GL_TIMESTAMP) { in vrend_end_query()
7685 list_addtail(&q->waiting_queries, &vrend_state.waiting_query_list); in vrend_get_query_result()
7801 if (vrend_state.use_gles) { in vrender_get_glsl_version()
7870 if (gl_ver > 0 && !vrend_state.use_core_profile) { in vrend_renderer_fill_caps_v1()
7906 vrend_state.max_uniform_blocks = max; in vrend_renderer_fill_caps_v1()
8036 caps->v1.max_render_targets = vrend_state.max_draw_buffers; in vrend_renderer_fill_caps_v1()
8217 if (vrend_state.use_gles) { in vrend_renderer_fill_caps()
8280 } else if (vrend_state.use_gles) { in vrend_renderer_get_cursor_contents()
8327 vrend_state.current_ctx = NULL; in vrend_renderer_force_ctx_0()
8328 vrend_state.current_hw_ctx = NULL; in vrend_renderer_force_ctx_0()
8464 ctx_params.major_ver = vrend_state.gl_major_ver; in vrend_renderer_create_sub_ctx()
8465 ctx_params.minor_ver = vrend_state.gl_minor_ver; in vrend_renderer_create_sub_ctx()
8546 if (vrend_state.sync_thread) in vrend_reset_fences()
8547 pipe_mutex_lock(vrend_state.fence_mutex); in vrend_reset_fences()
8549 LIST_FOR_EACH_ENTRY_SAFE(fence, stor, &vrend_state.fence_list, fences) { in vrend_reset_fences()
8553 if (vrend_state.sync_thread) in vrend_reset_fences()
8554 pipe_mutex_unlock(vrend_state.fence_mutex); in vrend_reset_fences()
8559 if (vrend_state.sync_thread) { in vrend_renderer_reset()
8561 vrend_state.stop_sync_thread = false; in vrend_renderer_reset()
8573 if (!vrend_state.inited) in vrend_renderer_get_poll_fd()
8576 return vrend_state.eventfd; in vrend_renderer_get_poll_fd()