• Home
  • Raw
  • Download

Lines Matching refs:svga

61    struct svga_context *svga = svga_context(pipe);  in svga_destroy()  local
65 for (i = 0; i < ARRAY_SIZE(svga->rasterizer_no_cull); i++) { in svga_destroy()
66 if (svga->rasterizer_no_cull[i]) { in svga_destroy()
67 pipe->delete_rasterizer_state(pipe, svga->rasterizer_no_cull[i]); in svga_destroy()
72 if (svga->depthstencil_disable) { in svga_destroy()
73 pipe->delete_depth_stencil_alpha_state(pipe, svga->depthstencil_disable); in svga_destroy()
77 for (shader = 0; shader < ARRAY_SIZE(svga->state.hw_draw.constbuf); shader++) { in svga_destroy()
78 for (i = 0; i < ARRAY_SIZE(svga->state.hw_draw.constbuf[0]); i++) { in svga_destroy()
79 pipe_resource_reference(&svga->state.hw_draw.constbuf[shader][i], NULL); in svga_destroy()
83 pipe->delete_blend_state(pipe, svga->noop_blend); in svga_destroy()
86 svga_destroy_stream_output_queries(svga); in svga_destroy()
89 if (svga->gb_query) { in svga_destroy()
91 svga->gb_query = NULL; in svga_destroy()
94 util_blitter_destroy(svga->blitter); in svga_destroy()
96 svga_cleanup_sampler_state(svga); in svga_destroy()
97 svga_cleanup_framebuffer(svga); in svga_destroy()
98 svga_cleanup_tss_binding(svga); in svga_destroy()
99 svga_cleanup_vertex_state(svga); in svga_destroy()
100 svga_cleanup_tcs_state(svga); in svga_destroy()
102 svga_destroy_swtnl(svga); in svga_destroy()
103 svga_hwtnl_destroy(svga->hwtnl); in svga_destroy()
105 svga->swc->destroy(svga->swc); in svga_destroy()
107 util_bitmask_destroy(svga->blend_object_id_bm); in svga_destroy()
108 util_bitmask_destroy(svga->ds_object_id_bm); in svga_destroy()
109 util_bitmask_destroy(svga->input_element_object_id_bm); in svga_destroy()
110 util_bitmask_destroy(svga->rast_object_id_bm); in svga_destroy()
111 util_bitmask_destroy(svga->sampler_object_id_bm); in svga_destroy()
112 util_bitmask_destroy(svga->sampler_view_id_bm); in svga_destroy()
113 util_bitmask_destroy(svga->shader_id_bm); in svga_destroy()
114 util_bitmask_destroy(svga->surface_view_id_bm); in svga_destroy()
115 util_bitmask_destroy(svga->stream_output_id_bm); in svga_destroy()
116 util_bitmask_destroy(svga->query_id_bm); in svga_destroy()
117 u_upload_destroy(svga->const0_upload); in svga_destroy()
118 u_upload_destroy(svga->pipe.stream_uploader); in svga_destroy()
119 u_upload_destroy(svga->pipe.const_uploader); in svga_destroy()
120 svga_texture_transfer_map_upload_destroy(svga); in svga_destroy()
124 for (i = 0; i < ARRAY_SIZE(svga->curr.constbufs[shader]); ++i) { in svga_destroy()
125 pipe_resource_reference(&svga->curr.constbufs[shader][i].buffer, NULL); in svga_destroy()
129 FREE(svga); in svga_destroy()
137 struct svga_context *svga = NULL; in svga_context_create() local
142 svga = CALLOC_STRUCT(svga_context); in svga_context_create()
143 if (!svga) in svga_context_create()
146 list_inithead(&svga->dirty_buffers); in svga_context_create()
148 svga->pipe.screen = screen; in svga_context_create()
149 svga->pipe.priv = priv; in svga_context_create()
150 svga->pipe.destroy = svga_destroy; in svga_context_create()
151 svga->pipe.stream_uploader = u_upload_create(&svga->pipe, 1024 * 1024, in svga_context_create()
155 if (!svga->pipe.stream_uploader) in svga_context_create()
158 u_upload_disable_persistent(svga->pipe.stream_uploader); in svga_context_create()
160 svga->pipe.const_uploader = u_upload_create(&svga->pipe, 128 * 1024, in svga_context_create()
163 if (!svga->pipe.const_uploader) in svga_context_create()
166 u_upload_disable_persistent(svga->pipe.const_uploader); in svga_context_create()
168 svga->swc = svgascreen->sws->context_create(svgascreen->sws); in svga_context_create()
169 if (!svga->swc) in svga_context_create()
172 svga_init_resource_functions(svga); in svga_context_create()
173 svga_init_blend_functions(svga); in svga_context_create()
174 svga_init_blit_functions(svga); in svga_context_create()
175 svga_init_depth_stencil_functions(svga); in svga_context_create()
176 svga_init_draw_functions(svga); in svga_context_create()
177 svga_init_flush_functions(svga); in svga_context_create()
178 svga_init_misc_functions(svga); in svga_context_create()
179 svga_init_rasterizer_functions(svga); in svga_context_create()
180 svga_init_sampler_functions(svga); in svga_context_create()
181 svga_init_fs_functions(svga); in svga_context_create()
182 svga_init_vs_functions(svga); in svga_context_create()
183 svga_init_gs_functions(svga); in svga_context_create()
184 svga_init_ts_functions(svga); in svga_context_create()
185 svga_init_vertex_functions(svga); in svga_context_create()
186 svga_init_constbuffer_functions(svga); in svga_context_create()
187 svga_init_query_functions(svga); in svga_context_create()
188 svga_init_surface_functions(svga); in svga_context_create()
189 svga_init_stream_output_functions(svga); in svga_context_create()
190 svga_init_clear_functions(svga); in svga_context_create()
191 svga_init_tracked_state(svga); in svga_context_create()
194 svga->curr.sample_mask = ~0; in svga_context_create()
197 svga->debug.no_swtnl = debug_get_option_no_swtnl(); in svga_context_create()
198 svga->debug.force_swtnl = debug_get_option_force_swtnl(); in svga_context_create()
199 svga->debug.use_min_mipmap = debug_get_option_use_min_mipmap(); in svga_context_create()
200 svga->debug.no_line_width = debug_get_option_no_line_width(); in svga_context_create()
201 svga->debug.force_hw_line_stipple = debug_get_option_force_hw_line_stipple(); in svga_context_create()
203 if (!(svga->blend_object_id_bm = util_bitmask_create())) in svga_context_create()
206 if (!(svga->ds_object_id_bm = util_bitmask_create())) in svga_context_create()
209 if (!(svga->input_element_object_id_bm = util_bitmask_create())) in svga_context_create()
212 if (!(svga->rast_object_id_bm = util_bitmask_create())) in svga_context_create()
215 if (!(svga->sampler_object_id_bm = util_bitmask_create())) in svga_context_create()
218 if (!(svga->sampler_view_id_bm = util_bitmask_create())) in svga_context_create()
221 if (!(svga->shader_id_bm = util_bitmask_create())) in svga_context_create()
224 if (!(svga->surface_view_id_bm = util_bitmask_create())) in svga_context_create()
227 if (!(svga->stream_output_id_bm = util_bitmask_create())) in svga_context_create()
230 if (!(svga->query_id_bm = util_bitmask_create())) in svga_context_create()
233 svga->hwtnl = svga_hwtnl_create(svga); in svga_context_create()
234 if (svga->hwtnl == NULL) in svga_context_create()
237 if (!svga_init_swtnl(svga)) in svga_context_create()
240 ret = svga_emit_initial_state(svga); in svga_context_create()
244 svga->const0_upload = u_upload_create(&svga->pipe, in svga_context_create()
249 if (!svga->const0_upload) in svga_context_create()
252 u_upload_disable_persistent(svga->const0_upload); in svga_context_create()
254 if (!svga_texture_transfer_map_upload_create(svga)) in svga_context_create()
259 memset(&svga->state.hw_clear, 0xcd, sizeof(svga->state.hw_clear)); in svga_context_create()
260 memset(&svga->state.hw_clear.framebuffer, 0x0, in svga_context_create()
261 sizeof(svga->state.hw_clear.framebuffer)); in svga_context_create()
262 memset(&svga->state.hw_clear.rtv, 0, sizeof(svga->state.hw_clear.rtv)); in svga_context_create()
263 svga->state.hw_clear.num_rendertargets = 0; in svga_context_create()
264 svga->state.hw_clear.dsv = NULL; in svga_context_create()
266 memset(&svga->state.hw_draw, 0xcd, sizeof(svga->state.hw_draw)); in svga_context_create()
267 memset(&svga->state.hw_draw.views, 0x0, sizeof(svga->state.hw_draw.views)); in svga_context_create()
268 memset(&svga->state.hw_draw.num_samplers, 0, in svga_context_create()
269 sizeof(svga->state.hw_draw.num_samplers)); in svga_context_create()
270 memset(&svga->state.hw_draw.num_sampler_views, 0, in svga_context_create()
271 sizeof(svga->state.hw_draw.num_sampler_views)); in svga_context_create()
272 memset(svga->state.hw_draw.sampler_views, 0, in svga_context_create()
273 sizeof(svga->state.hw_draw.sampler_views)); in svga_context_create()
274 svga->state.hw_draw.num_views = 0; in svga_context_create()
275 svga->state.hw_draw.num_backed_views = 0; in svga_context_create()
276 svga->state.hw_draw.rasterizer_discard = FALSE; in svga_context_create()
279 svga->state.hw_draw.vs = NULL; in svga_context_create()
280 svga->state.hw_draw.gs = NULL; in svga_context_create()
281 svga->state.hw_draw.fs = NULL; in svga_context_create()
282 svga->state.hw_draw.tcs = NULL; in svga_context_create()
283 svga->state.hw_draw.tes = NULL; in svga_context_create()
286 memset(svga->state.hw_draw.constbuf, 0, in svga_context_create()
287 sizeof(svga->state.hw_draw.constbuf)); in svga_context_create()
288 memset(svga->state.hw_draw.default_constbuf_size, 0, in svga_context_create()
289 sizeof(svga->state.hw_draw.default_constbuf_size)); in svga_context_create()
290 memset(svga->state.hw_draw.enabled_constbufs, 0, in svga_context_create()
291 sizeof(svga->state.hw_draw.enabled_constbufs)); in svga_context_create()
292 svga->state.hw_draw.ib = NULL; in svga_context_create()
293 svga->state.hw_draw.num_vbuffers = 0; in svga_context_create()
294 memset(svga->state.hw_draw.vbuffers, 0, in svga_context_create()
295 sizeof(svga->state.hw_draw.vbuffers)); in svga_context_create()
296 svga->state.hw_draw.const0_buffer = NULL; in svga_context_create()
297 svga->state.hw_draw.const0_handle = NULL; in svga_context_create()
315 svga->noop_blend = svga->pipe.create_blend_state(&svga->pipe, &noop_tmpl); in svga_context_create()
318 svga->dirty = SVGA_NEW_ALL; in svga_context_create()
319 svga->pred.query_id = SVGA3D_INVALID_ID; in svga_context_create()
320 svga->disable_rasterizer = FALSE; in svga_context_create()
326 svga_create_stream_output_queries(svga); in svga_context_create()
331 svga_destroy_swtnl(svga); in svga_context_create()
333 if (svga->const0_upload) in svga_context_create()
334 u_upload_destroy(svga->const0_upload); in svga_context_create()
335 if (svga->pipe.const_uploader) in svga_context_create()
336 u_upload_destroy(svga->pipe.const_uploader); in svga_context_create()
337 if (svga->pipe.stream_uploader) in svga_context_create()
338 u_upload_destroy(svga->pipe.stream_uploader); in svga_context_create()
339 svga_texture_transfer_map_upload_destroy(svga); in svga_context_create()
340 if (svga->hwtnl) in svga_context_create()
341 svga_hwtnl_destroy(svga->hwtnl); in svga_context_create()
342 if (svga->swc) in svga_context_create()
343 svga->swc->destroy(svga->swc); in svga_context_create()
344 util_bitmask_destroy(svga->blend_object_id_bm); in svga_context_create()
345 util_bitmask_destroy(svga->ds_object_id_bm); in svga_context_create()
346 util_bitmask_destroy(svga->input_element_object_id_bm); in svga_context_create()
347 util_bitmask_destroy(svga->rast_object_id_bm); in svga_context_create()
348 util_bitmask_destroy(svga->sampler_object_id_bm); in svga_context_create()
349 util_bitmask_destroy(svga->sampler_view_id_bm); in svga_context_create()
350 util_bitmask_destroy(svga->shader_id_bm); in svga_context_create()
351 util_bitmask_destroy(svga->surface_view_id_bm); in svga_context_create()
352 util_bitmask_destroy(svga->stream_output_id_bm); in svga_context_create()
353 util_bitmask_destroy(svga->query_id_bm); in svga_context_create()
354 FREE(svga); in svga_context_create()
355 svga = NULL; in svga_context_create()
359 return svga ? &svga->pipe:NULL; in svga_context_create()
364 svga_context_flush(struct svga_context *svga, in svga_context_flush() argument
367 struct svga_screen *svgascreen = svga_screen(svga->pipe.screen); in svga_context_flush()
371 SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_CONTEXTFLUSH); in svga_context_flush()
373 svga->curr.nr_fbs = 0; in svga_context_flush()
379 if (svga->state.hw_draw.const0_handle) { in svga_context_flush()
380 assert(svga->state.hw_draw.const0_buffer); in svga_context_flush()
381 u_upload_unmap(svga->const0_upload); in svga_context_flush()
382 pipe_resource_reference(&svga->state.hw_draw.const0_buffer, NULL); in svga_context_flush()
383 svga->state.hw_draw.const0_handle = NULL; in svga_context_flush()
389 svga_context_flush_buffers(svga); in svga_context_flush()
391 svga->hud.command_buffer_size += in svga_context_flush()
392 svga->swc->get_command_buffer_size(svga->swc); in svga_context_flush()
396 t0 = svga_get_time(svga); in svga_context_flush()
397 svga->swc->flush(svga->swc, &fence); in svga_context_flush()
398 svga->hud.flush_time += (svga_get_time(svga) - t0); in svga_context_flush()
400 svga->hud.num_flushes++; in svga_context_flush()
402 svga_screen_cache_flush(svgascreen, svga, fence); in svga_context_flush()
404 SVGA3D_ResetLastCommand(svga->swc); in svga_context_flush()
409 svga->rebind.flags.rendertargets = TRUE; in svga_context_flush()
410 svga->rebind.flags.texture_samplers = TRUE; in svga_context_flush()
412 if (svga_have_gb_objects(svga)) { in svga_context_flush()
414 svga->rebind.flags.constbufs = TRUE; in svga_context_flush()
415 svga->rebind.flags.vs = TRUE; in svga_context_flush()
416 svga->rebind.flags.fs = TRUE; in svga_context_flush()
417 svga->rebind.flags.gs = TRUE; in svga_context_flush()
419 if (svga_have_sm5(svga)) { in svga_context_flush()
420 svga->rebind.flags.tcs = TRUE; in svga_context_flush()
421 svga->rebind.flags.tes = TRUE; in svga_context_flush()
424 if (svga_need_to_rebind_resources(svga)) { in svga_context_flush()
425 svga->rebind.flags.query = TRUE; in svga_context_flush()
431 svga->pipe.screen->fence_finish(svga->pipe.screen, NULL, fence, in svga_context_flush()
440 SVGA_STATS_TIME_POP(svga_sws(svga)); in svga_context_flush()
448 svga_context_finish(struct svga_context *svga) in svga_context_finish() argument
450 struct pipe_screen *screen = svga->pipe.screen; in svga_context_finish()
453 SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_CONTEXTFINISH); in svga_context_finish()
455 svga_context_flush(svga, &fence); in svga_context_finish()
459 SVGA_STATS_TIME_POP(svga_sws(svga)); in svga_context_finish()
469 svga_hwtnl_flush_retry(struct svga_context *svga) in svga_hwtnl_flush_retry() argument
473 SVGA_RETRY_OOM(svga, ret, svga_hwtnl_flush(svga->hwtnl)); in svga_hwtnl_flush_retry()
484 svga_hwtnl_flush_buffer(struct svga_context *svga, in svga_hwtnl_flush_buffer() argument
487 if (svga_hwtnl_is_buffer_referred(svga->hwtnl, buffer)) { in svga_hwtnl_flush_buffer()
488 svga_hwtnl_flush_retry(svga); in svga_hwtnl_flush_buffer()
497 svga_surfaces_flush(struct svga_context *svga) in svga_surfaces_flush() argument
499 SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_SURFACEFLUSH); in svga_surfaces_flush()
503 svga_hwtnl_flush_retry(svga); in svga_surfaces_flush()
507 svga_propagate_rendertargets(svga); in svga_surfaces_flush()
509 SVGA_STATS_TIME_POP(svga_sws(svga)); in svga_surfaces_flush()